ModbusRTUTransport#
- class ModbusRTUTransport(
- port: str,
- baudrate: int = 9600,
- parity: Literal['N', 'E', 'O'] = 'N',
- stopbits: Literal[1, 2] = 1,
- bytesize: Literal[5, 6, 7, 8] = 8,
- timeout: float = 3.0,
- framer: Literal['rtu', 'ascii'] = 'rtu',
Bases:
ModbusTransportA Modbus serial line (RTU or ASCII framing). One port, addressed per wire op via
unit_id.Validate and store the serial port’s fields.
Attributes
Whether the client has been opened and not closed. |
Methods
Validate |
|
Close and teardown; with a holder, remove it and tear down only when the last owner leaves. |
|
Return the reentrant resource lock for atomic multi-step sequences; the holder may write/query/read inside it. |
|
Open the connection (idempotent); with a holder, admit it and return True only for the first owner. |
|
Read coils by address (FC01). |
|
Read discrete inputs by address (FC02). |
|
Read holding registers by address (FC03). |
|
Read input registers by address (FC04). |
|
Read |
|
Write a single coil by address (FC05). |
|
Write multiple coils by address (FC15). |
|
Write a single holding register by address (FC06). |
|
Write multiple holding registers by address (FC16). |
|
Encode |