National Instruments 321645c-01 Welding System User Manual


 
Chapter 2 Function Reference AI_VScale
NI-DAQ FRM for PC Compatibles 2-20
©
National Instruments Corporation
AI_VScale
Format
status = AI_VScale (deviceNumber, chan, gain, gainAdjust, offset, reading, voltage)
Purpose
Converts the binary result from an AI_Read call to the actual input voltage.
Parameters
Input
Output
Parameter Discussion
chan is the onboard channel or AMUX channel on which NI-DAQ took the binary reading
using
AI_Read. For devices other than the AT-MIO-16X, AT-MIO-64F-5, and E Series
devices, this parameter is ignored because the scaling calculation is the same for all of the
channels. However, you are encouraged to pass the correct channel number.
gain is the gain setting that you used to take the analog input reading. If you used SCXI to
take the reading, this gain parameter should be the product of the gain on the SCXI module
channel and the gain that the DAQ device used. Refer to Appendix B, Analog Input Channel,
Gain Settings, and Voltage Calculation, for valid gain settings. Use of invalid gain settings
causes NI-DAQ to return an error unless you are using SCXI. If you call
AI_VScale for the
516 and LPM devices or DAQCard-500/700, NI-DAQ ignores the gain unless you are using
SCXI.
Name Type Description
deviceNumber i16 assigned by configuration utility
chan i16 channel on which binary reading was taken
gain i16 gain setting used to take the reading
gainAdjust f64 multiplying factor to adjust gain
offset f64 binary offset present in reading
reading i16 result of the A/D conversion
Name Type Description
voltage f64 computed floating-point voltage