BL4S200 User’s Manual
126
anaOutCalib
int anaOutCalib(int channel, int calib_index, int value1,
float volts1, int value2, float volts2);
FUNCTION DESCRIPTION
Calibrates the response of a given D/A converter channel as a linear function with using
two conversion points provided by the user. Gain and offset constants are calculated
and written to the user block in flash memory for use by the D/A converter function
calls.
NOTE:
The 10 and 90% points of the maximum voltage range are recommended when calibrating
a channel.
PARAMETERS
channel
the D/A converter output channel (0–1) corresponding to
AOUT0–AOUT1
calib_index
index used to go to the proper location in the lookup table for
writing the calibration data
0 = 0–10 V calibration data
1 = ±10 V calibration data
2 = 4–20 mA calibration data (unipolar configuration)
value1
the first D/A converter value (0–4095)
volts1
the voltage or current corresponding to the first D/A converter value
(0–10 V, ±10 V or 4– 20 mA)
value2
the second D/A converter value (0–4095)
volts2
the voltage or current corresponding to the second D/A converter value
(0–10 V, ±10 V or 4– 20 mA)
RETURN VALUE
0 — success.
-EINVAL
— invalid parameter.
-ERR_ANA_CALIB
— error writing calibration constants.
SEE ALSO
brdInit, anaOut, anaOutVolts, anaOutmAmps, anaOutStrobe, anaOutConfig
electronic components distributor