Chapter 2 Function Reference — AI_Read
NI-DAQ FRM for PC Compatibles 2-12
©
National Instruments Corporation
AI_Read
Format
status = AI_Read (deviceNumber, chan, gain, reading)
Purpose
Reads an analog input channel (initiates an A/D conversion on an analog input channel) and
returns the unscaled result.
Parameters
Input
Output
Parameter Discussion
chan is the analog input channel number. If you are using SCXI, you must use the appropriate
analog input channel on the DAQ device that corresponds to the SCXI channel yo u want. To
select the SCXI channel, use SCXI_Single_Chan_Setup before calling this function. Refer
to Chapter 12, SCXI Hardware, in the DAQ Hardware Overview Guide and the NI-DAQ User
Manual for PC Compatibles for more information on SCXI channel assignments.
Range: See Table B-1 in AppendixB, Analog Input Channel, Gain Settings, and
Voltage Calculation.
gain is the gain setting you use for the specified channel. This gain setting applies only to the
DAQ device; if you are using SCXI, establish any gain you want on the SCXI module either
by setting jumpers on the module or by calling SCXI_Set_Gain. Refer to AppendixB ,
Analog Input Channel, Gain Settings, and VoltageCalculation, for valid gain settings. If you
use an invalid gain, NI-DAQ returns an error . If you call AI_Read for the DAQCard-500/700
or 516 and LPM devices, NI-DAQ ignores the gain.
Name Type Description
deviceNumber i16 assigned by configuration utility
chan i16 analog input channel number
gain i16 gain setting for the channel
Name Type Description
reading i16 the integer result of the A/D conversion