write_typed()#
- ModbusTCPTransport.write_typed(
- register_type: Literal['holding', 'input', 'coil', 'discrete'],
- address: int,
- value: int | float | bool,
- 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,
Encode
valueasdata_typeand write it toaddress, dispatching byregister_type.Coils are single-bit, so
data_typemust be"bool"andvaluemust be abool(no numeric coercion).