beautypg.com

Measurement Computing Data Acquisition Systems rev.10.4 User Manual

Page 17

background image

Programmer’s Manual

988594

API Programming, General Models 2-7

It is good practice to enable the transfer of data into the buffer first by calling daqAdcTransferStart
command. This will ensure that a transfer is active and that the data buffer is ready to receive data so
that when the acquisition is triggered the scan data can be immediately placed into the data buffer. Once
the daqAdcArm command has been successfully invoked a trigger may occur at any time (obviously, once
the trigger condition has been satisfied).

Related API’s*

Description

daqAdcTransferStart

Enables scan data transfer into the buffer specified by the

daqAdcTransferSetBuffer command.

daqAdcArm

Arms the acquisition. This command is a pivotal command around

which the entire acquisition is configured. Once invoked this

command not only arms the acquisition it configures the

acquisition according to the acquisition configuration parameters

set by prior commands. It is here where any potential

configuration conflicts are flagged. Therefore it is important to

check return codes from this command.

*See the

API Command Reference chapter for detailed information.

6. Triggering the Acquisition

Once the acquisition has been armed it may be triggered at any time unless a pre-trigger data

has been requested. If pre-trigger data has been requested the trigger event detection will be

deferred until at least the specified amount of pre-trigger data has been collected. Any trigger

event that occurs before the specified pre-trigger amount has been collected will be ignored.

This deferring of the detection of the trigger event until the specified amount of pre-trigger

data has been collected ensures that the acquisition will produce, at minimum, the requested

pre-trigger amount.

The trigger event can be one of any valid trigger events for which the device is capable. For

more information on which trigger events your device is capable of detecting please refer to

the daqSetTriggerEvent command in the API definition.

Every device can be triggered via software:

err = daqAdcSoftTrig(handle);

Related API’s*

Description

daqAdcSoftTrig

Triggers the acquisition if software triggering is enabled.

*See the

API Command Reference chapter for detailed information.

7. Monitoring the Acquisition and Receiving Data

During the acquisition it may be necessary to monitor the progress of the acquisition and to

collect the data and process it. The daqAdcTransferGetStat function returns a total transfer

scan count as will as acquisition and transfer state information. Interpretation of the

information returned greatly depends on the the buffer model selected as well as whether or

not the buffer was set to linear or circular mode operation.

DWORD active,retCount;

DaqAdcTransferGetStat(handle,&active,&retCount);

The active parameter returns state information. The individual bits returned in this parameter

indicate the current state of both the acquisition and the transfer. The retCount parameter

returns a total running count of the amount of data transferred thus far. The following

sections show how to interpret this data: