I8026W_Readai - ICP DAS USA I-8026W Manual

Multifunction i/o module
Table of Contents

Advertisement

3.12. i8026W_ReadAI

This function is used to read the calibrated input value from a single specified Analog Input channel
in floating point format.
Prototype
short float i8026W_ReadAI(int slot, int ch, short gain, float* fVal);
Parameters
slot: specifies the slot number (1 ~ 8)
ch: specifies the Analog Input channel number (0 ~ 5)
gain: specifies the input type (0 - 4), where:
0: +/-10 V, 1: +/-5 V, 2: +/-2.5 V, 3: +/-1.25 V, 4: +/-20 mA
fVal: [Output] the input data in float format
Return Values
0 = No Error
For other return values, see the Error Codes in Appendix A.
Example
[C]
int slot,ch,gain;
float fVal=0.0;
slot = 1;
gain = 0;
// "+/-10 V"
Open_Slot(slot);
for(ch=0;ch<6;ch++)
{
i8026W_ReadAI( slot, ch, gain, &fVal);
printf("\n[%02d]= [ %05.4f ]",ch, fVal);
}
I-8026W API User Manual, v1.0.1, June 2015
Copyright © 2015 ICP DAS Co., Ltd. All Rights Reserved.
E-mail: service@icpdas.com
3-27

Advertisement

Table of Contents
loading

Table of Contents