# pyhoff.devices.KL5121 — pyhoff documentation

Skip to main content
`Ctrl`+`K`

# pyhoff.devices.KL5121

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

  Bases: `AnalogOutputTerminal`

  KL5121: 1-channel encoder interface, incremental, 24 V DC HTL, 250 kHz, with 4 x digital output 24 V DC, linear path control (Automatic generated stub)

  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 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.