User`s manual
BL4S100 User’s Manual 89
anaInmAmps
float anaInmAmps(int channel);
FUNCTION DESCRIPTION
Reads the state of a single-ended A/D converter input channel and uses the previously
set calibration constants to convert it to a floating-point current value in milli amps. The
nominal range is 0 mA to 20 mA, although it is possible to receive values outside this
range before a
BL_OVERFLOW error is returned.
PARAMETER
channel A/D converter input channel (0–3 corresponding to AIN0–AIN3)
RETURN VALUE
A current value corresponding to the current on the analog input channel, or a value of
BL_ERRCODESTART or less to indicate an error condition:
A/D converter operation errors (will not create run-time error):
BL_NOT_CAL — A/D converter is not calibrated for this channel/gain.
BL_OVERFLOW — A/D converter overflow.
BL_TIMEOUT — A/D converter timeou.t
BL_WRONG_MODE — A/D converter is in wrong mode (run anaInConfig()).
System errors (can create run-time error unless disabled):
-ERR_ANA_CALIB — fault detected in reading calibration factor.
-ERR_ANA_INVAL — invalid parameter value.
SEE ALSO
brdInit, anaInConfig, anaIn, anaInDiff, anaInVolts, anaInCalib