eta_nexus.nodes.modbus_node module
This module implements the node class, which is used to parametrize connections.
- eta_nexus.nodes.modbus_node.bitarray_to_registers(bits: list[int | bool]) list[int][source]
Convert a list of bits into a list of 16 bit ‘bytes’.
- class eta_nexus.nodes.modbus_node.ModbusNode(name: str, url: str, protocol: str, *args: Any, **kwargs: Any)[source]
Bases:
NodeNode for the Modbus protocol.
- mb_register: str
Modbus Register name. One of input, discrete_input, coils and holding. Note that only coils and holding can be written to.
- mb_bit_length: int
Length of the value in bits (default 32). This determines, how much data is read from the server. The value must be a multiple of 16.
- decode_modbus_value(value: Sequence[int]) Any[source]
Decode incoming modbus values.
Strings are always decoded as utf-8 values. If you do not want this behaviour, specify ‘bytes’ as the data type for the Node.
- Parameters:
value – Current value to be decoded
- Returns:
Decoded value as the Node’s data type.