plesty.lib.device.base_visa_scpi_device
Base VISA SCPI device implementation for Plesty.
Classes
Base class for VISA SCPI devices providing connection and communication methods. |
Module Contents
- class plesty.lib.device.base_visa_scpi_device.BaseVisaScpiDevice(address: str, timeout: int = 5000, write_termination='\n', read_termination='\n', baud_rate: int | None = None, op_schema=None, param_schema=None)
Bases:
plesty.lib.device.base_device_sync.BaseDeviceSyncModelBase class for VISA 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 VISA address and communication parameters.
- Parameters:
address (str)
timeout (int)
baud_rate (int | None)
- address
- timeout = 5000
- write_termination = Multiline-String
Show Value
""" """
- read_termination = Multiline-String
Show Value
""" """
- baud_rate = None
- traffic_manager: plesty.lib.traffic.visa.VisaTrafficManager | None = None
- scpi_solver: plesty.lib.solver.scpi.SCPISolver | None = None
- init(main=None) None
Initialize the VISA traffic manager and SCPI solver.
- Return type:
None
- connect() bool
Discover and open the VISA instrument connection.
- Raises:
RuntimeError – If the address matches no connected instrument.
TimeoutError – If a wedged device on the bus stalls enumeration.
- Return type:
bool
- disconnect() None
Close the VISA instrument connection.
- Return type:
None
- _write_(key: str, value: Any)
Send a SCPI write command to the instrument.
- 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 instrument identity string using
*IDN?.- Return type:
Any
- check_errors() list[str]
Check the instrument error queue and return a list of error strings.
- Return type:
list[str]
- check_operatability() bool
Return True if the instrument responds to
*OPC?with'1'.- Return type:
bool