pyhoff.devices.KL4132#

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

Bases: AnalogOutputTerminal

KL4002: 2x analog output ±10 V 16 bit differential

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.

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.

set_normalized(channel, value)#

Set a normalized value between -1 and +1 to a specific channel.

Parameters:
  • channel (int) – The channel number to set.

  • value (float) – The normalized value to set.

Return type:

bool

Returns:

True if the write operation succeeded.

set_voltage(channel, value)#

Set a voltage value between -10 and +10 V to a specific channel.

Parameters:
  • channel (int) – The channel number to set.

  • value (float) – The voltage value to set in V.

Return type:

bool

Returns:

True if the write operation succeeded.

write_channel_word(channel, value)#

Write a word to the terminal.

Parameters:

channel (int) – The channel number (1 based index) to write to.

Return type:

bool

Returns:

True if the write operation succeeded.

Raises:

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