Summary guide of selected api functions – Measurement Computing WaveBook rev.3.0 User Manual
Page 196

C-22 daqX API - Programming Models,
6-22-99
WaveBook User’s Manual
Summary Guide of Selected API Functions
The following table organizes the enhanced API functions by type and includes notes on when to use them.
Summary Guide of Selected Enhanced API Functions
Simple One-Step Routines
For single gain, consecutive channel, foreground transfers, use the following functions:
Foreground Operation
Single Scan
Multiple Scans
Single Channel
daqAdcRd
daqAdcRdN
Consecutive Multiple Channels
daqAdcRdScan
daqAdcRdScanN
Complex A/D Scan Group Configuration Routines
For non-consecutive or high-speed digital channels, multiple gain or polarity settings, use the SetScan functions.
daqAdcSetScan
Set scan sequence using arrays of channel and gain values.
daqAdcSetMux
Set a contiguous scan sequence using single gain, polarity, flag values
Trigger Options
After the scan is set, the trigger needs to be set. A single trigger starts the scans, and the pacer clock determines the
rate between scans.
Note: If the trigger source is analog, a trigger level is also required.
daqAdcSetTrigEnhanced
The enhanced trigger may be defined as a combination of multiple A/D
analog-level event conditions that are logically AND’d or OR’d.
daqAdcSetTrig
Configures the trigger event using source, level, rising and channel values.
daqAdcCalcTrig
Using the selected trigger voltage, trigger direction, channel gain, and
reference voltage, return the analog trigger source and value which can be
used with daqAdcSetTrig.
If a software trigger is selected, the start time of the scan depends on the application calling daAdcSoftTrig.
Multiple Scan Timing
If the acquisition is to have multiple scans, the pacer clock needs to be set with one of the following functions:
DaqAdcSetClockSource
Sets clock source to drive the ADC acquisition frequency.
daqAdcSetRate
Set/Get the specified frequency or period for the specified mode.
daqAdcSetFreq
Set the pacer clock to the given frequency.
A/D Acquisition
A/D acquisition settings are not active until the acquisition is armed.
daqAdcSetAcq
Define the mode of the acquisition and set the pre-trigger and post-trigger
acquisition counts, if applicable.
daqAdcArm
Arm an A/D acquisition using the current configuration. If the trigger source
was set to be immediate, the acquisition will be triggered immediately.
daqAdcDisarm
Disarm the current acquisition if one is active. This command will disarm
the current acquisition and terminate any current A/D transfers.
A/D Data Transfer
After the acquisition is started, the data needs to be transferred to the application buffer. Three routines are used:
daqAdcTransferSetBuffer
Configure a buffer for A/D transfer. Allows configuration of the buffer for
block and single-reading update-modes, as well as linear and circular
buffer definitions. Selects user or driver buffer.
daqAdcTransferStart
Start a transfer from the Daq* device to the buffer specified in the
daqAdcTransferSetBuffer
command
daqAdcTransferStop
Stop a transfer from the Daq* device to the buffer specified in the
daqAdcTransferSetBuffer
command
To find out whether a background A/D transfer is complete or to stop transfers, use the following function:
daqAdcTransferGetStat
Return current A/D transfer status as well as a count representing the total
number of transferred scans or the number of scans available.
Digital Functions
DaqIORead
Read digital port.
daqIOWrite
Write digital port.