pyhoff.AnalogOutputTerminal#

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

Bases: BusTerminal

Base class for analog output terminals.

Instantiate a new BusTerminal base class.

Parameters:
  • bus_coupler (BusCoupler) – The bus coupler to which this terminal is connected.

  • output_bit_addresses (list[int]) – List of addresses of the output bits.

  • input_bit_addresses (list[int]) – List of addresses of input bits.

  • output_word_addresses (list[int]) – List of addresses of output words.

  • input_word_addresses (list[int]) – List of addresses of input words.

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.

classmethod select(bus_coupler, terminal_number=0)#

Returns the n-th bus terminal instance of the parent class specified by terminal_number.

Parameters:
  • bus_coupler (BusCoupler) – The bus coupler to which the terminal is connected.

  • terminal_number (int) – The index of the bus terminal to return. Counted for all bus terminals of the same type, not all bus terminals. Started for the first terminal with 0

Return type:

TypeVar(_BT, bound= BusTerminal)

Returns:

The selected bus terminal instance.

set_normalized(channel, value)#

Set a normalized value between 0 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.

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.