cbAIn()

Reads an A/D input channel from the specified board, and returns a 16-bit unsigned integer value. If the specified A/D board has programmable gain then it sets the gain to the specified range. The raw A/D value is converted to an A/D value and returned to DataValue.

Function Prototype

C/C++

int cbAIn(int BoardNum, int Channel, int Range, unsigned short *DataValue);

Visual Basic

Function cbAIn(ByVal BoardNum&, ByVal Channel&, ByVal Range&, DataValue%) As Long

Arguments

BoardNum

The number associated with the board when it was installed with InstaCal or created with cbCreateDaqDevice(). BoardNum may be 0 to 99.

Channel

A/D channel number. The maximum allowable channel depends on which type of A/D board is being used. For boards with both single ended and differential inputs, the maximum allowable channel number also depends on how the board is configured. For example, a USB-1608GX device has 8 differential or 16 single-ended analog input channels. Expansion boards also support this function, so this argument can contain values up to 272. See board specific information for EXP boards if you are using an expansion board.

Range

A/D Range code. If the selected A/D board does not have a programmable gain feature, this argument is ignored. If the A/D board does have programmable gain, set the Range argument to the desired A/D range. Refer to board specific information for a list of the supported A/D ranges of each board.

DataValue

Pointer or reference to the data value.

Returns