plestylib.device.base_tcp_scpi_device#

Classes#

BaseTCPScpiDevice

A base class for TCP SCPI devices that provides common functionality for connecting to and communicating with instruments using the TCP protocol and SCPI commands.

Module Contents#

class plestylib.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, op_schema=None, param_schema=None)#

Bases: plestylib.device.base_device_sync.BaseDeviceSyncModel

A base class for TCP SCPI devices that provides common functionality for connecting to and communicating with instruments using the TCP protocol and SCPI commands.

This class is designed to be extended by specific device classes that implement the details of the SCPI commands for each instrument. It provides methods for connecting to the instrument, sending SCPI commands, and handling responses, as well as error handling and resource management.

Parameters:
  • solver – Callable used to send a message dictionary and return a response dictionary.

  • host (str)

  • port (int)

  • timeout (int)

  • baud_rate (int)

host#
port#
timeout = 5#
write_termination = Multiline-String#
Show Value
"""
"""
read_termination = Multiline-String#
Show Value
"""
"""
baud_rate = None#
init(main=None)#

Initialize the device. This should be called before any other operations.

connect()#

Placeholder method for connecting to the device.

disconnect()#

Placeholder method for disconnecting from the device.

_write_(key: str, value: Any)#

Placeholder method for writing a command to the device.

Parameters:
  • key (str)

  • value (Any)

_query_(key)#

Placeholder method for querying the device.

query_range(key) list#
Return type:

list

identity()#

Query the device for its identity string.

check_errors()#

Query the device for any error messages.

check_operatability()#

Check if the device is currently operatable (connected and responsive).

reset()#

Execute device reset

event_status()#

Query the event status register