ModbusTCPTransport#
- class ModbusTCPTransport(host: str, port: int = 502, timeout: float = 3.0)[source]#
Bases:
ModbusTransportA Modbus TCP line. One socket, addressed per wire op via
unit_id.Validate and store host, port, and timeout.
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 |