Keithley module

This module contains the SourceMeter2400 class for interacting with Keithley 2400 SourceMeter series devices. Current functionality focuses on using it as a source only, so 4-wire mode is not implemented yet.

Examples

Below is a minimum working example showing how to use a Keithley 2400 series SourceMeter.

import pyvisa
from Devices.Keithley import SourceMeter2400

rm = pyvisa.ResourceManager()
# Automatically find device based on serial number.
# A matching USB device will be used if it's found.'
# Otherwise, the hostname defined in the config is used to connect over the network.
sm = SourceMeter2400(rm, sn='04085563')

# Set the device to constant current mode at 100 uA with a voltage limit of 1 V
sm.setCC(100e-6, 1)

# Read back current and voltage
print("Current: {sm.I*1e6} uA")
print("Voltage: {sm.V*1e3} mV")
class Keithley.SourceMeter2400(rm, sn=None, addressOverride=None, config=PosixPath('Config/SourceMeter.json'))[source]

Bases: object

Driver class for Keithley 2400 SourceMeter series devices.

Parameters:
  • rm (pyvisa.ResourceManager) – Resource manager instance with which to open the instrument

  • sn (str, optional) – Serial number of the instrument. Used for grabbing the hostname from the config or finding the USB device. If this is None, addressOverride should be specified.

  • addressOverride (str, optional) – Manually specified VISA resource locator. Overrides sn. If this is None, sn should be specified.

  • config (pathlib.Path, default: "Config/SourceMeter.json") – Config file path.

property I

Measure current in amperes on the force or sense pins depending on mode.

Type:

float

property R

Measure resistance in Ohms in 2 or 4-point configuration depending on mode.

Type:

float

property V

Measure voltage in volts on the force or sense pins depending on mode.

Type:

float

beep(f, t)[source]

Plays a beep of the given frequency for the given time. Blocks until note is played.

Parameters:
  • f (float) – Frequency of beep in Hz. Use 0 for silence.

  • t (float) – Duration of beep in seconds.

chime(name)[source]

Plays a chime defined in the config file. See the ‘chimes’ key of the config.

Parameters:

name (str) – Name of chime in the config file.

property front

Gets or sets the active status of the front panel ports. True corresponds to the front, while False means back panel.

Type:

bool

getFront()[source]

Get the front panel ports as active.

Returns:

front – If True, the front panel ports are active. If False, the back panel ports are active.

Return type:

bool

getI()[source]
getOutput()[source]

Get the output state.

Returns:

output – If True, the outputs are enabled. If False, the outputs are disabled.

Return type:

bool

getR()[source]
getV()[source]
off()[source]

Turns the ouptut off.

on()[source]

Turns the ouptut on.

property output

Gets or sets whther the output is active.

Type:

bool

setCC(I, V_lim=None)[source]

Set the device to constant current mode.

Parameters:
  • I (float) – Target current in amperes.

  • V_lim (float, optional) – Voltage limit in volts.

setCV(V, I_lim=None)[source]

Set the device to constant voltage mode.

Parameters:
  • V (float) – Target voltage in volts.

  • I_lim (float, optional) – Current limit in amperes.

setFront()[source]

Set the front panel ports as active.

Parameters:

front (bool, default: True) – If True, the front panel ports are active. If False, the back panel ports are active.

setOutput(output)[source]

Set the output state.

Parameters:

output (bool) – If True, the outputs are enabled. If False, the outputs are disabled.