API Programming - General Models 2
Data Acquisition Environment……2-1
Application Programming Interface (API) ……2-1
Hardware Capabilities and Constraints……2-1
Signal Environment……2-2
Seven Easy Steps to Data Acquisition …… 2-2
Models
Initialization and Error Handling……2-9
One-Step Command Acquisitions ……2-11
Counted Acquisitions Using Linear Buffers…2-12
Indefinite Acquisition, Direct-To-Disk Using Circular Buffers……2-14
Analog Output……2-16
Generating DAC FIFO Waveforms ……2-18
Digital I/O on P2……2-19
Using DBK Card Calibration Files……2-20
Zero Compensation……2-23
Linear Conversion……2-25
Reference Note:
Specific Daq Device and DBK program examples are included on the install CD.
The install CD readme.file states the location of the examples.
This chapter shows how to combine API functions to perform typical tasks. Depending on your
level of programming expertise, once you understand how the API works in conjunction with
the hardware you can begin creating custom data acquisition programs.
This chapter is divided into two primary sections, as follows:
• Data Acquisition Environment outlines related concepts and defines Daq device
capabilities the programmer must work with (the API, hardware features, and signal
management).
• The Models section explains the sequence and type of operations necessary for data
acquisition. Some models are provided in Visual Basic, while others appear in C/C++
code. These models provide the software building blocks to develop more complex
and specialized programs.
Data Acquisition Environment
To write effective data acquisition software, programmers must understand:
• Software tools (the API documented in this manual and the programming language—you
may need to consult documentation for your chosen language)
• Hardware capabilities and constraints
• General concepts of data acquisition and signal management
Application Programming Interface (API)
The API includes all the software functions needed for building a data acquisition system with
the hardware described in this manual. The API Command Reference section of this manual
includes details regarding how each function is used (parameters, hardware applicability, etc).
In addition, you may need to consult your language and computer documentation.
Hardware Capabilities and Constraints
To program the system effectively, you must understand your Daq device and DBK hardware
capabilities. Obviously you cannot program the hardware to perform beyond its design and
specifications, but you also want to take full advantage of the system’s power and features.
In the User’s Manual, you may need to refer to sections that describe your hardware’s
capability. In addition, you may need to consult your computer documentation. In some
cases, you may need to verify the hardware setup, use of channels, and signal conditioning
options (some hardware devices have jumpers and DIP switches that must match the
programming, especially as the system evolves).
Programmer’s Manual 988594 API Programming, General Models 2-1