plesty.lib.device.base_visa_scpi_device
=======================================
.. py:module:: plesty.lib.device.base_visa_scpi_device
.. autoapi-nested-parse::
Base VISA SCPI device implementation for Plesty.
Classes
-------
.. autoapisummary::
plesty.lib.device.base_visa_scpi_device.BaseVisaScpiDevice
Module Contents
---------------
.. py:class:: BaseVisaScpiDevice(address: str, timeout: int = 5000, write_termination='\n', read_termination='\n', baud_rate: int | None = None, op_schema=None, param_schema=None)
Bases: :py:obj:`plesty.lib.device.base_device_sync.BaseDeviceSyncModel`
Base 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.
.. py:attribute:: address
.. py:attribute:: timeout
:value: 5000
.. py:attribute:: write_termination
:value: Multiline-String
.. raw:: html
Show Value
.. code-block:: python
"""
"""
.. raw:: html
.. py:attribute:: read_termination
:value: Multiline-String
.. raw:: html
Show Value
.. code-block:: python
"""
"""
.. raw:: html
.. py:attribute:: baud_rate
:value: None
.. py:attribute:: traffic_manager
:type: plesty.lib.traffic.visa.VisaTrafficManager | None
:value: None
.. py:attribute:: scpi_solver
:type: plesty.lib.solver.scpi.SCPISolver | None
:value: None
.. py:method:: init(main=None) -> None
Initialize the VISA traffic manager and SCPI solver.
.. py:method:: connect() -> bool
Discover and open the VISA instrument connection.
:raises RuntimeError: If the address matches no connected instrument.
:raises TimeoutError: If a wedged device on the bus stalls enumeration.
.. py:method:: disconnect() -> None
Close the VISA instrument connection.
.. py:method:: _write_(key: str, value: Any)
Send a SCPI write command to the instrument.
.. py:method:: _query_(key)
Send a SCPI query command and return the raw response.
.. py:method:: query_range(key) -> list
Query the minimum and maximum values for a parameter key.
.. py:method:: identity() -> Any
Query the instrument identity string using ``*IDN?``.
.. py:method:: check_errors() -> list[str]
Check the instrument error queue and return a list of error strings.
.. py:method:: check_operatability() -> bool
Return True if the instrument responds to ``*OPC?`` with ``'1'``.