beautypg.com

Summary guide of selected enhanced api functions – Measurement Computing TempBook rev.3.0 User Manual

Page 124

background image

10-28 Enhanced API Programming Models (TempBook)

TempBook User’s Manual

Summary Guide of Selected Enhanced API Functions

The following table organizes the enhanced API functions by type and includes a brief description.

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 channels, high-speed digital channels, multiple gain settings, or multiple 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 and channel flag values

Trigger Options

After the scan is set, the trigger needs to be set. The two triggering modes are one-shot or continuous.

In one-shot mode, a trigger is required to start each A/D scan.

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.

daqAdcSetTrig

Configure 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 and the trigger mode is one-shot, the pacer clock needs to be set with one of the

following functions:

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.

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.

daqAdcSetAcq

Define the mode of the acquisition and set the pre-trigger and post-trigger acquisition counts, if

applicable.

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.

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.