Source Meter · SCPI command reference

Keysight B2901C and B2911C SCPI commands

The Keysight B2901C and B2911C source meter is controlled remotely with SCPI commands. TestFlow's instrument library holds 55 commands for it, 13 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 B2901C on a real bench.

Commands
55
Queries
13
Subsystems
16
Models covered
2

Run this on your bench

Describe the test; TestFlow's agent uses this command set to drive your Keysight B2901C or B2911C and writes the report from the measured results.

Get started

Control the Keysight B2901C 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 Keysight B2901C's VISA address

# Paste the address of your Keysight B2901C (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(":OUTP ON")  # Turn ON
print(inst.query(":MEASure:VOLTage?"))  # Measure Voltage

inst.close()

Run this on your bench

Describe the test; TestFlow's agent uses this command set to drive your Keysight B2901C or B2911C and writes the report from the measured results.

Get started

Run a B2901C test without writing code

Describe the test in a sentence, for example “turn on on the B2901C, 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.

Get started

SCPI command reference

55 commands in 16 groups. A ? marks a query that returns a value. Placeholders in angle brackets take the listed values. The B2901C and B2911C share this command set in TestFlow's library.

Source (SOURce) (12)

CommandWhat it doesArguments
:SOURce:FUNCtion:MODE <Function>Set Source Function. Sets the source function mode to voltage or current.Text: VOLTage,CURRent
:SOURce:VOLTage:LEVel:IMMediate:AMPLitude <Voltage>Set Voltage Level. Sets the immediate output voltage level.Number
:SOURce:CURRent:LEVel:IMMediate:AMPLitude <Current>Set Current Level. Sets the immediate output current level.Number
:SOURce:VOLTage:RANGe <Range>Set Voltage Range. Sets the source voltage output range in volts.Number: 0.2,2,20,200
:SOURce:VOLTage:RANGe:AUTO <State>Set Voltage Auto Range. Enables or disables auto-ranging for the voltage source output.Text: ON,OFF
:SOURce:CURRent:RANGe:AUTO <State>Set Current Auto Range. Enables or disables auto-ranging for the current source output.Text: ON,OFF
:SOURce:VOLTage:STARt <Voltage>Set Sweep Start Voltage. Sets the sweep start voltage level.Number
:SOURce:VOLTage:STOP <Voltage>Set Sweep Stop Voltage. Sets the sweep stop voltage level.Number
:SOURce:CURRent:STARt <Current>Set Sweep Start Current. Sets the sweep start current level.Number
:SOURce:CURRent:STOP <Current>Set Sweep Stop Current. Sets the sweep stop current level.Number
:SOURce:SWEep:POINts <Points>Set Sweep Points. Sets the number of steps in a linear sweep.Number
:SOURce:SWEep:SPACing <Mode>Set Sweep Mode. Sets the sweep spacing to linear or logarithmic.Text: LINear,LOGarithmic

Sense (SENSe) (9)

CommandWhat it doesArguments
:SENSe:VOLTage:PROTection <Voltage>Set Voltage Compliance. Sets the voltage compliance (limit) level when sourcing current.Number
:SENSe:CURRent:PROTection <Current>Set Current Compliance. Sets the current compliance (limit) level when sourcing voltage.Number
:SENSe:FUNCtion:ON "<Function>"Set Sense Function. Selects the measurement (sense) function.Text: VOLTage,CURRent,RESistance
:SENSe:VOLTage:RANGe <Range>Set Sense Voltage Range. Sets the measurement voltage range in volts.Number: 0.2,2,20,200
:SENSe:VOLTage:RANGe:AUTO <State>Set Sense Voltage Auto Range. Enables or disables auto-ranging for voltage measurement.Text: ON,OFF
:SENSe:CURRent:RANGe:AUTO <State>Set Sense Current Auto Range. Enables or disables auto-ranging for current measurement.Text: ON,OFF
:SENSe:VOLTage:NPLCycles <Cycles>Set NPLC Voltage. Sets integration time in power line cycles for voltage measurement (0.01 to 10).Number
:SENSe:CURRent:NPLCycles <Cycles>Set NPLC Current. Sets integration time in power line cycles for current measurement (0.01 to 10).Number
:SENSe:REMote <State>Set Remote Sense. Enables or disables 4-wire (Kelvin) remote sensing.Text: ON,OFF

Output (OUTPut) (5)

CommandWhat it doesArguments
:OUTP ONTurn ON. Enables the SMU output.None
:OUTP OFFTurn OFF. Disables the SMU output.None
:OUTPut:STATe?Read Output State. Queries whether the SMU output is ON or OFF.None
:OUTPut:OFF:MODE <Mode>Set Output Off Mode. Sets the output state when the SMU output is turned off.Text: NORMal,HIZ,ZERO
:OUTPut:LOW <Mode>Set Low Terminal. Sets the low terminal connection to floating or grounded.Text: FLOat,GROund

Measurement (MEASure) (3)

CommandWhat it doesArguments
:MEASure:VOLTage?Measure Voltage. Triggers and returns a single voltage measurement.None
:MEASure:CURRent?Measure Current. Triggers and returns a single current measurement.None
:MEASure:RESistance?Measure Resistance. Triggers and returns a single resistance measurement.None

Fetch (FETCh) (3)

CommandWhat it doesArguments
:FETCh:ARRay:VOLTage?Fetch Voltage. Fetches the stored voltage measurement array from the buffer.None
:FETCh:ARRay:CURRent?Fetch Current. Fetches the stored current measurement array from the buffer.None
:FETCh:ARRay:RESistance?Fetch Resistance. Fetches the stored resistance measurement array from the buffer.None

Trace (TRACe) (3)

CommandWhat it doesArguments
:TRACe:POINts <Points>Set Trace Points. Sets the number of data points stored in the measurement trace buffer.Number
:TRACe:CLEarClear Trace Buffer. Clears all data stored in the trace measurement buffer.None
:TRACe:FEED:CONTrol <Mode>Set Trace Feed. Controls when measurements are stored to the trace buffer.Text: NEXT,NEVer

Trigger (TRIGger) (2)

CommandWhat it doesArguments
:TRIGger:COUNt <Count>Set Trigger Count. Sets the number of trigger cycles to execute.Number
:TRIGger:SOURce <Source>Set Trigger Source. Sets the trigger source for measurement.Text: AINT,BUS,TIMer,INT1,INT2,LAN,EXT1,EXT2

Display (DISPlay) (2)

CommandWhat it doesArguments
:DISPlay:VIEW <Mode>Set Display Mode. Sets the front panel display view mode.Text: SINGle1,GRAPh,ROLL
:DISPlay:ENABle <State>Enable Display. Enables or disables the front panel display.Text: ON,OFF

System (SYSTem) (2)

CommandWhat it doesArguments
:SYSTem:ERRor?Read Error Queue. Queries the error queue and returns the first error message and number.None
:SYSTem:BEEPer:STATe <State>Set Beeper State. Enables or disables the audible beeper.Text: ON,OFF

Initiate (INITiate) (1)

CommandWhat it doesArguments
:INITiateInitiate Trigger. Initiates one trigger cycle and starts a measurement sequence.None

Abort (1)

CommandWhat it doesArguments
:ABORtAbort Trigger. Aborts the current trigger sequence and resets the trigger system.None

Read (READ) (1)

CommandWhat it doesArguments
:READ?Read All Data. Initiates a measurement and returns all measurement data immediately.None

Other subsystem (1)

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

WAIT subsystem (1)

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

SAVE subsystem (1)

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

IEEE 488.2 common commands (8)

CommandWhat it doesArguments
*IDN?Identify. Returns the instrument identification string including manufacturer and model.None
*RSTReset. Resets the instrument to factory default settings.None
*CLSClear Status. Clears the status byte and all event registers.None
*TST?Self Test. Executes the instrument self-test and returns 0 for pass or 1 for fail.None
*CAL?Self Calibration. Executes the self-calibration routine and returns the result.None
*OPC?Operation Complete. Returns 1 when all pending operations are complete.None
*SAV <Register>Save State. Saves the current instrument state to the specified memory register (0 to 4).Number: 0,1,2,3,4
*RCL <Register>Recall State. Restores a previously saved instrument state from the specified memory register.Number: 0,1,2,3,4

Where these commands come from

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

Frequently asked questions

Does the Keysight B2901C support SCPI remote control?

Yes. The Keysight B2901C accepts SCPI commands over its remote interfaces. TestFlow's instrument library holds 55 SCPI commands for it: 13 queries that read values or state, and 42 settings and actions.

How do I control the Keysight B2901C 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?, :OUTP ON and :MEASure:VOLTage?.

Which command reads a value from the Keysight B2901C?

:MEASure:VOLTage? (measure voltage). Triggers and returns a single voltage measurement. The full list of queries is in the command reference on this page, grouped by subsystem.

Can I automate the Keysight B2901C 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 Keysight B2901C 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.