The Keithley 2400, 2401, and 2410 source meter is controlled remotely with SCPI commands. TestFlow's instrument library holds 54 commands for it, 12 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 2400 on a real bench.
Commands
54
Queries
12
Subsystems
14
Models covered
3
Control the Keithley 2400 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 2400's VISA address
# Paste the address of your Keithley 2400 (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(":OUTPut ON") # Turn On
print(inst.query(":MEASure:VOLTage?")) # Measure Voltage
inst.close()
Run a 2400 test without writing code
Describe the test in a sentence, for example “turn on on the 2400, then measure voltage 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.
54 commands in 14 groups. A ? marks a query that returns a value. Placeholders in angle brackets take the listed values. The 2400, 2401, and 2410 share this command set in TestFlow's library.
Source (SOURce) (16)
Command
What it does
Arguments
:SOURce:FUNCtion <Function>
Set Source Function. Sets the source function to voltage or current mode.
Text: VOLTage,CURRent
:SOURce:FUNCtion?
Read Source Function. Reads the present source function.
None
:SOURce:VOLTage:LEVel <Voltage>
Set Voltage Source. Sets the output voltage level in volts when in voltage source mode.
Number
:SOURce:CURRent:LEVel <Amp>
Set Current Source. Sets the output current level in amps when in current source mode.
Number
:SOURce:VOLTage:RANGe <Range>
Set Source Voltage Range. Sets the source voltage range in volts.
Number
:SOURce:CURRent:RANGe <Range>
Set Source Current Range. Sets the source current range in amps.
Number
:SOURce:VOLTage:RANGe:AUTO ON
Source Voltage Autorange On. Enables source voltage autorange.
None
:SOURce:VOLTage:RANGe:AUTO OFF
Source Voltage Autorange Off. Disables source voltage autorange.
None
:SOURce:CURRent:RANGe:AUTO ON
Source Current Autorange On. Enables source current autorange.
None
:SOURce:CURRent:RANGe:AUTO OFF
Source Current Autorange Off. Disables source current autorange.
None
:SOURce:VOLTage:MODE FIXed
Set Source Mode Fixed. Sets the source to fixed (DC) output mode.
None
:SOURce:VOLTage:MODE SWEep
Set Source Mode Sweep. Sets the source to sweep output mode.
None
:SOURce:VOLTage:STARt <Voltage>
Set Sweep Start. Sets the sweep start voltage in volts.
Number
:SOURce:VOLTage:STOP <Voltage>
Set Sweep Stop. Sets the sweep stop voltage in volts.
Number
:SOURce:VOLTage:STEP <Voltage>
Set Sweep Step. Sets the sweep step size in volts.
Number
:SOURce:SWEep:POINts <Points>
Set Sweep Points. Sets the number of points in the sweep.
Number
Sense (SENSe) (10)
Command
What it does
Arguments
:SENSe:FUNCtion "VOLTage"
Set Sense Function Voltage. Selects voltage as the measurement (sense) function.
None
:SENSe:FUNCtion "CURRent"
Set Sense Function Current. Selects current as the measurement (sense) function.
None
:SENSe:FUNCtion "RESistance"
Set Sense Function Resistance. Selects resistance as the measurement (sense) function.
None
:SENSe:VOLTage:PROTection <Voltage>
Set Voltage Compliance. Sets the voltage compliance (limit) in volts.
Number
:SENSe:CURRent:PROTection <Amp>
Set Current Compliance. Sets the current compliance (limit) in amps.
Number
:SENSe:VOLTage:RANGe <Range>
Set Voltage Sense Range. Sets the voltage measurement range in volts.
Number
:SENSe:CURRent:RANGe <Range>
Set Current Sense Range. Sets the current measurement range in amps.
Number
:SENSe:VOLTage:RANGe:AUTO ON
Voltage Sense Autorange On. Enables voltage measurement autorange.
None
:SENSe:VOLTage:RANGe:AUTO OFF
Voltage Sense Autorange Off. Disables voltage measurement autorange.
None
:SENSe:CURRent:NPLCycles <Cycles>
Set NPLC. Sets the integration time in power line cycles for current measurement.
Number
System (SYSTem) (5)
Command
What it does
Arguments
:SYSTem:RSENse ON
Set Four Wire On. Enables 4-wire (remote sense) measurement.
None
:SYSTem:RSENse OFF
Set Four Wire Off. Disables 4-wire sense (uses 2-wire local sense).
None
:SYSTem:AZERo ON
Set Auto Zero On. Enables autozero.
None
:SYSTem:AZERo OFF
Set Auto Zero Off. Disables autozero.
None
:SYSTem:ERRor?
Read Error. Reads the first message from the error queue.
None
Measurement (MEASure) (4)
Command
What it does
Arguments
:MEASure?
Measure All. Triggers and returns the measured voltage, current, resistance and timestamp.
None
:MEASure:VOLTage?
Measure Voltage. Triggers and returns the measured voltage in volts.
None
:MEASure:CURRent?
Measure Current. Triggers and returns the measured current in amps.
None
:MEASure:RESistance?
Measure Resistance. Triggers and returns the measured resistance in ohms.
None
Output (OUTPut) (3)
Command
What it does
Arguments
:OUTPut ON
Turn On. Enables the source output.
None
:OUTPut OFF
Turn Off. Disables the source output.
None
:OUTPut?
Read Output State. Reads whether the output is ON or OFF.
None
Trigger (TRIGger) (2)
Command
What it does
Arguments
:TRIGger:COUNt <Count>
Set Trigger Count. Sets the number of triggers before returning to idle.
Number
:TRIGger:DELay <Seconds>
Set Trigger Delay. Sets the trigger delay in seconds.
Number
Read (READ) (1)
Command
What it does
Arguments
:READ?
Read Value. Triggers and returns one measurement of the configured sense functions.
None
Fetch (FETCh) (1)
Command
What it does
Arguments
:FETCh?
Fetch Value. Returns the last measurement without re-triggering.
None
Initiate (INITiate) (1)
Command
What it does
Arguments
:INITiate
Initiate. Places the instrument in the wait-for-trigger state.
None
Abort (1)
Command
What it does
Arguments
:ABORt
Abort. Aborts the current operation and returns to idle.
None
Other subsystem (1)
Command
What it does
Arguments
<Output Variable>=<Equation>
Math. Variable equals an equation like (${Var_name}= ${Var_name}/2)
Number; Text
WAIT subsystem (1)
Command
What it does
Arguments
wait(<ms>)
Wait. Waits for number of milliseconds
Number
SAVE subsystem (1)
Command
What it does
Arguments
save2var <Variable_name>
Save2Variable. Saves last measurement to a variable
Text
IEEE 488.2 common commands (7)
Command
What it does
Arguments
*IDN?
Identify. Returns the instrument identification string (manufacturer, model, serial, firmware).
None
*RST
Reset. Resets the instrument to its default state.
None
*CLS
Clear Status. Clears all event registers and the error queue.
None
*TST?
Self Test. Runs the self-test and returns 0 for pass or 1 for failure.
None
*OPC?
Operation Complete. Returns 1 when all pending operations are complete.
None
*WAI
Wait To Continue. Waits until all pending operations are complete before continuing.
None
*TRG
Trigger Bus. Generates a bus trigger when the instrument is in wait-for-trigger state.
None
Where these commands come from
This reference is generated from TestFlow's instrument library, which is drafted from Keithley's programming documentation for the 2400, 2401, and 2410 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 2400 support SCPI remote control?
Yes. The Keithley 2400 accepts SCPI commands over its remote interfaces. TestFlow's instrument library holds 54 SCPI commands for it: 12 queries that read values or state, and 42 settings and actions.
How do I control the Keithley 2400 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?, :OUTPut ON and :MEASure:VOLTage?.
Which command reads a value from the Keithley 2400?
:MEASure:VOLTage? (measure voltage). Triggers and returns the measured voltage in volts. The full list of queries is in the command reference on this page, grouped by subsystem.
Can I automate the Keithley 2400 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 2400 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.