devctrl.devices.voltmeter.impl.keithley2700.Keithley2700#
- class Keithley2700(instr, check_front_switch=True)[source]#
Bases:
VoltmeterWrapper class for the Keithley2700 SMU controlled via pyvisa
Methods
Manually add a specific device.
The Keithley2700 cant beep on command :(
Read new values from the buffer.
Connect to a Keithley 2700 device
Connect an instance of the device's dummy implementation
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}
Query the status of the device and return a string describing errors.
Check if the device is connected and responding
Get a list of all devices for this type.
Continuously measure voltage at regular intervals
Process a raw reading string into timestamp and voltage values
Read a single voltage measurement
Reset the device
Run SCPI code on the device by writing it
Load and execute a SCPI script file
- _CLASS_TYPE = 'implementation'#
- __abstractmethods__ = frozenset({})#
- __annotations__ = {'_manual_devices': list[str]}#
- __dict__ = mappingproxy({'__module__': 'devctrl.devices.voltmeter.impl.keithley2700', '__firstlineno__': 13, '__doc__': '\nWrapper class for the Keithley2700 SMU controlled via pyvisa\n', '_CLASS_TYPE': 'implementation', '__init__': <function Keithley2700.__init__>, '__del__': <function Keithley2700.__del__>, '_check_front_input_selected': <function Keithley2700._check_front_input_selected>, 'query': <function Keithley2700.query>, 'query_int': <function Keithley2700.query_int>, 'run': <function Keithley2700.run>, 'run_script': <function Keithley2700.run_script>, 'beep': <function Keithley2700.beep>, 'reset': <function Keithley2700.reset>, 'buffer_clear': <function Keithley2700.buffer_clear>, 'buffer_get_size': <function Keithley2700.buffer_get_size>, 'buffer_set_size': <function Keithley2700.buffer_set_size>, 'buffer_measure': <function Keithley2700.buffer_measure>, 'buffer_read_new_values': <function Keithley2700.buffer_read_new_values>, 'process_reading': <function Keithley2700.process_reading>, 'read_value': <function Keithley2700.read_value>, 'measure': <function Keithley2700.measure>, 'is_connected': <function Keithley2700.is_connected>, '_enumerate_devices': <classmethod(<function Keithley2700._enumerate_devices>)>, 'connect_device': <classmethod(<function Keithley2700.connect_device>)>, '__repr__': <function Keithley2700.__repr__>, '__static_attributes__': ('buffer_next_idx', 'buffer_size', 'instr'), '__abstractmethods__': frozenset(), '_abc_impl': <_abc._abc_data object>, '_children': {}, '_manual_devices': []})#
- __firstlineno__ = 13#
- __module__ = 'devctrl.devices.voltmeter.impl.keithley2700'#
- __repr__() str[source]#
Get a string representation of the device
- Returns:
Formatted string with device model and resource name
- __slots__ = ()#
- __static_attributes__ = ('buffer_next_idx', 'buffer_size', 'instr')#
- __weakref__#
list of weak references to the object
- _abc_impl = <_abc._abc_data object>#
- _check_front_input_selected()[source]#
Make sure the front switch selecting the inputs selects the FRONT inputs Raises —— Exception
If front input state != 1
Returns#
- switchstr
Front input state
- _children = {}#
- _dummies_only = False#
- classmethod _enumerate_devices(query='(GPIB)|(USB)?*:INSTR')[source]#
Enumerate available Keithley 2700 devices
Uses the utility function to find devices matching the Keithley 2700 model.
- Parameters:
query – VISA resource query pattern
- Returns:
List of available device names
- _manual_devices: list[str] = []#
- 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.
- static allow_only_dummy_devices()#
- 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