Omega OMB-DAQ-54 User Manual page 125

Usb data acquisition modules
Table of Contents

Advertisement

The acquisition begins upon detection of the trigger event. The trigger event is configured with
daqAdcSetTrigEnhanced. The next line defines the trigger event to be the immediate trigger source.
This is the source that will start the acquisition immediately. The variable DatsImmediate& is a
constant defined in PDAQX.BAS. Since the trigger source is configured as immediate, the other trigger
parameters are not applied, but the arrays (adcRanges and trigSense) must still be initialized.
For i = 0 To ChanCount - 1
Next i
ret& = VBdaqAdcSetTrigEnhanced&(handle&, trgSrc&(), gains&(), adcRanges&(),
A buffer now is configured to hold the A/D data to be acquired. Since this is to be a fixed length transfer
to a linear buffer, the buffer cycle mode should be turned off with DatmCycleOff&. The buffer size is
set to 10 scans.
Note: The user-defined buffer must have been allocated with sufficient storage to hold the entire transfer
prior to invoking the following line:
ret& = VBdaqAdcTransferSetBufferSingle&(handle&, buf!(), 10, DatmUpdateBlock
+ DatmCycleOff)
With all acquisition parameters being configured, the acquisition can now be armed. Once armed, the
acquisition will begin immediately upon detection of the trigger event. As in the case of the immediate
trigger, the acquisition will begin immediately upon execution of the daqAdcArm function.
ret& = VBdaqAdcArm&(handle&)
After setting up and arming the acquisition, the data is immediately ready to be collected. Had the trigger
source been anything other than immediate, the data would only be ready after the trigger had been
satisfied. The following line initiates an A/D transfer from the Personal Daq device to the defined user
buffer.
ret& = VBdaqAdcTransferStart&(handle&)
Wait for the transfer to complete in its entirety, then proceed with normal application processing.
This can be accomplished with the daqWaitForEvent command. The daqWaitForEvent allows
the application processing to become blocked until the specified event has occurred. DteAdcDone,
indicates that the event to wait for is the completion of the transfer.
ret& = VBdaqWaitForEvent(handle&,DteAdcDone&)
At this point, the transfer is complete; all data from the acquisition is available for further processing.
Print "Results of Transfer:"
For i& = 0 To 9
Next i&
A-6
API Custom Program Models
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
trgSrc&(i) = DatsImmediate&
adcRanges&(i) = 0
trigSense&(i) = 0
levels!(i) = 0
hysteresis!(i) = 0
trigSense&(), levels!(), hysteresis!(), chans&(), 0, "")
Print "Scan "; Format$(Str$(i& + 1), "00"); " -->";
For k& = k& To k& + 7
Print Format$(Str$(buf%(k&)), "00000"); "
Next k&
Print
Appendix A,
878495
";
Personal Daq User's Manual

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Omb-daq-55Omb-daq-56

Table of Contents