Omega OMB-DAQ-54 User Manual page 130

Usb data acquisition modules
Table of Contents

Advertisement

The handle& variable will be assigned a handle to an opened Personal Daq/56 device using the
VBDaqOpen function. This handle must be used with most API functions. The data buffer consists of
single precision floating-point elements, the number of which is proportional to the product of the scan
count and the channel count. The variable i is a counter variable that is used to perform iteration
operations.
Dim handle&
Dim buf!(TotalCount&)
Dim i&
The deviceList string array, which is initialized using the VBDaqGetDeviceList function, is used to hold a
list of currently configured devices, and the deviceCount variable contains the number of devices in the
deviceList array.
Dim deviceList$()
Dim deviceCount&
The following scan sequence arrays will be used to store channel numbers, the flags for the channels, and
the gain settings for the channels. If element 0 of the channel sequence array has a value of 1 (channel 1),
then element 0 of the flag and gain sequence arrays will pertain to the flags and gain settings of channel 1.
Dim chans&(ChanCount&)
Dim flags&(ChanCount&)
Dim gains&(ChanCount&)
In order to configure the trigger event, the five arrays shown below must be allocated. These arrays are
allocated proportional to the channel count and follow the same order as the scan sequence arrays, in which
the first element corresponds to the setting pertaining to the first channel in the channel sequence array.
These arrays specify the source of the trigger event, appropriate polarity flags, sensitivity flags, analog
trigger levels, and hysteresis values.
Dim trgSrc&(ChanCount&)
Dim adcRanges&(ChanCount&)
Dim trigSense&(ChanCount&)
Dim levels!(ChanCount&)
Dim hysteresis!(ChanCount&)
When the VBDaqAdcSetRate function is used to configure the scan rate, the variable actualRate! will
contain the actual rate for which the device has been programmed in the event that the requested rate is
unattainable. The ret& variable is used to hold the return code of all other DaqX function calls
Dim actualRate!
dim ret&
A list of devices that are currently configured on the system along with the number of devices in the list
should be obtained using the VBDaqGetDeviceList function.
ret& = VBdaqGetDeviceList(deviceList, deviceCount
One of the methods used to dynamically locate and open a configured Personal Daq device is shown
below. The handle& variable is initialized to (-1) so it can be used at the end of the iteration to determine
if a device was successfully opened. The iteration on deviceIndex& will obtain the device properties for
each device in the device list and use the deviceType property to locate the first Personal Daq/56 device (if
any) that is installed and configured in the system. The first Personal Daq/56 that is found in the system is
opened using the VBdaqOpen function, which returns a value of –1 if the specified device cannot be
opened, thus changing the value of the handle in the case that the device is successfully initialized.
handle& = -1
For deviceIndex& = 0 To deviceCount – 1
ret& = VBdaqGetDeviceProperties(deviceList(deviceIndex), deviceProps)
If deviceProps.DeviceType = PersonalDaq56 Then
handle& = VBdaqOpen&(deviceList(deviceIndex))
Exit For
End If
Next deviceIndex&
Personal Daq User's Manual
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Appendix A,
878495
API Custom Program Models
A-11

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Omb-daq-55Omb-daq-56

Table of Contents