Source Meter · TSP command reference

Keithley 2602B and 2636B TSP commands

The Keithley 2602B and 2636B source meter is controlled remotely with TSP (Test Script Processor) commands. TestFlow's instrument library holds 69 commands for it, 14 of them queries that read values or state, grouped below by subsystem with their arguments. It is the same library TestFlow's AI agent uses to drive the 2602B on a real bench.

Commands
69
Queries
14
Subsystems
10
Models covered
2

Control the Keithley 2602B from Python

With PyVISA, any VISA backend, and the instrument on USB, LAN or GPIB, this opens a session, identifies the instrument, sends one setting, and reads one value. Every command in it comes from the reference below. For a full walkthrough, see the PyVISA tutorial and the SCPI command cheat sheet.

import pyvisa

rm = pyvisa.ResourceManager()
print(rm.list_resources())  # find the Keithley 2602B's VISA address

# Paste the address of your Keithley 2602B (USB, LAN or GPIB).
inst = rm.open_resource("PASTE_VISA_ADDRESS_HERE")
inst.timeout = 5000  # ms

print(inst.query("*IDN?"))  # identify the instrument
inst.write("smua.source.output = smua.OUTPUT_ON")  # Turn On CHA
print(inst.query("print(smua.measure.v())"))  # Measure Voltage CHA

inst.close()

Run a 2602B test without writing code

Describe the test in a sentence, for example “turn on cha on the 2602B, then measure voltage cha and log it against a limit”. TestFlow's agent builds the steps from this command library, runs them on your bench through the TestFlow desktop app, and writes the report from the measured values. See AI test automation for lab instruments for how that works and where it stops.

Get started

TSP command reference

69 commands in 10 groups. A ? marks a query that returns a value. Placeholders in angle brackets take the listed values. The 2602B and 2636B share this command set in TestFlow's library.

SMU channel A (smua) (24)

CommandWhat it doesArguments
smua.source.output = smua.OUTPUT_ONTurn On CHA. Enables the output of SMU channel A (TSP command).None
smua.source.output = smua.OUTPUT_OFFTurn Off CHA. Disables the output of SMU channel A (TSP command).None
smua.source.func = smua.OUTPUT_DCVOLTSSet Source Function Voltage CHA. Sets the source function of channel A to DC voltage.None
smua.source.func = smua.OUTPUT_DCAMPSSet Source Function Current CHA. Sets the source function of channel A to DC current.None
smua.source.levelv = <Voltage>Set Voltage Source CHA. Sets the output voltage level in volts on channel A.Number
smua.source.leveli = <Amp>Set Current Source CHA. Sets the output current level in amps on channel A.Number
smua.source.rangev = <Range>Set Source Voltage Range CHA. Sets the source voltage range in volts on channel A.Number
smua.source.rangei = <Range>Set Source Current Range CHA. Sets the source current range in amps on channel A.Number
smua.source.autorangev = smua.AUTORANGE_ONSource Voltage Autorange On CHA. Enables source voltage autorange on channel A.None
smua.source.autorangev = smua.AUTORANGE_OFFSource Voltage Autorange Off CHA. Disables source voltage autorange on channel A.None
smua.source.limitv = <Voltage>Set Voltage Compliance CHA. Sets the voltage compliance (limit) in volts on channel A.Number
smua.source.limiti = <Amp>Set Current Compliance CHA. Sets the current compliance (limit) in amps on channel A.Number
smua.measure.rangev = <Range>Set Measure Voltage Range CHA. Sets the voltage measurement range in volts on channel A.Number
smua.measure.rangei = <Range>Set Measure Current Range CHA. Sets the current measurement range in amps on channel A.Number
smua.measure.autorangev = smua.AUTORANGE_ONMeasure Voltage Autorange On CHA. Enables voltage measurement autorange on channel A.None
smua.measure.autorangev = smua.AUTORANGE_OFFMeasure Voltage Autorange Off CHA. Disables voltage measurement autorange on channel A.None
smua.measure.nplc = <Cycles>Set NPLC CHA. Sets the integration time in power line cycles on channel A.Number
smua.sense = smua.SENSE_REMOTESet Four Wire On CHA. Enables 4-wire (remote sense) measurement on channel A.None
smua.sense = smua.SENSE_LOCALSet Four Wire Off CHA. Disables 4-wire sense on channel A (uses 2-wire local sense).None
smua.source.offmode = smua.OUTPUT_HIGH_ZSet Output Off Mode Himp CHA. Sets the output-off state to high impedance on channel A.None
smua.source.offmode = smua.OUTPUT_NORMALSet Output Off Mode Normal CHA. Sets the output-off state to normal on channel A.None
smua.source.offmode = smua.OUTPUT_ZEROSet Output Off Mode Zero CHA. Sets the output-off state to zero on channel A.None
smua.measure.count = <Count>Set Measure Count CHA. Sets the number of measurements made per trigger on channel A.Number
smua.reset()Reset Channel CHA. Resets channel A to its default settings.None

SMU channel B (smub) (24)

CommandWhat it doesArguments
smub.source.output = smub.OUTPUT_ONTurn On CHB. Enables the output of SMU channel A (TSP command).None
smub.source.output = smub.OUTPUT_OFFTurn Off CHB. Disables the output of SMU channel A (TSP command).None
smub.source.func = smub.OUTPUT_DCVOLTSSet Source Function Voltage CHB. Sets the source function of channel A to DC voltage.None
smub.source.func = smub.OUTPUT_DCAMPSSet Source Function Current CHB. Sets the source function of channel A to DC current.None
smub.source.levelv = <Voltage>Set Voltage Source CHB. Sets the output voltage level in volts on channel A.Number
smub.source.leveli = <Amp>Set Current Source CHB. Sets the output current level in amps on channel A.Number
smub.source.rangev = <Range>Set Source Voltage Range CHB. Sets the source voltage range in volts on channel A.Number
smub.source.rangei = <Range>Set Source Current Range CHB. Sets the source current range in amps on channel A.Number
smub.source.autorangev = smub.AUTORANGE_ONSource Voltage Autorange On CHB. Enables source voltage autorange on channel A.None
smub.source.autorangev = smub.AUTORANGE_OFFSource Voltage Autorange Off CHB. Disables source voltage autorange on channel A.None
smub.source.limitv = <Voltage>Set Voltage Compliance CHB. Sets the voltage compliance (limit) in volts on channel A.Number
smub.source.limiti = <Amp>Set Current Compliance CHB. Sets the current compliance (limit) in amps on channel A.Number
smub.measure.rangev = <Range>Set Measure Voltage Range CHB. Sets the voltage measurement range in volts on channel A.Number
smub.measure.rangei = <Range>Set Measure Current Range CHB. Sets the current measurement range in amps on channel A.Number
smub.measure.autorangev = smub.AUTORANGE_ONMeasure Voltage Autorange On CHB. Enables voltage measurement autorange on channel A.None
smub.measure.autorangev = smub.AUTORANGE_OFFMeasure Voltage Autorange Off CHB. Disables voltage measurement autorange on channel A.None
smub.measure.nplc = <Cycles>Set NPLC CHB. Sets the integration time in power line cycles on channel A.Number
smub.sense = smub.SENSE_REMOTESet Four Wire On CHB. Enables 4-wire (remote sense) measurement on channel A.None
smub.sense = smub.SENSE_LOCALSet Four Wire Off CHB. Disables 4-wire sense on channel A (uses 2-wire local sense).None
smub.source.offmode = smub.OUTPUT_HIGH_ZSet Output Off Mode Himp CHB. Sets the output-off state to high impedance on channel A.None
smub.source.offmode = smub.OUTPUT_NORMALSet Output Off Mode Normal CHB. Sets the output-off state to normal on channel A.None
smub.source.offmode = smub.OUTPUT_ZEROSet Output Off Mode Zero CHB. Sets the output-off state to zero on channel A.None
smub.measure.count = <Count>Set Measure Count CHB. Sets the number of measurements made per trigger on channel A.Number
smub.reset()Reset Channel CHB. Resets channel A to its default settings.None

Reading values (print) (14)

CommandWhat it doesArguments
print(smua.source.output)Read Output State CHA. Reads whether SMU channel A output is on or off.None
print(smua.source.compliance)Read Compliance Tripped CHA. Reads whether channel A is in compliance (limit reached).None
print(smua.measure.v())Measure Voltage CHA. Triggers and returns the measured voltage in volts on channel A.None
print(smua.measure.i())Measure Current CHA. Triggers and returns the measured current in amps on channel A.None
print(smua.measure.r())Measure Resistance CHA. Triggers and returns the measured resistance in ohms on channel A.None
print(smua.measure.p())Measure Power CHA. Triggers and returns the measured power in watts on channel A.None
print(smub.source.output)Read Output State CHB. Reads whether SMU channel A output is on or off.None
print(smub.source.compliance)Read Compliance Tripped CHB. Reads whether channel A is in compliance (limit reached).None
print(smub.measure.v())Measure Voltage CHB. Triggers and returns the measured voltage in volts on channel A.None
print(smub.measure.i())Measure Current CHB. Triggers and returns the measured current in amps on channel A.None
print(smub.measure.r())Measure Resistance CHB. Triggers and returns the measured resistance in ohms on channel A.None
print(smub.measure.p())Measure Power CHB. Triggers and returns the measured power in watts on channel A.None
print(errorqueue.next())Read Error. Reads the next message from the error queue.None
print(localnode.description)Identify. Returns the instrument identification string.None

Beeper (1)

CommandWhat it doesArguments
beeper.beep(<Duration>, <Frequency>)Beep. Sounds the beeper for the given duration and frequency.Number; Number

Reset (1)

CommandWhat it doesArguments
reset()Reset. Resets the entire instrument to its default state.None

Status model (1)

CommandWhat it doesArguments
status.reset()Clear Status. Clears all status registers and the error queue.None

Synchronisation (1)

CommandWhat it doesArguments
waitcomplete()Wait To Continue. Waits until all overlapped operations are complete before continuing.None

Other (1)

CommandWhat it doesArguments
<Output Variable>=<Equation>Math. Variable equals an equation like (${Var_name}= ${Var_name}/2)Number; Text

Synchronisation (1)

CommandWhat it doesArguments
wait(<ms>)Wait. Waits for number of millisecondsNumber

Save and recall (1)

CommandWhat it doesArguments
save2var <Variable_name>Save2Variable. Saves last measurement to a variableText

Where these commands come from

This reference is generated from TestFlow's instrument library, which is drafted from Keithley's programming documentation for the 2602B and 2636B and checked when the agent runs it. Ranges, timing, and option-dependent commands are defined by Keithley's programming manual: check it before you rely on an edge case. Last updated June 18, 2026.

Frequently asked questions

Does the Keithley 2602B support TSP remote control?

Yes. The Keithley 2602B is programmed with TSP (Test Script Processor) commands, a Lua-based command set, sent over USB, LAN or GPIB. TestFlow's library holds 69 TSP commands for it. Reading a value uses print(), for example print(smua.measure.v()).

How do I control the Keithley 2602B from Python?

Install PyVISA and a VISA backend, find the instrument's address with ResourceManager().list_resources(), open it, then send commands with write() and read values with query(). The example on this page sends *IDN?, smua.source.output = smua.OUTPUT_ON and print(smua.measure.v()).

Which command reads a value from the Keithley 2602B?

print(smua.measure.v()) (measure voltage cha). Triggers and returns the measured voltage in volts on channel A. The full list of queries is in the command reference on this page, grouped by subsystem.

Can I automate the Keithley 2602B without writing code?

Yes. TestFlow is an AI agent for electronics testing: you describe the test, and it builds the automation from this command library, runs it on the Keithley 2602B through the TestFlow desktop app, and writes the report from the measured results.

Your next test, automated today

Describe the test. TestFlow builds the workflow, runs it on your instruments, and writes the report. See it on a bench like yours.