BL4S200 User’s Manual
118
anaInDiff
float anaInDiff(int channel, int gaincode);
FUNCTION DESCRIPTION
Reads the state of a differential A/D converter input channel and uses the previously set
calibration constants to convert it to volts. Voltage ranges given in the table below are
the nominal ranges that will be returned. However, values outside these ranges can of-
ten be seen before the return of a
BL_OVERFLOW
error.
If the gain code for a given channel has changed from the previous cycle, the user block
will be read to get the calibration constants for the new gain value.
PARAMETERS
channel
the analog input channel number (0, 2, 4, 6) as shown below
gaincode
the gain code of 0 to 7
channel
Differential Inputs
0
+AIN0 -AIN1
2
+AIN2 -AIN3
4
+AIN4 -AIN5
6
+AIN6 -AIN7
Gain Code
Macro
Actual Gain
Differential
Voltage Range
Actual Voltage
Range
0
GAIN_X1
×1
± 20 V
± 10 V
1
GAIN_X2
×2
± 10 V
± 5 V
2
GAIN_X4
×4
± 5 V
± 2.5 V
3
GAIN_X5
×5
± 4 V
± 2 V
4
GAIN_X8
×8
± 2.5 V
± 1.25 V
5
GAIN_X10
×10
± 2 V
± 1 V
6
GAIN_X16
×16
± 1.25 V
± 0.625 V
7
GAIN_X20
×20
± 1 V
± 0,5 V