Sensoray 826 User Manual
Page 26

Parameters
board
826 board number. This must match the settings of the board's dip switches as described in section 2.2.
buf
Pointer to a buffer that will receive ADC results for the sixteen possible slots. The buffer must be large enough to
accommodate sixteen values regardless of the number of active slots. Each slot is represented by a 32-bit value,
which is stored at buf[SlotNumber]:
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10
9
8
7
6
5
4
3
2
1
0
BSTNUM
V
0000000
ADCVAL
Field
Description
BSTNUM
Burst number. This indicates the ADC burst number corresponding to the ADC data. It
can be used to time-correlate the ADC data if V = '1'. The burst number is incremented
at the end of each burst; it restarts at zero at the end of burst number 255.
V
Data Overwritten flag. When set to '1' this indicates the previous ADC result was
overwritten by a new result before it was read.
ADCVAL
ADC data, expressed as 16-bit signed integer:
Analog Voltage
ADCVAL
-10V to +10V
0x8000 to 0x7FFF
-5V to +5V
0x8000 to 0x7FFF
-2V to +2V
0x8000 to 0x7FFF
-1V to +1V
0x8000 to 0x7FFF
tstamp
Pointer to a buffer that will receive the timestamps corresponding to ADC results. The buffer must be large enough to
accommodate sixteen values regardless of the number of active slots. Each timestamp indicates the moment in time
that its corresponding ADCVAL was acquired. For any given slot, the slot's timestamp will be stored in
tstamp[SlotNumber]. The application may set this to NULL if timestamps are not needed.
slotlist
Pointer to a buffer containing bit flags, one bit per slot, that indicate slots of interest. Bits 0-15 correspond to slots 0-
15. Before calling the function, set to '1' all bits that correspond to slots of interest. When the function returns, the
buffer contents will have been changed so that '1' indicates a slot has new data in buf and '0' indicates no new data.
tmax
Maximum time, in microseconds, to wait for ADC data. See “Event-Driven Applications” for details.
Return Values
If the function succeeds, the return value is zero.
If the function fails, the return value is an error code.
Remarks
This function reads the result registers of an arbitrary set of slots and copies the results to buf. As many as sixteen
results (one per slot) may be copied to buf each time the function is called. Over-range and under-range conditions are
indicated by maximum or minimum data values for the selected input range, respectively; there are no special status
flags that indicate these conditions.
Before calling the function, one or more slotlist bits must be set to indicate the slots of interest. Only new, unread
results are copied to buf. If a slot is not of interest or has not been converted since it was last read, its buf value will not
change. In all cases (even when the function returns an error), when the function returns, slotlist will indicate the slots
of interest that have new buf values.
826 Instruction Manual
21
Analog Inputs