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.

TransportBase

The contract a transport implements: _open_session, _teardown_session, is_open, plus shared ownership.

VisaDriver#

VisaDriver

Transport for VISA-attached instruments.

VisaConfig

Connection parameters for a VISA resource.

SerialConfig

Serial-line settings, applied when the VISA resource is an ASRL interface.

TerminatorConfig

Read and write terminators applied to the VISA resource.

TimeoutConfig

Operation timeouts in seconds.

StopBits

Parity

ControlFlow

Modbus transport#

ModbusTransport

Abstract Modbus line: owns the session, locking, and every wire op, addressed per call via unit_id.

ModbusTCPTransport

A Modbus TCP line.

ModbusRTUTransport

A Modbus serial line (RTU or ASCII framing).

register_count

Number of 16-bit registers data_type spans (uint16→1, uint32→2, uint64→4).

decode_registers

Decode raw 16-bit registers into a typed value, applying byte/word/long swaps as configured.

encode_value

Encode a typed value into 16-bit registers, applying byte/word/long swaps as configured.