Transports#
Transport drivers own I/O, locking, and connection lifecycle. Concrete instrument drivers compose a transport in their constructor rather than extending it.
TransportBase#
TransportBase is the base every transport implements: _open_session, _teardown_session, and is_open
are the required contract, and the base itself provides the open/close lifecycle with shared
ownership, so more than one driver can share a single connection. The first open(holder) opens it,
and it stays open until the last close(holder) frees it. See Transports
in the guides for the lifecycle contract, a worked combined-instrument example, and a walkthrough for
implementing a new transport.
The contract a transport implements: |
VisaDriver#
Transport for VISA-attached instruments. |
|
Connection parameters for a VISA resource. |
|
Serial-line settings, applied when the VISA resource is an ASRL interface. |
|
Read and write terminators applied to the VISA resource. |
|
Operation timeouts in seconds. |
|
Modbus transport#
Abstract Modbus line: owns the session, locking, and every wire op, addressed per call via |
|
A Modbus TCP line. |
|
A Modbus serial line (RTU or ASCII framing). |
|
Number of 16-bit registers |
|
Decode raw 16-bit registers into a typed value, applying byte/word/long swaps as configured. |
|
Encode a typed value into 16-bit registers, applying byte/word/long swaps as configured. |