Omega OMB-DAQ-54 User Manual page 127

Usb data acquisition modules
Table of Contents

Advertisement

' Define arrays of channels and gains : 1-8 , unity gain
For x& = 0 To 7
channels&(x&) = x& + 1
gains&(x&) = PgainX1&
flags&(x&) = DafAnalog& + DafSingleEnded&
Next x&
' Load scan sequence FIFO
ret& = VBdaqAdcSetScan&(handle&,channels&(), gains&(), flags&(), 8)
The acquisition mode needs to be configured to be fixed-length acquisition with no pre-trigger scan data
and 10 scans of post-trigger scan data. The mode is set to DaamInfinitePost&, which will configure
the acquisition as having indefinite length and, as such, will be terminated by the application. In this mode,
the pre- and post-trigger count values are ignored.
ret& = VBdaqAdcSetAcq&(handle&,DaamInfinitePost&, 0, 0)
Next, set the internal sample rate to 3 Hz.
ret& = VBdaqAdcSetRate&(handle&,DarmFrequency&,DaasPostTrig&,3!,actual!)
The acquisition begins upon detection of the trigger event. The trigger event is configured with
(daqAdcSetTrigEnhanced)
which will start the acquisition immediately. The variable DatsSoftware& is a constant defined in
PDAQX.BAS
needed.
TrigSource& = DatsSoftware&
For i = 0 To 7
Next i
ret& = VBdaqAdcSetTrigEnhanced&(handle&, trgSrc&(), gains&(), adcRanges&(),
A buffer now is configured to hold the A/D data to be acquired. This buffer is necessary to hold incoming
A/D data while it is being prepared for disk I/O. Since this is to be an indefinite-length transfer to a
circular buffer, the buffer cycle mode should be turned on with DatmCycleOn&. For efficiency, block
update mode is specified with DatmUpdateSingle&. The buffer size is set to 10,000 scans. The buffer
size indicates only the size of the circular buffer, not the total number of scans to be taken.
ret& = VBdaqAdcTransferSetBufferSingle&(handle&, buf!(), bufsize&,
DatmUpdateSingle& + DatmCycleOn&)
Note:
Two types of VB function wrappers exist for the API functions that reference data buffers. One
type references an integer buffer, and the other references a single-precision floating point buffer.
The wrappers that reference single-precision floating point buffers have the word
appended to the function name. For example,
used to set a single-precision floating point buffer, whereas
used to set an integer buffer.
Now the destination disk file is configured and opened. For this example, the disk file is a new file to be
created by the driver. After the following line has been executed, the specified file will be opened and
ready to accept data.
ret& = VBdaqAdcSetDiskFile&(handle&,"c:pdaqdata.bin", DaomCreateFile&, 0)
With all acquisition parameters being configured and the acquisition transfer to disk 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&)
A-8
API Custom Program Models
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
. The next line defines the trigger event to be the immediate trigger source
. Since the trigger source is configured as immediate, the other trigger parameters are not
trgSrc&(i) = DatsSoftware&
adcRanges&(i) = 0
trigSense&(i) = 0
levels!(i) = 0
hysteresis!(i) = 0
trigSense&(), levels!(), hysteresis!(), channels&(), 0, "")
Appendix A,
VBdaqAdcTransferSetBufferSingle
VBdaqAdcTransferSetBuffer
878495
Single
would be
be
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