User Manual
ADC-20/ADC-24 User's Guide 20
Copyright © 2005-2010 Pico Technology Ltd. All rights reserved. adc20.en
5.4.5
HRDLGetSingleValue
short HRDLGetSingleValue (
short handle,
short channel,
short range,
short conversionTime,
short singleEnded,
short * overflow
long * value )
This function takes one sample for the specified channel at the selected voltage range
and conversion time.
Arguments
handle
Handle returned by HRDLOpenUnit.
channel
The channel number to convert.
ADC-20: 1 to 8
ADC-24: 1 to 16
If the channel is not valid then the function will fail and return 0.
range
The voltage range to be used. See HRDLSetAnalogInChannel for
possible values. If the range is not valid, the function will return
0.
conversionTime
The time interval in which the sample should be converted. See
HRDLSetInterval for possible values. If the conversion time is
invalid, the function will fail and return 0.
singleEnded
The type of voltage to be measured.
0: differential
nonzero: single-ended
overflow
Pointer to a bit field that indicates when the voltage on a channel
has exceeded the upper or lower limits.
Bit 0: Channel 1
...
Bit 15: Channel 16
value
Pointer to a long where the ADC value will be written.
Returns
1 if a valid handle is passed and settings are correct
0 if not
If the function fails, call HRDLGetUnitInfo with info = HRDL_ERROR (7) to obtain the
error code. If the error code is HRDL_SETTINGS (5), then call HRDLGetUnitInfo again
with info = HRDL_SETTINGS_ERROR (8) to determine the settings error.