device.base.visabase module

class device.base.visabase.TestVisaHardwareBase(resource_name, **kwargs)[source]

Bases: VisaHardwareBase

Mockup class to simulate communication with VISA device. Use for testing and dry-run of subclasses that are based on VisaHardwareBase.

raw_scpi(command, query_parse='none')[source]

Send SCPI command to device. Commands containing ‘?’ are automatically processed as queries - waiting for device response.

Parameters:
  • command (str) – SCPI command.

  • query_parse (str) – use ‘none’, ‘ascii’ or ‘binary’

  • parse_datatype (str) – specify datatype of parsed values using Format Characters from native module struct.

  • kwargs (dict) – additional parameters for query_ascii_values() or query_binary_values() from pyvisa.Resource

class device.base.visabase.VisaHardwareBase(resource_name, timeout=2000, baud_rate=9600, **kwargs)[source]

Bases: HardwareBase

Base class for communication with hardware.

Communication is based on VISA standard and SCPI commands. Derived classes can implement convenient functions for user friendly and/or automatized control of the device.

Required method overload:

__init__ -> call super().__init__ with your VISA ‘resource_name’

Optional method overloads:

def to_defaultstate(self): def clear_defaultstate(self):

raw_scpi(command, query_parse='none', parse_datatype='f', **kwargs)[source]

Send SCPI command to device. Commands containing ‘?’ are automatically processed as queries - waiting for device response.

Parameters:
  • command (str) – SCPI command.

  • query_parse (str) – use ‘none’, ‘ascii’ or ‘binary’

  • parse_datatype (str) – specify datatype of parsed values using Format Characters from native module struct.

  • kwargs (dict) – additional parameters for query_ascii_values() or query_binary_values() from pyvisa.Resource