Daqadcrd, Daqadcrdn – Measurement Computing WaveBook rev.3.0 User Manual
Page 202

D-6 daqX API - Command Reference,
6-24-99
WaveBook User’s Manual
daqAdcRd
DLL Function
daqAdcRd(DaqHandleT handle, DWORD chan, PWORD sample, DaqAdcGain gain,
DWORD flags);
C
daqAdcRd(DaqHandleT handle, DWORD chan, PWORD sample, DaqAdcGain gain,
DWORD flags);
Visual BASIC
VBdaqAdcRd&(ByVal handle&, ByVal chan&, sample%, ByVal gain&, ByVal flags&)
Delphi
daqAdcRd(handle:DaqHandleT; chan:DWORD; var sample:WORD; const gain:DaqAdcGain;
flags:DWORD)
handle
Handle to the device for which the ADC reading is to be acquired
chan
A single channel number
sample
A pointer to a value where an A/D sample is stored. Valid values: (See daqAdcSetTag)
gain
The channel gain
Parameters
flags
Channel configuration flags in the form of a bit mask
DerrFIFOFull
Buffer Overrun
DerrInvGain
Invalid gain
DerrInvChan
Invalid channel
Returns
DerrNoError
No error (see the API Error Codes table at the end of this chapter).
See Also
daqAdcSetMux, daqAdcSetTrig, daqAdcSoftTrig
Program References
DACEX.PAS (Delphi)
Used With
All devices
Description
daqAdcRd
is used to take a single reading from the given local A/D channel. This function will use a software trigger to immediately
trigger and acquire one sample from the specified A/D channel. The chan parameter indicates the channel for which to take the sample.
The sample parameter is a pointer to where the collected sample should be stored. The gain parameter indicates the channel’s gain
setting. The flags parameter allows the setting of channel-dependent options. See ADC Flags Definition table for channel flags
definitions.
daqAdcRdN
DLL Function
daqAdcRdN(DaqHandleT handle, DWORD chan, PWORD buf, DWORD scanCount,
DaqAdcTriggerSource triggerSource, BOOL rising, WORD level, FLOAT freq, DaqAdcGain
gain, DWORD flags);
C
daqAdcRdN(DaqHandleT handle, DWORD chan, PWORD buf, DWORD scanCount,
DaqAdcTriggerSource triggerSource, BOOL rising, WORD level, FLOAT freq, DaqAdcGain
gain, DWORD flags);
Visual BASIC
VBdaqAdcRdN&(ByVal handle&, ByVal chan&, buf%(), ByVal scanCount&, ByVal
triggerSource&, ByVal rising&, ByVal level%, ByVal freq!, ByVal gain&, ByVal
flags&)
Delphi
daqAdcRdN(handle:DaqHandleT; chan:DWORD; buf:PWORD; scanCount:DWORD;
triggerSource:DaqAdcTriggerSource; rising:longbool; level:WORD; freq:single; const
gain:DaqAdcGain; flags:DWORD)
handle
Handle to the device for which the ADC channel samples are to be acquired
chan
A single channel number
buf
An array where the A/D scans will be returned
scanCount
The number of scans to be taken. Valid values: 1 - 32767
triggerSource
The trigger source
rising
Boolean flag to indicate the rising or falling edge for the trigger source
level
The trigger level if an analog trigger is specified. Valid values: 0 -4095
freq
The sampling frequency in Hz (100000.0 to 0.0002)
gain
The channel gain
Parameters
flags
Channel configuration flags in the form of a bit mask
DerrFIFOFull
Buffer overrun
DerrInvGain
Invalid gain
DerrIncChan
Invalid channel
DerrInvTrigSource
Invalid trigger
Returns
DerrInvLevel
Invalid level (see the API Error Codes table at the end of this chapter).
See Also
daqAdcSetFreq, daqAdcSetMux, daqAdcSetClock, daqAdcSetTrig
Program References
None
Used With
All devices
Description
daqAdcRdN
is used to take multiple scans from a single A/D channel. This function will: (a) Configure the pacer clock, (b) Configure all
channels with the specified gain parameter, (c) Configure all channel options with the channel flags specified, (d) Arm the trigger, and
(e) Acquire count scans from the specified A/D channel. See ADC Flags Definition table (in ADC Miscellaneous Definitions) for channel
flags
parameter definition.