Basic models, Enhanced vs standard api, Hardware capabilities & constraints – Measurement Computing WaveBook rev.3.0 User Manual
Page 176: Signal environment
![background image](https://www.manualsdir.com/files/797847/content/doc176.png)
C-2 daqX API - Programming Models,
6-22-99
WaveBook User’s Manual
Enhanced vs Standard API
Language support varies as follows:
• The Enhanced API (32-bit only) is called DaqX and can accommodate C, Visual Basic, and Delphi.
• The Standard API accommodates C (16-bit, or 32-bit), QuickBASIC (16-bit only),
Visual Basic (16-bit, or 32-bit), and Turbo Pascal 7 (16-bit only).
Coding for the Enhanced and Standard API cannot be used together; Enhanced and
Standard models are slightly different (this appendix deals with the Enhanced API models
only; Appendix E pertains to the older, Standard API.
Hardware Capabilities & Constraints
To program effectively, you must understand your 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. You may need to refer to sections of the manual 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).
Signal Environment
Several data acquisition concepts are listed here and discussed in chapter 8, Theory of Operation.
• Device and Parameter Definitions: Refer to the related reference tables at the end of Appendix D.
• Scan Rates and Sequencing: With multiple scans, the time between scans becomes a parameter. This
time can be a constant or can be dependent upon a trigger.
• Triggering Options: Triggering starts the A/D conversion. The trigger can be an external analog or
TTL trigger or a program-controlled software trigger. Refer to the trigger reference tables at the end of
Appendix D and to the trigger information in chapter 8.
• Foreground / Background: Foreground transfer routines require the entire transfer to occur before
returning control to the application program. Background routines start the A/D acquisition and return
control to the application program before the transfer occurs. Data is transferred while the application
program is running. Data will be transferred to the user memory buffer during program execution in 1
sample or 2048 sample blocks, depending on the configuration. The programmer must determine what
tasks can proceed in the background while other tasks perform in the foreground and how often the
status of the background operations should be checked.
Parameters in the various A/D routines include: Number of channels, number of scans, start of conversion
triggering, timing between scans, and mode of data transfer. Channels sampled in a scan can be consecutive
or non-consecutive with the same or different gains. The scan sequence makes no distinction between local
and expansion channels.
Basic Models
This section outlines basic programming steps commonly used for data acquisition. Consider the models as
building blocks that can be put together in different ways or modified as needed. As a general tutorial,
these examples use Visual Basic since most programmers know BASIC and can translate to other languages
as needed. The Enhanced API programming models discussed in this appendix include:
Model Type
Model Name
Page
Configuration
Initialization and Error Handling
C-3
Foreground Acquisition with One-Step Commands
Counted Acquisition Using Linear Buffers
Indefinite Acquisition, Direct-To-Disk Using Circular Buffers
Multiple Hardware Scans, Software Triggering
C-10
Background Acquisition
Acquisition
Complex Triggering
C-13
Data Handling
Data Packing and Rotating
Direct-to-Disk Transfers
Transfers With Driver-Allocated Buffers