Classes and Modules
Bus coupler
These classes are bus couplers and are used to connect the IO bus terminals to a Ethernet interface.
- class pyhoff.devices.BK9000(host, port=502, bus_terminals=[], timeout=5, watchdog=0, debug=False)
Bases:
BusCoupler
BK9000 ModBus TCP bus coupler
- add_bus_terminals(*new_bus_terminals)
Add bus terminals to the bus coupler.
- Parameters:
new_bus_terminals (
Union
[type
[BusTerminal
],Iterable
[type
[BusTerminal
]]]) – bus terminal classes to add.- Return type:
list
[BusTerminal
]- Returns:
The corresponding list of bus terminal objects.
- get_error()
Get the last error message.
- Return type:
str
- Returns:
The last error message.
- select(bus_terminal_type, terminal_number=0)
Returns the n-th bus terminal instance of the given bus terminal type and terminal index.
- Parameters:
bus_terminals_type – The bus terminal class to select from.
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.
Example
>>> from pyhoff.devices import * >>> bk = BK9050("172.16.17.1", bus_terminals=[KL2404, KL2424]) >>> # Select the first KL2425 terminal: >>> kl2404 = bk.select(KL2424, 0)
- class pyhoff.devices.BK9050(host, port=502, bus_terminals=[], timeout=5, watchdog=0, debug=False)
Bases:
BK9000
BK9050 ModBus TCP bus coupler
- add_bus_terminals(*new_bus_terminals)
Add bus terminals to the bus coupler.
- Parameters:
new_bus_terminals (
Union
[type
[BusTerminal
],Iterable
[type
[BusTerminal
]]]) – bus terminal classes to add.- Return type:
list
[BusTerminal
]- Returns:
The corresponding list of bus terminal objects.
- get_error()
Get the last error message.
- Return type:
str
- Returns:
The last error message.
- select(bus_terminal_type, terminal_number=0)
Returns the n-th bus terminal instance of the given bus terminal type and terminal index.
- Parameters:
bus_terminals_type – The bus terminal class to select from.
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.
Example
>>> from pyhoff.devices import * >>> bk = BK9050("172.16.17.1", bus_terminals=[KL2404, KL2424]) >>> # Select the first KL2425 terminal: >>> kl2404 = bk.select(KL2424, 0)
- class pyhoff.devices.BK9100(host, port=502, bus_terminals=[], timeout=5, watchdog=0, debug=False)
Bases:
BK9000
BK9100 ModBus TCP bus coupler
- add_bus_terminals(*new_bus_terminals)
Add bus terminals to the bus coupler.
- Parameters:
new_bus_terminals (
Union
[type
[BusTerminal
],Iterable
[type
[BusTerminal
]]]) – bus terminal classes to add.- Return type:
list
[BusTerminal
]- Returns:
The corresponding list of bus terminal objects.
- get_error()
Get the last error message.
- Return type:
str
- Returns:
The last error message.
- select(bus_terminal_type, terminal_number=0)
Returns the n-th bus terminal instance of the given bus terminal type and terminal index.
- Parameters:
bus_terminals_type – The bus terminal class to select from.
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.
Example
>>> from pyhoff.devices import * >>> bk = BK9050("172.16.17.1", bus_terminals=[KL2404, KL2424]) >>> # Select the first KL2425 terminal: >>> kl2404 = bk.select(KL2424, 0)
- class pyhoff.devices.WAGO_750_352(host, port=502, bus_terminals=[], timeout=5, watchdog=0, debug=False)
Bases:
BusCoupler
Wago 750-352 ModBus TCP bus coupler
- add_bus_terminals(*new_bus_terminals)
Add bus terminals to the bus coupler.
- Parameters:
new_bus_terminals (
Union
[type
[BusTerminal
],Iterable
[type
[BusTerminal
]]]) – bus terminal classes to add.- Return type:
list
[BusTerminal
]- Returns:
The corresponding list of bus terminal objects.
- get_error()
Get the last error message.
- Return type:
str
- Returns:
The last error message.
- select(bus_terminal_type, terminal_number=0)
Returns the n-th bus terminal instance of the given bus terminal type and terminal index.
- Parameters:
bus_terminals_type – The bus terminal class to select from.
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.
Example
>>> from pyhoff.devices import * >>> bk = BK9050("172.16.17.1", bus_terminals=[KL2404, KL2424]) >>> # Select the first KL2425 terminal: >>> kl2404 = bk.select(KL2424, 0)
Beckhoff bus terminals
- class pyhoff.devices.KL1002(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1002: 2-channel digital input, 24 V DC, 3 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1012(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1012: 2-channel digital input, 24 V DC, 0.2 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1032(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1032: 2-channel digital input, 48 V DC, 3 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1052(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1052: 2-channel digital input, 24 V DC, 3 ms, positive/ground switching (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1104(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal4Bit
KL1104: 4x digital input 24 V
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1114(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1114: 4-channel digital input, 24 V DC, 0.2 ms, 2-/3-wire connection (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1124(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1124: 4-channel digital input, 5 V DC, 0.2 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1154(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1154: 4-channel digital input, 24 V DC, 3 ms, positive/ground switching (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1164(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1164: 4-channel digital input, 24 V DC, 0.2 ms, positive/ground switching (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1184(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1184: 4-channel digital input, 24 V DC, 3 ms, ground switching (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1194(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1194: 4-channel digital input, 24 V DC, 0.2 ms, ground switching (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1212(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL1212: 2-channel digital input, 24 V DC, 3 ms, with diagnostics (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1232(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1232: 2-channel digital input, 24 V DC, 0.2 ms, pulse extension (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1302(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1302: 2-channel digital input, 24 V DC, 3 ms, type 2 (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1304(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1304: 4-channel digital input, 24 V DC, 3 ms, type 2 (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1312(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1312: 2-channel digital input, 24 V DC, 0.2 ms, type 2 (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1314(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1314: 4-channel digital input, 24 V DC, 0.2 ms, type 2 (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1352(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1352: 2-channel digital input, NAMUR (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1362(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1362: 2-channel digital input, break-in alarm, 24 V DC, 3 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1382(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1382: 2-channel digital input, thermistor, 24 V DC, 30 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1402(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1402: 2-channel digital input, 24 V DC, 3 ms, 2-wire connection (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1404(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1404: 4-channel digital input, 24 V DC, 3 ms, 2-wire connection (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1408(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal8Bit
KL1104: 8x digital input 24 V galvanic isolated
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1412(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1412: 2-channel digital input, 24 V DC, 0.2 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1414(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1414: 4-channel digital input, 24 V DC, 0.2 ms, 2-wire connection (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1418(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1418: 8-channel digital input, 24 V DC, 0.2 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1434(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1434: 4-channel digital input, 24 V DC, 0.2 ms, type 2, 2-wire connection (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1488(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1488: 8-channel digital input, 24 V DC, 3 ms, ground switching (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1498(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1498: 8-channel digital input, 24 V DC, 0.2 ms, ground switching (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1501(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1501: 1-channel digital input, counter, 24 V DC, 100 kHz (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1512(bus_coupler, o_b_addr, i_b_addr, o_w_addr, i_w_addr, mixed_mapping)
Bases:
AnalogInputTerminal
KL1512: 2x 16 bit counter, 24 V DC, 1 kHz
- 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.
- Raises:
Exception – If the word offset or count is out of range.
- read_counter(channel)
Read the absolut counter value of a specific channel.
- Parameters:
channel (
int
) – The channel number to read from.- Return type:
int
- Returns:
The counter value.
- read_delta(channel)
Read the counter change since last read of a specific channel.
- Parameters:
channel (
int
) – The channel number to read from.- Return type:
int
- Returns:
The counter value.
- 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.
- class pyhoff.devices.KL1702(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1702: 2-channel digital input, 120…230 V AC, 10 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1704(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1704: 4-channel digital input, 120…230 V AC, 10 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1712(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1712: 2-channel digital input, 120 V AC/DC, 10 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1722(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1722: 2-channel digital input, 120…230 V AC, 10 ms, without power contacts (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1804(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1804: 4-channel digital input, 24 V DC, 3 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1808(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1808: 8-channel digital input, 24 V DC, 3 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1809(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1809: 16-channel digital input, 24 V DC, 3 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1814(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1814: 4-channel digital input, 24 V DC, 0.2 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1819(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1819: 16-channel digital input, 24 V DC, 0.2 ms (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1859(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL1859: 8-channel digital input + 8-channel digital output, 24 V DC, 3 ms, 0.5 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1862(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1862: 16-channel digital input, 24 V DC, 3 ms, flat-ribbon cable (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1872(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1872: 16-channel digital input, 24 V DC, 0.2 ms, flat-ribbon cable (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL1889(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL1889: 16-channel digital input, 24 V DC, 3 ms, ground switching (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2012(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2012: 2-channel digital output, 24 V DC, 0.5 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2022(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2022: 2-channel digital output, 24 V DC, 2 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2032(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2032: 2-channel digital output, 24 V DC, 0.5 A, reverse voltage protection (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2114(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2114: 4-channel digital output, 24 V DC, 0.5 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2124(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2124: 4-channel digital output, 5 V DC, 20 mA (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2134(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2134: 4-channel digital output, 24 V DC, 0.5 A, reverse voltage protection (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2184(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2184: 4-channel digital output, 24 V DC, 0.5 A, ground switching (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2212(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2212: 2-channel digital output, 24 V DC, 0.5 A, with diagnostics (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2284(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2284: 4-channel digital output, reverse switching, 24 V DC, 2 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2404(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal4Bit
KL2404: 4x digital output with 500 mA
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2408(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal8Bit
750-530: 8x digital output with 24 V / 500 mA
Contact order for DO1 to DO8 is: 1, 5, 2, 6, 3, 7, 4, 8.
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2424(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal4Bit
KL2424: 4x digital output with 2000 mA
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2442(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2442: 2-channel digital output, 24 V DC, 2 x 4 A/1 x 8 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2488(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2488: 8-channel digital output, 24 V DC, 0.5 A, ground switching (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2502(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL2502: 2-channel PWM output, 24 V DC, 0.1 A (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2512(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL2512: 2-channel PWM output, 24 V DC, 1.5 A, ground switching (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2532(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL2532: 2-channel motion interface, DC motor, 24 V DC, 1 A (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2535(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL2535: 2-channel PWM output, 24 V DC, 1 A, current-controlled (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2541(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL2541: 1-channel motion interface, stepper motor, 48 V DC, 5 A, with incremental encoder (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.
- class pyhoff.devices.KL2542(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL2542: 2-channel motion interface, DC motor, 48 V DC, 3.5 A (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2545(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL2545: 2-channel PWM output, 8…50 V DC, 3.5 A, current-controlled (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2552(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
KL2552: 2-channel motion interface, DC motor, 48 V DC, 5 A (Automatic generated stub)
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2602(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2602: 2-channel relay output, 230 V AC, 30 V DC, 5 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2612(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2612: 2-channel relay output, 125 V AC, 30 V DC, 0.5 A AC, 2 A DC (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2622(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2622: 2-channel relay output, 230 V AC, 30 V DC, 5 A, without power contacts (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2631(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2631: 1-channel relay output, 400 V AC, 300 V DC, 2 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2634(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal4Bit
KL2634: 4x digital output 250 V AC, 30 V DC, 4 A
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2641(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2641: 1-channel relay output, 230 V AC, 16 A, manual operation (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2652(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2652: 2-channel relay output, 230 V AC, 300 V DC, 5 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2701(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2701: 1-channel solid-state relay output, 0…230 V AC/DC, 3 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2712(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2712: 2-channel triac output, 12…230 V AC, 0.5 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2722(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2722: 2-channel triac output, 12…230 V AC, 1 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2732(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2732: 2-channel triac output, 12…230 V AC, 1 A, without power contacts (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2751(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL2751: 1-channel universal dimmer, 230 V AC, 300 VA (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.
- class pyhoff.devices.KL2761(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL2761: 1-channel universal dimmer, 230 V AC, 600 VA (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.
- class pyhoff.devices.KL2784(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2784: 4-channel solid state relay output, 30 V AC, 48 V DC, 2 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2791(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL2791: 1-channel motion interface, AC motor, 230 V AC, 0.9 A (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.
- class pyhoff.devices.KL2794(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2794: 4-channel solid state relay output, 30 V AC, 48 V DC, 2 A, potential-free (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2798(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2798: 8-channel solid state relay output, 30 V AC, 48 V DC, 2 A, potential-free (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2808(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2808: 8-channel digital output, 24 V DC, 0.5 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2809(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2809: 16-channel digital output, 24 V DC, 0.5 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2828(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2828: 8-channel digital output, 24 V DC, 2 A (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2872(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2872: 16-channel digital output, 24 V DC, 0.5 A, flat-ribbon cable (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL2889(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
KL2889: 16-channel digital output, 24 V DC, 0.5 A, ground switching (Automatic generated stub)
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.KL3001(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3001: 1-channel analog input, voltage, ±10 V, 12 bit, differential (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3002(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3002: 2-channel analog input, voltage, ±10 V, 12 bit, differential (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3011(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3011: 1-channel analog input, current, 0…20 mA, 12 bit, differential (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3012(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3012: 2-channel analog input, current, 0…20 mA, 12 bit, differential (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3021(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3021: 1-channel analog input, current, 4…20 mA, 12 bit, differential (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3022(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3022: 2-channel analog input, current, 4…20 mA, 12 bit, differential (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3041(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3041: 1-channel analog input, current, 0…20 mA, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- 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.- Return type:
int
- Returns:
The read word value.
- 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.
- class pyhoff.devices.KL3044(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3044: 4-channel analog input, current, 0…20 mA, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3051(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3051: 1-channel analog input, current, 4…20 mA, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3052(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3052: 2-channel analog input, current, 4…20 mA, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3054(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3054: 4x analog input 4…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.- Return type:
int
- Returns:
The read word value.
- 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.
- class pyhoff.devices.KL3061(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3061: 1-channel analog input, voltage, 0…10 V, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3062(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3062: 2-channel analog input, voltage, 0…10 V, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3064(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3064: 4-channel analog input, voltage, 0…10 V, 12 bit, single-ended, with shield connector (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3102(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3102: 2-channel analog input, voltage, ±10 V, 16 bit, differential (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3112(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3112: 2-channel analog input, current, 0…20 mA, 16 bit, differential (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3122(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3122: 2-channel analog input, current, 4…20 mA, 16 bit, differential (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3132(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3132: 2-channel analog input, voltage, ±10 V, 16 bit, differential, high-precision (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3142(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3142: 2-channel analog input, current, 0…20 mA, 16 bit, differential, high-precision (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3152(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3152: 2-channel analog input, current, 4…20 mA, 16 bit, differential, high-precision (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3162(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3162: 2-channel analog input, voltage, 0…10 V, 16 bit, differential, high-precision (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3172(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3172: 2-channel analog input, voltage, 0…2 V, 16 bit, differential, high-precision (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3182(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3182: 2-channel analog input, voltage, ±2 V, 16 bit, differential, high-precision (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3201(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3201: 1-channel analog input, temperature, RTD (Pt100), 16 bit (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3202(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3202: 2x analog input PT100 16 Bit 3-wire
- 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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- read_temperature(channel)
Read the temperature value from a specific channel.
- Parameters:
channel (
int
) – The channel number to read from.- Return type:
float
- Returns:
The temperature value in °C.
- class pyhoff.devices.KL3204(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3204: 4-channel analog input, temperature, RTD (Pt100), 16 bit (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3214(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3214: 4x analog input PT100 16 Bit 3-wire
- 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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- read_temperature(channel)
Read the temperature value from a specific channel.
- Parameters:
channel (
int
) – The channel number to read from.- Return type:
float
- Returns:
The temperature value.
- class pyhoff.devices.KL3222(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3222: 2-channel analog input, temperature, RTD (Pt100), 16 bit, high-precision (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3228(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3228: 8-channel analog input, temperature, RTD (Pt1000, Ni1000), 16 bit (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3311(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3311: 1-channel analog input, temperature, thermocouple, 16 bit (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3312(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3312: 2-channel analog input, temperature, thermocouple, 16 bit (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3314(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3314: 4-channel analog input, temperature, thermocouple, 16 bit (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3351(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3351: 1-channel analog input, measuring bridge, full bridge, 16 bit (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3356(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3356: 1-channel analog input, measuring bridge, full bridge, 16 bit, high-precision (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3361(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL3361: 1-channel analog input, voltage, ±20 mV, 15 bit, oscilloscope function (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.
- class pyhoff.devices.KL3362(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL3362: 2-channel analog input, voltage, ±10 V, 15 bit, oscilloscope function (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.
- class pyhoff.devices.KL3403(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL3403: 3-channel analog input, power measurement, 500 V AC, 1 A, 16 bit (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.
- class pyhoff.devices.KL3404(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3404: 4-channel analog input, voltage, ±10 V, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3408(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3408: 8-channel analog input, voltage, ±10 V, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3444(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3444: 4-channel analog input, current, 0…20 mA, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3448(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3448: 8-channel analog input, current, 0…20 mA, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3454(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3454: 4-channel analog input, current, 4…20 mA, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3458(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3458: 8-channel analog input, current, 4…20 mA, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3464(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3464: 4-channel analog input, voltage, 0…10 V, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL3468(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL3468: 8-channel analog input, voltage, 0…10 V, 12 bit, single-ended (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL4001(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4001: 1-channel analog output, voltage, 0…10 V, 12 bit, differential (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.
- class pyhoff.devices.KL4002(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4002: 2x analog output 0…10 V 12 Bit differentiell
- 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.
- set_voltage(channel, value)
Set a voltage value 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.
- class pyhoff.devices.KL4004(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4004: 4x analog output 0…10 V 12 Bit differentiell
- 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.
- set_voltage(channel, value)
Set a voltage value 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.
- class pyhoff.devices.KL4011(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4011: 1-channel analog output, current, 0…20 mA, 12 bit, single-ended (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.
- class pyhoff.devices.KL4012(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4012: 2-channel analog output, current, 0…20 mA, 12 bit, single-ended (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.
- class pyhoff.devices.KL4021(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4021: 1-channel analog output, current, 4…20 mA, 12 bit, single-ended (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.
- class pyhoff.devices.KL4022(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4022: 2-channel analog output, current, 4…20 mA, 12 bit, single-ended (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.
- class pyhoff.devices.KL4031(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4031: 1-channel analog output, voltage, ±10 V, 12 bit, differential (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.
- class pyhoff.devices.KL4032(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4032: 2-channel analog output, voltage, ±10 V, 12 bit, differential (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.
- class pyhoff.devices.KL4034(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4034: 4-channel analog output, voltage, ±10 V, 12 bit, differential (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.
- class pyhoff.devices.KL4112(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4112: 2-channel analog output, current, 0…20 mA, 16 bit, single-ended (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.
- 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.
- class pyhoff.devices.KL4404(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4404: 4-channel analog output, voltage, 0…10 V, 12 bit, single-ended (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.
- class pyhoff.devices.KL4408(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4408: 8-channel analog output, voltage, 0…10 V, 12 bit, single-ended (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.
- class pyhoff.devices.KL4414(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4414: 4-channel analog output, current, 0…20 mA, 12 bit, single-ended (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.
- class pyhoff.devices.KL4418(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4418: 8-channel analog output, current, 0…20 mA, 12 bit, single-ended (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.
- class pyhoff.devices.KL4424(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4424: 4-channel analog output, current, 4…20 mA, 12 bit, single-ended (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.
- class pyhoff.devices.KL4428(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4428: 8-channel analog output, current, 4…20 mA, 12 bit, single-ended (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.
- class pyhoff.devices.KL4434(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4434: 4-channel analog output, voltage, ±10 V, 12 bit, single-ended (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.
- class pyhoff.devices.KL4438(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4438: 8-channel analog output, voltage, ±10 V, 12 bit, single-ended (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.
- class pyhoff.devices.KL4494(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL4494: 2-channel analog input + 2-channel analog output, voltage, ±10 V, 12 bit, single-ended (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.
- class pyhoff.devices.KL5051(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL5051: 1-channel encoder interface, SSI, bidirectional (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.
- class pyhoff.devices.KL5101(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogInputTerminal
KL5101: 1-channel encoder interface, incremental, 5 V DC (DIFF RS422, TTL), 1 MHz (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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- class pyhoff.devices.KL5111(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
AnalogOutputTerminal
KL5111: 1-channel encoder interface, incremental, 24 V DC HTL, 250 kHz (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.
- 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.
WAGO bus terminals
- class pyhoff.devices.WAGO_750_1405(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal16Bit
750-1405: 16x digital input 24 V
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.WAGO_750_530(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal8Bit
750-530: 8x digital output with 24 V / 500 mA
Contact order for DO1 to DO8 is: 1, 5, 2, 6, 3, 7, 4, 8.
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.WAGO_750_600(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
BusTerminal
End terminal, no I/O function
- class pyhoff.devices.WAGO_750_602(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
BusTerminal
Potential supply terminal, no I/O function
Generic bus terminals
- class pyhoff.devices.DigitalInputTerminal16Bit(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
Generic 16 bit input terminal
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.DigitalInputTerminal4Bit(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
Generic 4 bit input terminal
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.DigitalInputTerminal8Bit(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalInputTerminal
Generic 8 bit input terminal
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.DigitalOutputTerminal16Bit(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
Generic 16 bit output terminal
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.DigitalOutputTerminal4Bit(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
Generic 4 bit output terminal
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
- class pyhoff.devices.DigitalOutputTerminal8Bit(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
DigitalOutputTerminal
Generic 8 bit output terminal
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number is out of range.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
Base classes
These classes are base classes for devices and are typically not used directly.
- class pyhoff.AnalogInputTerminal(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
BusTerminal
Base class for analog input terminals.
- 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.
- Raises:
Exception – If the word offset or count is out of range.
- 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.
- 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.
- 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.
- 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.
- class pyhoff.BusCoupler(host, port=502, bus_terminals=[], timeout=5, watchdog=0, debug=False)
Bases:
object
Base class for ModBus TCP bus coupler
- Parameters:
host (
str
) – ip or hostname of the bus couplerport (
int
) – port of the modbus hostdebug (
bool
) – outputs modbus debug informationtimeout (
float
) – timeout for waiting for the device responsewatchdog (
float
) – time in seconds after the device sets all outputs to default state. A value of 0 deactivates the watchdog.debug – If True, debug information is printed.
- bus_terminals
A list of bus terminal classes according to the connected terminals.
- modbus
The underlying modbus client used for the connection.
- add_bus_terminals(*new_bus_terminals)
Add bus terminals to the bus coupler.
- Parameters:
new_bus_terminals (
Union
[type
[BusTerminal
],Iterable
[type
[BusTerminal
]]]) – bus terminal classes to add.- Return type:
list
[BusTerminal
]- Returns:
The corresponding list of bus terminal objects.
- get_error()
Get the last error message.
- Return type:
str
- Returns:
The last error message.
- select(bus_terminal_type, terminal_number=0)
Returns the n-th bus terminal instance of the given bus terminal type and terminal index.
- Parameters:
bus_terminals_type – The bus terminal class to select from.
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.
Example
>>> from pyhoff.devices import * >>> bk = BK9050("172.16.17.1", bus_terminals=[KL2404, KL2424]) >>> # Select the first KL2425 terminal: >>> kl2404 = bk.select(KL2424, 0)
- class pyhoff.BusTerminal(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
object
Base class for all bus terminals.
- bus_coupler
The bus coupler to which this terminal is connected.
- parameters
The parameters of the terminal.
- 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.
- class pyhoff.DigitalInputTerminal(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
BusTerminal
Base class for digital input terminals.
- read_input(channel)
Read the input from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The input value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number 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.
- class pyhoff.DigitalOutputTerminal(bus_coupler, output_bit_addresses, input_bit_addresses, output_word_addresses, input_word_addresses, mixed_mapping)
Bases:
BusTerminal
Base class for digital output terminals.
- read_coil(channel)
Read the coil value back from a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to read from.- Return type:
bool
|None
- Returns:
The coil value of the specified channel or None if the read operation failed.
- Raises:
Exception – If the channel number 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.
- write_coil(channel, value)
Write a value to a specific channel.
- Parameters:
channel (
int
) – The channel number (start counting from 1) to write to.value (
bool
) – The value to write.
- Return type:
bool
- Returns:
True if the write operation succeeded, otherwise False.
- Raises:
Exception – If the channel number is out of range.
Modbus
This modbus implementation is used internally.
- class pyhoff.modbus.SimpleModbusClient(host, port=502, unit_id=1, timeout=5, debug=False)
Bases:
object
A simple Modbus TCP client
- Parameters:
host (
str
) – hostname or IP addressport (
int
) – server portunit_id (
int
) – ModBus idtimeout (
float
) – socket timeout in secondsdebug (
bool
) – if True prints out transmitted and received bytes in hex
- host
hostname or IP address
- port
server port
- unit_id
ModBus id
- timeout
socket timeout in seconds
- last_error
contains last error message or empty string if no error occurred
- debug
if True prints out transmitted and received bytes in hex
- close()
Close connection
- Return type:
bytes
- Returns:
empty bytes object
- connect()
Connect manual to the configured modbus server. Usually there is no need to call this function since it is handled automatically.
- Return type:
bool
- read_coil(address)
Read a coil from the given register address.
- Parameters:
address (
int
) – The register address to read from.- Return type:
bool
|None
- Returns:
The value of the coil or None if error
- read_coils(bit_address, bit_lengths=1)
ModBus function for reading coils (0x01)
- Parameters:
bit_address (
int
) – Bit address (0 to 0xffff)bit_lengths (
int
) – Number of bits to read (1 to 2000)
- Returns:
Bits list or None if error
- Return type:
list of bool or None
- read_discrete_input(address)
Read a discrete input from the given register address.
- Parameters:
address (
int
) – The register address to read from.- Return type:
bool
|None
- Returns:
The value of the discrete input.
- read_discrete_inputs(bit_address, bit_lengths=1)
ModBus function for reading discrete inputs (0x02)
- Parameters:
bit_address (
int
) – Bit address (0 to 0xffff)bit_lengths (
int
) – Number of bits to read (1 to 2000)
- Returns:
Bits list or None if error
- Return type:
list of bool or None
- read_holding_registers(register_address, word_lengths=1)
ModBus function for reading holding registers (0x03)
- Parameters:
register_address (
int
) – Register address (0 to 0xffff)word_lengths (
int
) – Number of registers to read (1 to 125)
- Returns:
Registers list or None if error
- Return type:
list of int or None
- read_input_registers(register_address, word_lengths=1)
ModBus function for reading input registers (0x04)
- Parameters:
register_address (
int
) – Register address (0 to 0xffff)word_lengths (
int
) – Number of registers to read (1 to 125)
- Returns:
Registers list or None if error
- Return type:
list of int or None
- receive_modbus_data()
Receive a ModBus frame
- Return type:
bytes
- Returns:
bytes received or empty bytes object if an error occurred
- send_modbus_data(function_code, body)
Send raw ModBus TCP frame
- Parameters:
unction_code – ModBus function code
body (
bytes
) – data
- Return type:
int
- Returns:
number of transmitted bytes or 0 if transmission failed
- write_multiple_coils(bit_address, values)
ModBus function for writing multiple coils (0x0F)
- Parameters:
bit_address (
int
) – Bit address (0 to 0xffff)values (
list
[bool
]) – List of bit values to write
- Return type:
bool
- Returns:
True if write succeeded or False if failed
- write_multiple_registers(register_address, values)
ModBus function for writing multiple registers (0x10)
- Parameters:
register_address (
int
) – Register address (0 to 0xffff)values (
list
[int
]) – List of 16 bit register values to write
- Return type:
bool
- Returns:
True if write succeeded or False if failed
- write_single_coil(bit_address, value)
ModBus function for writing a single coil (0x05)
- Parameters:
bit_address (
int
) – Bit address (0 to 0xffff)value (
bool
) – Value to write (single bit)
- Return type:
bool
- Returns:
True if write succeeded or False if failed
- write_single_register(register_address, value)
ModBus function for writing a single register (0x06)
- Parameters:
register_address (
int
) – Register address (0 to 0xffff)value (
int
) – Value to write (0 to 0xffff)
- Return type:
bool
- Returns:
True if write succeeded or False if failed