plesty.lib.device.base_tcp_scpi_device
======================================
.. py:module:: plesty.lib.device.base_tcp_scpi_device
.. autoapi-nested-parse::
Base TCP/IP SCPI device implementation for Plesty.
Classes
-------
.. autoapisummary::
plesty.lib.device.base_tcp_scpi_device.BaseTCPScpiDevice
Module Contents
---------------
.. py:class:: 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: :py:obj:`plesty.lib.device.base_device_sync.BaseDeviceSyncModel`
Base 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.
.. py:attribute:: host
.. py:attribute:: port
.. py:attribute:: timeout
:value: 5
.. 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.tcp_ip.TCPIPTrafficManager | None
:value: None
.. py:attribute:: scpi_solver
:type: plesty.lib.solver.scpi.SCPISolver | None
:value: None
.. py:method:: init(main=None) -> None
Initialize the traffic manager and SCPI solver.
.. py:method:: connect() -> bool
Open the TCP connection to the device.
.. py:method:: disconnect() -> None
Close the TCP connection to the device.
.. py:method:: _write_(key: str, value: Any)
Send a SCPI write command to the device.
.. 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 device identity string using ``*IDN?``.
.. py:method:: check_errors() -> list[str]
Check the device status byte for errors and return a list of error strings.
.. py:method:: check_operatability() -> bool
Return True if the device responds to ``*OPC?`` with ``'1'``.
.. py:method:: reset() -> None
Execute device reset.
.. py:method:: event_status() -> Any
Query the event status register.