Measurement Computing Data Acquisition Systems rev.10.4 User Manual
Page 26

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.
Analog Output
The program DACEX1.BAS shows how to
output analog voltages on analog output
channels 0 and 1. These commands only
have to be issued one time unless a related
parameter is explicity changed. The output
voltages will be sustained. This example
demonstrates the use of the two digital-to-
analog converters (values used assume
bipolar mode). Functions used include:
•
VBdaqDacSetOutputMode&(ha
ndle&, DddtLocal&, 0,
DdomVoltage&)
•
VBdaqDacWt&(handle&,
deviceType&, chan&,
dataVal%)
•
VBdaqDacWtMany&(handle,
deviceTypes&(),chans&(),
dataVals&())
2-16 API Programming, General Models
988594
Programmer’s
Manual