ENP-AI4
ai4
library implements analog inputs interface for the ENP-AI4 module.
ENP-AI4 has 4 analog input channels with IDs from 1
to 4
. Channels are pre-configured on the Enapter factory for either voltage, or current, or temperature (PT1000) readings.
There are two modifications:
- ENP-AI4-50V with all 4 channels for voltage reading (-50…+50 V).
- ENP-AI4-20MA with all 4 channels for current reading (4…20 mA).
ai4.read_volts
#
Returns voltage on the given input as the first return value. Could be in -50…+50 V range. Error code is returned as a second return value (use ai4.err_to_str
to convert it to string representation).
#
Exampleai4.read_milliamps
#
Returns current on the given input as the first return value. Could be in 4-20 mA range. Error code is returned as a second return value (use ai4.err_to_str
to convert it to string representation).
#
Exampleai4.err_to_str
#
Returns string representation of ai4
function return code.