Measurement Computing Personal Daq rev.6.0 User Manual
Page 127

Personal Daq User’s Manual Appendix A,
878495
API Custom Program Modules A-9
After setting up and arming the acquisition, data collection will begin upon satisfaction of the trigger event.
Since the trigger source is software, the trigger event will not take place until the application issues the
software trigger event. To prepare for the trigger event, the following line initiates an A/D transfer from
the Daq* device to the defined user buffer and, subsequently, to the specified disk file. No data is
transferred at this point, however.
ret& = VBdaqAdcTransferStart&(handle&)
The transfer has been initiated, but no data will be transferred until the trigger event occurs. The following
line will signal the software trigger event to the driver; then A/D input data will be transferred to the
specified disk file as it is being collected.
ret& = VBdaqAdcSoftTrig&(handle&)
Both the acquisition and the transfer are now currently active. The transfer to disk will continue
indefinitely until terminated by the application. The application can monitor the transfer process with the
following lines of code:
acqTermination& = 0
Do
‘ Wait here for new data to arrive
ret& = VBdaqWaitForEvent(handle&,DteAdcData&)
‘ New data has been transferred - Check status
ret& = VBdaqAdcTransferGetStat&(handle&,active&,retCount&)
‘ Code may be placed here which will process the buffered data or
‘ perform other application activities.
‘
‘ At some point the application needs to determine the event on which
‘ the direct-to-disk acquisition is to be halted and set the
‘ acqTermination flag.
Loop While acqTermination& = 0
At this point the application is ready to terminate the acquisition to disk. The following line will terminate
the acquisition to disk and will close the disk file.
ret& = VBdaqAdcDisarm&(handle&)
The acquisition as well as the data transfer has been stopped. We should check status one more time to get
the total number of scans actually transferred to disk.
ret& = VBdaqAdcTransferGetStat(handle&,active&,retCount&)
The specified disk file is now available. The retCount& parameter will indicate the total number of
scans transferred to disk.