Source Meter · SCPI command comparison

Keithley 2400 vs Keysight B2901B: SCPI commands and remote control compared

In TestFlow's instrument library, the Keithley 2400 takes 54 SCPI commands, 12 of them queries, and the Keysight B2901B takes 61 SCPI commands, 15 of them queries. That is 7 more on the B2901B. Counting distinct command headers (the command path without its arguments), 16 are accepted by both, 26 exist only on the 2400, and 41 only on the B2901B. 38% of the 2400's command headers also exist on the B2901B.

Both libraries have commands under SOURce, SENSe, MEASure, OUTPut, TRIGger, READ, FETCh, and INITiate, plus 1 more root. Only the 2400 has SYSTem. Only the B2901B has DISPlay, FORMat, and ARM.

Only the 2400 library has an operation-complete command (*OPC?); the B2901B library has none. Only the 2400 library has an error-queue read (SYSTem:ERRor?); the B2901B library has none.

TestFlow's library gives the 2401, 2410, 2420, 2425, 2430, and 2440 the same command set as the 2400, so the 2400 column applies to them too. TestFlow's library gives the B2901BL, B2910BL, and B2911B the same command set as the B2901B, so the B2901B column applies to them too.

2400 commands
54
B2901B commands
61
Shared headers
16
Unique headers
67

Run this on your bench

Describe the test; TestFlow's agent uses these command sets to drive your Keithley 2400 or Keysight B2901B and writes the report from the measured results.

Get started

2400 vs B2901B at a glance

Counts come from TestFlow's instrument library, the command sets its AI agent uses to drive each instrument. A distinct command header is the command path without its arguments, so :OUTPut ON and :OUTPut OFF count once.

Keithley 2400Keysight B2901B
Commands in TestFlow's library5461
Queries (read a value or state)1215
Settings and actions4246
Subsystems1416
Distinct command headers4257
Headers the other lacks2641
Command languageSCPISCPI
Operation complete*OPC?Not in library
Error queueSYSTem:ERRor?Not in library
Models on this command set2400, 2401, 2410, 2420, 2425, 2430, 2440B2901B, B2901BL, B2910BL, B2911B

Commands both accept

16 command headers are in both libraries. Here are 12, taken across subsystems. Where the B2901B library writes the command differently, its form is shown under the 2400's.

CommandWhat it does
:SOURce:VOLTage:RANGe <Range>Set Source Voltage Range. Sets the source voltage range in volts.
:MEASure:VOLTage?Measure Voltage. Triggers and returns the measured voltage in volts.
:OUTPut ONTurn On. Enables the source output.
:TRIGger:COUNt <Count>Set Trigger Count. Sets the number of triggers before returning to idle.
:ABORtAbort. Aborts the current operation and returns to idle.
*IDN?Identify. Returns the instrument identification string (manufacturer, model, serial, firmware).
:SOURce:CURRent:RANGe <Range>Set Source Current Range. Sets the source current range in amps.
:MEASure:CURRent?Measure Current. Triggers and returns the measured current in amps.
:TRIGger:DELay <Seconds>Set Trigger Delay. Sets the trigger delay in seconds.
*RSTReset. Resets the instrument to its default state.
:SOURce:VOLTage:RANGe:AUTO ONB2901B: :SOURce:VOLTage:RANGe:AUTO <State>Source Voltage Autorange On. Enables source voltage autorange.
:MEASure:RESistance?Measure Resistance. Triggers and returns the measured resistance in ohms.

Only on the Keithley 2400

26 command headers in the 2400 library have no match in the B2901B library. Below are 15 of them from the 6 largest subsystems; the full list is in the Keithley 2400 command reference.

SOURce (9 only on the 2400)

CommandWhat it does
:SOURce:FUNCtion <Function>Set Source Function. Sets the source function to voltage or current mode.
:SOURce:FUNCtion?Read Source Function. Reads the present source function.
:SOURce:VOLTage:LEVel <Voltage>Set Voltage Source. Sets the output voltage level in volts when in voltage source mode.
:SOURce:CURRent:LEVel <Amp>Set Current Source. Sets the output current level in amps when in current source mode.

SENSe (7 only on the 2400)

CommandWhat it does
:SENSe:FUNCtion "VOLTage"Set Sense Function Voltage. Selects voltage as the measurement (sense) function.
:SENSe:VOLTage:PROTection <Voltage>Set Voltage Compliance. Sets the voltage compliance (limit) in volts.
:SENSe:CURRent:PROTection <Amp>Set Current Compliance. Sets the current compliance (limit) in amps.
:SENSe:VOLTage:RANGe <Range>Set Voltage Sense Range. Sets the voltage measurement range in volts.

SYSTem (3 only on the 2400)

CommandWhat it does
:SYSTem:RSENse ONSet Four Wire On. Enables 4-wire (remote sense) measurement.
:SYSTem:AZERo ONSet Auto Zero On. Enables autozero.
:SYSTem:ERRor?Read Error. Reads the first message from the error queue.

IEEE 488.2 common (*) (2 only on the 2400)

CommandWhat it does
*OPC?Operation Complete. Returns 1 when all pending operations are complete.
*TRGTrigger Bus. Generates a bus trigger when the instrument is in wait-for-trigger state.

FETCh (1 only on the 2400)

CommandWhat it does
:FETCh?Fetch Value. Returns the last measurement without re-triggering.

INITiate (1 only on the 2400)

CommandWhat it does
:INITiateInitiate. Places the instrument in the wait-for-trigger state.

Only on the Keysight B2901B

41 command headers in the B2901B library have no match in the 2400 library. Below are 22 of them from the 6 largest subsystems; the full list is in the Keysight B2901B command reference.

SENSe (10 only on the B2901B)

CommandWhat it does
:SENSe:VOLTage:PROTection:LEVel <Voltage>Set Voltage Compliance. Sets the voltage compliance (protection) limit in volts when sourcing current.
:SENSe:CURRent:PROTection:LEVel <Current>Set Current Compliance. Sets the current compliance (protection) limit in amperes when sourcing voltage.
:SENSe:FUNCtion:ON "<Function>"Set Sense Function. Selects the measurement (sense) function.
:SENSe:VOLTage:RANGe:UPPer <Range>Set Sense Voltage Range. Sets the measurement range for voltage sensing in volts.

SOURce (10 only on the B2901B)

CommandWhat it does
:SOURce:FUNCtion:SHAPe <Function>Set Source Function. Sets the source output shape to DC or Pulse mode.
:SOURce:FUNCtion:MODE <Mode>Set Source Mode. Sets the source function mode to voltage or current sourcing.
:SOURce:VOLTage:LEVel:IMMediate:AMPLitude <Voltage>Set Voltage. Sets the DC output voltage level in volts (range: -21 V to +21 V).
:SOURce:CURRent:LEVel:IMMediate:AMPLitude <Current>Set Current. Sets the DC output current level in amperes (range: -3 A to +3 A).

FETCh (5 only on the B2901B)

CommandWhat it does
:FETCh:SCALar:VOLTage?Fetch Voltage. Returns the last measured voltage from the instrument buffer without re-triggering.
:FETCh:SCALar:CURRent?Fetch Current. Returns the last measured current from the instrument buffer without re-triggering.
:FETCh:SCALar?Fetch All. Returns all last measured data (voltage current resistance status timestamp) from buffer.
:FETCh:ARRay:VOLTage?Fetch Array Voltage. Returns the array of measured voltage data points from the last sweep without re-triggering.

IEEE 488.2 common (*) (4 only on the B2901B)

CommandWhat it does
*SAV <Register>Save State. Saves the current instrument settings to non-volatile memory register (0 to 4).
*RCL <Register>Recall State. Recalls and restores instrument settings from the specified non-volatile memory register.
*CAL?Self Calibration. Executes self-calibration and returns 0 if successful or a non-zero error code if failed.
*OPCOperation Complete. Sets the OPC bit in the Event Status Register when all pending operations are complete.

OUTPut (4 only on the B2901B)

CommandWhat it does
:OUTPut:STATe?Read Output State. Queries and returns the current output state (0=OFF / 1=ON).
:OUTPut:OFF:MODE <Mode>Set Output Off Mode. Sets the output terminal condition when the output is turned off.
:OUTPut:LOW <State>Set Output Low. Sets the output LO terminal to ground or floating when output is off.
:OUTPut:FILTer:LPASs:STATe <State>Set Output Filter. Enables or disables the output low-pass filter.

DISPlay (2 only on the B2901B)

CommandWhat it does
:DISPlay:ENABle <State>Set Display Enable. Enables or disables the front-panel display. Disabling improves measurement throughput.
:DISPlay:WINDow:TEXT:DATA <String>Set Display Text. Sends a user-defined text string to be displayed on the front panel display.

Control both from Python

With PyVISA and any VISA backend, this opens both instruments, identifies them, sends one setting, and reads one value from each. For the setting, both libraries hold :OUTPut (turn on), and the same line runs on each. For the reading, both libraries hold :MEASure:VOLTage? (measure voltage), and the same line runs on each. For the basics, see the PyVISA tutorial.

import pyvisa

rm = pyvisa.ResourceManager()
print(rm.list_resources())  # find both VISA addresses

a = rm.open_resource("PASTE_2400_ADDRESS")  # Keithley 2400
b = rm.open_resource("PASTE_B2901B_ADDRESS")  # Keysight B2901B
for inst in (a, b):
    inst.timeout = 5000  # ms
    print(inst.query("*IDN?"))

# The same setting on both: Turn On
a.write(":OUTPut ON")
b.write(":OUTPut ON")

# The same reading on both: Measure Voltage
print(a.query(":MEASure:VOLTage?"))
print(b.query(":MEASure:VOLTage?"))

a.close()
b.close()

Run this on your bench

Describe the test; TestFlow's agent uses these command sets to drive your Keithley 2400 or Keysight B2901B and writes the report from the measured results.

Get started

Frequently asked questions

What is the difference between the Keithley 2400 and the Keysight B2901B for remote control?

In TestFlow's library the 2400 has 54 SCPI commands and the B2901B has 61 SCPI commands. 16 command headers are common to both, 26 are only on the 2400 (mostly SOURce and SENSe), and 41 are only on the B2901B (mostly SENSe and SOURce).

Can I use the same SCPI code for the Keithley 2400 and the Keysight B2901B?

Partly. 16 command headers are accepted by both, including :SOURce:VOLTage:RANGe, :MEASure:VOLTage?, and :OUTPut. 67 are not, for example :SOURce:FUNCtion on the 2400 and :SENSe:VOLTage:PROTection:LEVel on the B2901B, so a script that uses those needs a separate branch for each instrument.

Which has more remote commands, the 2400 or the B2901B?

The B2901B: 54 commands for the 2400 against 61 for the B2901B in TestFlow's library. Of those, 12 on the 2400 and 15 on the B2901B are queries that read a value or state, and the library splits them into 14 and 16 subsystems.

How do the 2400 and B2901B signal operation complete and report errors?

Only the 2400 library has an operation-complete command (*OPC?); the B2901B library has none. Only the 2400 library has an error-queue read (SYSTem:ERRor?); the B2901B library has none. Each command named here is listed in the tables on this page and on each instrument's command reference.

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.