Skip to main content

Auto-discovering Keithley 2400/2450 SMU control library over serial or USB

Project description

keithley2400

Single-file Python library for Keithley 2400 and 2450 SourceMeter / SMU control.

The public API stays simple:

  • one import
  • one class
  • auto-detect model
  • auto-detect serial vs USB
  • old scripts can keep using Keithley2400(...)

What it supports

  • Keithley 2400 over RS-232 / USB-serial (ASRL...)
  • Keithley 2450 over USBTMC / VISA USB (USB...)
  • stale configured resources with automatic fallback discovery
  • one shared high-level API for common operations: source V/I, compliance, read V/I/R, sweep IV, ramp voltage

Installation

pip install keithley2400

For USB instruments when using the @py backend, also make sure the host has a USB backend library such as libusb installed.

Quick start

Auto-discover everything

from keithley2400 import Keithley2400

with Keithley2400(resource=None) as k:
    print(k.idn())
    print(k.model)
    print(k.resource)

Old code still works

from keithley2400 import Keithley2400

k = Keithley2400(resource="ASRL/dev/cu.usbserial-FTRTKC3X::INSTR")
print(k.idn())
k.close()

If that resource is stale, the library tries it first and then falls back to auto-discovery.

Ramp to bias voltage

from keithley2400 import Keithley2400

with Keithley2400() as k:
    v_meas, i_meas = k.ramp_to_voltage(
        44.5,
        voltage_steps=[0, 10, 20, 30, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 44.5],
        compliance_amps=1e-3,
        high_voltage_threshold_v=35.0,
        high_compliance_amps=5e-3,
        high_compliance_hold_s=5.0,
        stabilize_s=3.0,
        current_range_amps=0.01,
        keep_output_on=True,
    )
    print(v_meas, i_meas)

Compatibility note

The public class name remains Keithley2400 for backward compatibility, but it now acts as a model-agnostic SMU facade. You can also import the alias KeithleySMU.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keithley2400-0.2.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file keithley2400-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: keithley2400-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for keithley2400-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5da465581f208b5b9222b54007e2b55b75deede5243dca328172e295188214f0
MD5 d92e5abe25045b9cbeb5642dc006280b
BLAKE2b-256 3b3dfd845c42132b36d4df4f137d46e7dcd07f5bf8d79e58bbe90b01e80e1754

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page