beautypg.com

3 s826_adcslotlistwrite, 4 s826_adcslotlistread, S826_adcslotlistwrite – Sensoray 826 User Manual

Page 22: S826_adcslotlistread

background image

chan

Buffer that will receive the analog input channel number.

tsettle

Buffer that will receive the analog settling time in microseconds.

range

Buffer that will receive the analog input voltage range code, as specified in S826_AdcSlotConfigWrite.

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 returns the settings established by a board reset or previous call to S826_AdcSlotConfigWrite.

5.3.3 S826_AdcSlotlistWrite

The S826_AdcSlotlistWrite function programs the conversion slot list.

int S826_AdcSlotlistWrite(
uint board, // board identifier
uint slotlist, // conversion slot list
uint mode // write mode
);

Parameters

board

826 board number. This must match the settings of the board's dip switches as described in section 2.2.

slotlist

List of slots to be digitized during subsequent conversion bursts, one bit per slot. Bits 0 to 15 correspond to slots 0 to
15, respectively. Each bit that is set to logic '1' will cause the corresponding slot to be digitized, while '0' will cause
the slot to be skipped.

mode

Write mode for slotlist: 0 = write, 1 = clear bits, 2 = set bits (see “Atomic Read-Modify-Write”).

Return Values

If the function succeeds, the return value is zero.

If the function fails, the return value is an error code.

Remarks

The settings established by this function will be used the next time a slot is digitized and remain in effect until changed
by another call to this function or a board reset.

In mode zero, this function will unconditionally write a new slotlist. In modes one and two, the function will selectively
set or clear any arbitrary combination of slots; slotlist bits that contain logic '1' indicate slots that are to be modified,
while all other slots will remain unchanged. Modes one and two can be used to guarantee thread-safe operation as they
atomically enable or disable the specified slots without affecting any other slots.

5.3.4 S826_AdcSlotlistRead

The S826_AdcSlotlistRead function returns the conversion slot list.

826 Instruction Manual

17

Analog Inputs