stoner_measurement.instruments.protocol.modbus.ModbusRtuProtocol

class stoner_measurement.instruments.protocol.modbus.ModbusRtuProtocol[source]

Bases: BaseProtocol

Minimal protocol descriptor for Modbus RTU binary frames.

format_command(command: str) → bytes[source]

Encode command as ASCII bytes.

The Modbus drivers in this project do not use BaseInstrument.write(); they talk to the transport with pre-built binary frames. This implementation exists only to satisfy the BaseProtocol interface.

format_query(query: str) → bytes[source]

Encode query as ASCII bytes.

See format_command() for why this is intentionally minimal.

property max_frame_size: int

Return a conservative Modbus RTU frame-size limit.

parse_response(raw: bytes, *, command: str | None = None) → str[source]

Decode raw for diagnostic purposes.

terminator = None