devctrl.devices.voltmeter.impl.keithley2700.Keithley2700#

class Keithley2700(instr, check_front_switch=True)[source]#

Bases: Voltmeter

Wrapper class for the Keithley2700 SMU controlled via pyvisa

Methods

add_device

Manually add a specific device.

allow_only_dummy_devices

beep

The Keithley2700 cant beep on command :(

buffer_clear

buffer_get_size

buffer_measure

buffer_read_new_values

Read new values from the buffer.

buffer_set_size

connect

connect_device

Connect to a Keithley 2700 device

connect_dummy

Connect an instance of the device's dummy implementation

get_base_classes

Return a flat dictionary of all base classes below this class :param recurse: If True, recursively search for base classes :return: dict of {class name: class}

get_device_name

get_device_type_name

get_status

Query the status of the device and return a string describing errors.

is_connected

Check if the device is connected and responding

list_devices

Get a list of all devices for this type.

measure

Continuously measure voltage at regular intervals

process_reading

Process a raw reading string into timestamp and voltage values

query

query_int

read_value

Read a single voltage measurement

reset

Reset the device

run

Run SCPI code on the device by writing it

run_script

Load and execute a SCPI script file

classmethod add_device(connect_info)#

Manually add a specific device. The device will show up when list_devices() is called for the device type. Call this from the device class implementation, e.g. use ModelXYZ9000.add_device(‘GPIB:1234:5678’) to add a specific device with a fixed GPIB address. This is useful when automatic discovery is undesired/impossible, either because it is not implemented or it disturbs other devices which can’t handle a identification request. :param cls: The device implementation class :param connect_info: A string argument that is passed to the connect() method of the device implementation, when the device is being connected.

beep(length=0.5, pitch=1000)[source]#

The Keithley2700 cant beep on command :(

buffer_read_new_values() list[tuple[float, float]][source]#

Read new values from the buffer. :raises: RuntimeError if no buffer measurement was started :raises: ValueError if no new values have been measured yet :returns: List of (timestampe, voltage)

classmethod connect(device_type_name: str, device_name: str | None, **kwargs) Device#
Parameters:
  • device_type_name – The name of the device class

  • device_name – The name of the device class

classmethod connect_device(device_name)[source]#

Connect to a Keithley 2700 device

Opens a VISA connection to the specified device and returns a configured instance.

Parameters:

device_name – VISA resource name of the device

Returns:

Configured Keithley2700 instance

classmethod connect_dummy(**kwargs) Device#

Connect an instance of the device’s dummy implementation

classmethod get_base_classes(recurse=True) dict[str, type[Device]]#

Return a flat dictionary of all base classes below this class :param recurse: If True, recursively search for base classes :return: dict of {class name: class}

classmethod get_device_name() str#
Returns:

The specific type name of the device, e.g., SR830 or Keithly2600

classmethod get_device_type_name() str#
Returns:

The general type name of the device, e.g., Lock-In Amplifier or Voltmeter

get_status() str#

Query the status of the device and return a string describing errors. If everything is ok, empty string must be returned :return: String of device status

is_connected() bool[source]#

Check if the device is connected and responding

Queries the device identification string to verify connection.

Returns:

True if device responds to *IDN? query, False otherwise

classmethod list_devices() list[tuple[str, str]]#

Get a list of all devices for this type. The list made up of: - Manually added devices - Available devices (those returned by _enumerate_devices) - A dummy device (if a dummy implementation exists) - List of all devices of child classes

Returns:

list of available devices

measure(interval: int, update_func: Callable[[int, float, float], None] | None = None, max_measurements: int | None = None)[source]#

Continuously measure voltage at regular intervals

Takes voltage readings at the specified interval, optionally calling an update function after each reading. Continues until max_measurements is reached or forever if None.

Parameters:
  • interval – Milliseconds to wait between readings

  • update_func – Function called after each reading with (n_reading, time, voltage). None for no callback

  • max_measurements – Number of readings to perform. None for infinite measurements

process_reading(reading: str) tuple[float, float][source]#

Process a raw reading string into timestamp and voltage values

Parses the Keithley 2700 format reading string and extracts the timestamp and voltage DC values.

Parameters:

reading – Raw reading string from the device

Returns:

Tuple of (timestamp, voltage) values

Raises:

ValueError – If the reading format is invalid

read_value() tuple[float, float][source]#

Read a single voltage measurement

Queries the device for a reading and processes it into timestamp and voltage values.

Returns:

Tuple of (timestamp, voltage) values

reset(verbose=False)[source]#

Reset the device

run(code, verbose=False)[source]#

Run SCPI code on the device by writing it

Empty lines, leading whitespaces and lines starting with ‘ or # are ignored.

Parameters:
  • code – SCPI commands to execute

  • verbose – If True, print the commands being executed

run_script(script_path, verbose=False)[source]#

Load and execute a SCPI script file

Loads the code from the specified file path and executes it using run().

Parameters:
  • script_path – Full path to the script file

  • verbose – If True, print status messages during execution