beautypg.com

Measurement Computing Personal Daq rev.6.0 User Manual

Page 131

background image

Personal Daq User’s Manual Appendix A,

878495

API Custom Program Modules A-13

ret& = VBdaqSetOption(handle&, chans&(i&), DcofChannel, DcotpDaqPulses, DcovPulseCount)
ret& = VBdaqSetOption(handle&, chans&(i&), DcofChannel, DcotpDaqRising,

DcovEdgeRising)

ret& = VBdaqSetOption(handle&, chans&(i&), DcofChannel, DcotpDaqDebounceTime,

DcovDebounce0)

ret& = VBdaqSetOption(handle&, chans&(i&), DcofChannel, DcotpDaqMinFreq, 0!)
ret& = VBdaqSetOption(handle&, chans&(i&), DcofChannel, DcotpDaqMaxFreq, 1000!)
ret& = VBdaqSetOption(handle&, chans&(i&), DcofChannel, DcotpDaqFreqRes, 1!)

ElseIf (14 <= i) And (i < 16) Then
' Frequency input channels configured for pulse count

chans&(i) = startChan + 2 + (i - 14)
flags&(i) = CtrFlags

ret& = VBdaqSetOption(handle&, chans&(i&), DcofChannel, DcotpDaqPulses, DcovPulseCount)
ret& = VBdaqSetOption(handle&, chans&(i&), DcofChannel, DcotpDaqRising,

DcovEdgeRising)

ret& = VBdaqSetOption(handle&, chans&(i&), DcofChannel, DcotpDaqDebounceTime,

DcovDebounce0)

End If
gains(i) = PGainX1

Next i

The VBdaqAdcSetDataFormat function is used to configure the driver to return the raw data in floating point format, which
is a requirement for Personal Daq software. Post-acquisition data will be presented as raw data.

ret& = VBdaqAdcSetDataFormat&(handle&, DardfFloat&, DappdfRaw)

The scan group consisting of multiple channels must be configured using the VBdaqAdcSetScan function.

ret& = VBdaqAdcSetScan&(handle&, chans&(), gains&(), flags&(), ChanCount&)

The arrays used to specify the parameters of the trigger event are initialized prior to the invocation of the
VBdaqAdcSetTrigEnhanced function, which will use the parameters to configure a trigger event for the acquisition. Based
on the parameters below, the acquisition will trigger immediately upon arming. The adcRanges&, trigSense&, levels!, and
hysteresis! arrays are initialized, but the values will not affect the trigger event configuration, as DatsImmediate configures
an immediate trigger.

For i = 0 To ChanCount - 1
trgSrc&(i) = DatsImmediate&
adcRanges&(i) = DarBiMinus5to5V
trigSense&(i) = DetsRisingEdge&
levels!(i) = 0
hysteresis!(i) = 0
Next i
ret& = VBdaqAdcSetTrigEnhanced&(handle&, trgSrc&(), gains&(), adcRanges&(), _
trigSense&(), levels!(), hysteresis!(), _chans&(), ChanCount&, "")

Next, the acquisition mode is characterized as one that continues until the previously defined scan count has been satisfied.

ret& = VBdaqAdcSetAcq&(handle&, DaamNShot&, 0, ScanCount&)

The post-trigger scan rate is configured using the previously defined Freq! value, and the actualRate! variable is passed by
reference to hold the actual rate for which the device was configured in the event that the requested rate could not be
configured.

ret& = VBdaqAdcSetRate&(handle&, DarmFrequency, DaasPostTrig, Freq!, actualRate!)

In VisualBASIC, there are two different function wrappers for the VBDaqAdcTransferSetBuffer function, one of which is shown below.
The other function wrapper is named VBdaqAdcTransferSetBuffer. The only difference between the two wrappers is manifested in the buf
parameter. There are essentially two different buffer types that can be used, one containing integer elements and the other containing
single precision floating-point elements. The VBdaqAdcTransferSetBufferSingle function should be called to use a single precision
floating-point buffer in VisualBASIC.

ret& = VBdaqAdcTransferSetBufferSingle&(handle&, buf!(), ScanCount&, DatmReturn)


Note: This

section,

Multiple Channel Types, demonstrated the configuration of acquisitions using multiple channel types

in the same scan sequence. After all of the prior code has been executed, the transfer can be started and the
acquisition can be armed in the same manner as shown in the other models.

This manual is related to the following products: