read_typed()#

ModbusTCPTransport.read_typed(
register_type: Literal['holding', 'input', 'coil', 'discrete'],
address: int,
data_type: Literal['uint16', 'int16', 'uint32', 'int32', 'uint64', 'int64', 'float32', 'float64', 'bool'],
*,
unit_id: int,
byte_swap: bool = False,
word_swap: bool = False,
long_swap: bool = False,
) → int | float | bool#

Read address as data_type, dispatching by register_type and decoding across registers.

Coils and discrete inputs are single-bit, so data_type must be "bool" and the read returns a bool.