pyhoff.devices.KL3042#

class pyhoff.devices.KL3042(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)#

Bases: AnalogInputTerminal

KL3042: 2x analog input 0…20 mA 12 Bit single-ended

read_channel_word(channel, error_value=-99999)#

Read a single word from the terminal.

Parameters:
  • channel (int) – The channel number (1 based index) to read from.

  • error_value (int) – Value that is returned in case the modbus read command fails.

Return type:

int

Returns:

The read word value or provided error_value if read failed.

Raises:

Exception – If the word offset or count is out of range.

read_current(channel)#

Read the current value from a specific channel.

Parameters:

channel (int) – The channel number to read from.

Return type:

float

Returns:

The current value in mA.

read_normalized(channel)#

Read a normalized value (0…1) from a specific channel.

Parameters:

channel (int) – The channel number to read from.

Return type:

float

Returns:

The normalized value.