Connecting to Keithley 6221 by Keithley in Python
Instrument Card
The 6221 AC and DC Current Source combine ease of use with exceptionally low current noise. Low current sourcing is critical to applications in test environments ranging from R&D to production, especially in the semiconductor, nanotechnology, and superconductor industries. High sourcing accuracy and built-in control functions make the 6221 ideal for applications like Hall measurements, resistance measurements using delta mode, pulsed measurements, and differential conductance measurements.
Device Specification: here
Manufacturer card: KEITHLEY
Keithley Instruments is a measurement and instrument company headquartered in Solon, Ohio, that develops, manufactures, markets, and sells data acquisition products, as well as complete systems for high-volume production and assembly testing.
- Headquarters: Cleveland, Ohio, United States
- Yearly Revenue (millions, USD): 110.6
- Vendor Website: here
Demo: Measure a solar panel IV curve with a Keithley 2400
Connect to the Keithley 6221 in Python
Read our guide for turning Python scripts into Flojoy nodes.
PROTOCOLS > SCPI
Here is an example Python script that uses Pymeasure to connect to a Keithley 6221 Power Supply:
from pymeasure.adapters import VISAAdapterfrom pymeasure.instruments.keithley import Keithley6221
# Create a VISA adapter for the instrumentadapter = VISAAdapter("GPIB::1")
# Connect to the Keithley 6221 Power Supplykeithley = Keithley6221(adapter)
# Enable the sourcekeithley.enable_source()
# Set the source current to 0.05 Ampskeithley.source_current = 0.05
# Set the source compliance to 10 Voltskeithley.source_compliance = 10
# Set the waveform function to squarekeithley.waveform_function = "square"
# Set the waveform amplitude to 0.05 Ampskeithley.waveform_amplitude = 0.05
# Set the waveform offset to 0 Ampskeithley.waveform_offset = 0
# Set the waveform frequency to 347 Hzkeithley.waveform_frequency = 347
# Set the waveform duty cycle to 50%keithley.waveform_dutycycle = 50
# Set the waveform ranging to "best"keithley.waveform_ranging = "best"
# Set the waveform duration in cycles to 100keithley.waveform_duration_cycles = 100
# Arm (load) the waveformkeithley.waveform_arm()
# Start the waveformkeithley.waveform_start()
# Wait for the waveform to finishkeithley.adapter.wait_for_srq()
# Disarm (unload) the waveformkeithley.waveform_abort()
# Disable the sourcekeithley.disable_source()
# Close the connection to the Keithley 6221 Power Supplykeithley.shutdown()
This script connects to the Keithley 6221 Power Supply using a VISA adapter and sets various properties of the instrument, such as the source current, source compliance, waveform function, waveform amplitude, waveform offset, waveform frequency, waveform duty cycle, waveform ranging, and waveform duration. It then arms and starts the waveform, waits for it to finish, and finally disables the source and closes the connection to the instrument.