plestylib.traffic.visa#

Classes#

VisaTrafficManager

A TrafficManager implementation for managing VISA communication.

Module Contents#

class plestylib.traffic.visa.VisaTrafficManager(address: str, timeout: int = 5000, write_termination='\n', read_termination='\n', baud_rate: int = None)#

Bases: plestylib.traffic.TrafficManager

A TrafficManager implementation for managing VISA communication.

This class provides methods to open, close, and communicate with VISA instruments.

Initialize the TrafficManager with the given address and timeout.

Parameters:
  • address (str) – The address of the resource.

  • timeout (int, optional) – The timeout for operations in seconds. Defaults to 5.

  • baud_rate (int)

write_termination = Multiline-String#
Show Value
"""
"""
read_termination = Multiline-String#
Show Value
"""
"""
baud_rate = None#
rm = None#
discover_instrument(address: str) list[str] | bool#

Discover the VISA instrument at the specified address.

Parameters:
  • address (str) – The VISA resource address to discover, this address

  • it. (will override self.address and update)

Returns:

A list of available VISA resources if the specified address is found. bool: False if the specified address is not found or if an error occurs during discovery.

Return type:

list[str]

_open()#

Connect to the VISA instrument at the specified address.

_close()#

Close the VISA connection.

_send_command(command: str, timeout=None, mode=None) str | bool#

Send a command to the VISA instrument and return the response.

Parameters:

command (str)

Return type:

str | bool