ModbusTransport#
- class ModbusTransport[source]#
Bases:
TransportBase,ABCAbstract Modbus line: owns the session, locking, and every wire op, addressed per call via
unit_id. Annotate against it; construct a concrete subclass.Initialize holder tracking, the lock, and the (not yet connected) client slot.
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 |