National Instruments 321645c-01 用户手册
Chapter 2
Function Reference — AI_Setup
©
National Instruments Corporation
2-15
NI-DAQ FRM for PC Compatibles
AI_Setup
Format
status = AI_Setup (deviceNumber, chan, gain)
Purpose
Selects an analog input channel and gain setting for externally pulsed conversion operations.
Parameters
Input
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 you want. To
select the SCXI channel, use
analog input channel on the DAQ device that corresponds to the SCXI channel you 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.
Manual for PC Compatibles for more information on SCXI channel assignments.
Range:
gain is the gain setting to be used for the specified channel. gain applies only to the DAQ
device; if you are using SCXI, establish any gain you want on the SCXI module by setting
jumpers on the module (if any) or by calling
device; if you are using SCXI, establish any gain you want on the SCXI module by setting
jumpers on the module (if any) or by calling
SCXI_Set_Gain
. Refer to Appendix B,
, for valid gain settings. If you use an
invalid gain, NI-DAQ returns an error. If you call
AI_Setup
for the 516 and LPM devices or
DAQCard-500/700, NI-DAQ ignores the gain.
Note
NI-DAQ does not distinguish between the low-gain and high-gain versions of the
AT-MIO-16. If you enter a gain of 10 and you have a device with gains of 1, 2, 4,
and 8, NI-DAQ uses a gain of 2 and returns no error.
AT-MIO-16. If you enter a gain of 10 and you have a device with gains of 1, 2, 4,
and 8, NI-DAQ uses a gain of 2 and returns no error.
Name
Type
Description
deviceNumber
i16
assigned by configuration utility
chan
i16
analog input channel number
gain
i16
gain setting to be used