plesty.lib.device.base_tcp_scpi_device
Base TCP/IP SCPI device implementation for Plesty.
Classes
Base class for TCP SCPI devices providing connection and communication methods. |
Module Contents
- class plesty.lib.device.base_tcp_scpi_device.BaseTCPScpiDevice(host: str, port: int, timeout: int = 5, write_termination='\r\n', read_termination='\r\n', baud_rate: int | None = None, op_schema=None, param_schema=None)
Bases:
plesty.lib.device.base_device_sync.BaseDeviceSyncModelBase class for TCP SCPI devices providing connection and communication methods.
This class is designed to be extended by specific device classes that implement the details of the SCPI commands for each instrument.
Initialize with host, port, and communication parameters.
- Parameters:
host (str)
port (int)
timeout (int)
baud_rate (int | None)
- host
- port
- timeout = 5
- write_termination = Multiline-String
Show Value
""" """
- read_termination = Multiline-String
Show Value
""" """
- baud_rate = None
- traffic_manager: plesty.lib.traffic.tcp_ip.TCPIPTrafficManager | None = None
- scpi_solver: plesty.lib.solver.scpi.SCPISolver | None = None
- init(main=None) None
Initialize the traffic manager and SCPI solver.
- Return type:
None
- connect() bool
Open the TCP connection to the device.
- Return type:
bool
- disconnect() None
Close the TCP connection to the device.
- Return type:
None
- _write_(key: str, value: Any)
Send a SCPI write command to the device.
- Parameters:
key (str)
value (Any)
- _query_(key)
Send a SCPI query command and return the raw response.
- query_range(key) list
Query the minimum and maximum values for a parameter key.
- Return type:
list
- identity() Any
Query the device identity string using
*IDN?.- Return type:
Any
- check_errors() list[str]
Check the device status byte for errors and return a list of error strings.
- Return type:
list[str]
- check_operatability() bool
Return True if the device responds to
*OPC?with'1'.- Return type:
bool
- reset() None
Execute device reset.
- Return type:
None
- event_status() Any
Query the event status register.
- Return type:
Any