User`s manual
BL4S100 User’s Manual 90
anaInRdCalib
anaInRdCalib(int channel, int opmode, int gaincode,
calib_t *pcal_data)
FUNCTION DESCRIPTION
Reads the calibration constants, gain and offset, from the user block on the flask.
PARAMETER
channel analog input channel number (0 to 7) corresponding to AIN0–AIN7
opmode select the mode of operation for the A/D converter channel calibra-
tion data being read. Use one of the following macros.
SE0_mode = single-ended unipolar (0–20 V)
DIFF_MODE = differential bipolar (±20 V)
mAMP_mode = 4–20 mA
gaincode the gain code of 0 to 7 (use the gain code macro mAMP_GAINCODE
for 4–20 mA operation)
pcal_data calibration structure pointer to gain and offset values
channel
Single-Ended Differential 4–20 mA
0 +AIN0 +AIN0 -AIN1 +AIN0
1 +AIN1 — +AIN1
2 +AIN2 +AIN2 -AIN3 +AIN2
3 +AIN3 — +AIN3
4 +AIN4 +AIN4 -AIN5
5+AIN5 —
6 +AIN6 +AIN6 -AIN7
7+AIN7 —
Gain Code Macro
Voltage Range
Single-Ended
Unipolar
Differential
Bipolar
0 GAIN_X1 0–20 V ±20 V
1 GAIN_X2 0–10 V ±10 V
2 GAIN_X4 0–5 V ±5 V
3 GAIN_X5 0–4 V ±4 V
4 GAIN_X8 0–2.5 V ±2.5 V
5 GAIN_X10 0–2 V ±2 V
6 GAIN_X16 0–1.25 V ±1.25 V
7 GAIN_X20 0–1 V ±1 V