Source Meter · SCPI command reference

Keysight B2901B and B2911B SCPI commands

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

Commands
61
Queries
15
Subsystems
16
Models covered
2

Run this on your bench

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

Get started

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

# Paste the address of your Keysight B2901B (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 this on your bench

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

Get started

Run a B2901B test without writing code

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

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

Source (SOURce) (14)

CommandWhat it doesArguments
:SOURce:FUNCtion:SHAPe <Function>Set Source Function. Sets the source output shape to DC or Pulse mode.Text: DC,PULSe
:SOURce:FUNCtion:MODE <Mode>Set Source Mode. Sets the source function mode to voltage or current sourcing.Text: VOLTage,CURRent
:SOURce:VOLTage:LEVel:IMMediate:AMPLitude <Voltage>Set Voltage. Sets the DC output voltage level in volts (range: -21 V to +21 V).Number
:SOURce:CURRent:LEVel:IMMediate:AMPLitude <Current>Set Current. Sets the DC output current level in amperes (range: -3 A to +3 A).Number
:SOURce:VOLTage:RANGe <Range>Set Voltage Range. Sets the voltage source output range in volts (0.2 V / 2 V / 20 V).Number: 0.2,2,20
:SOURce:CURRent:RANGe <Range>Set Current Range. Sets the current source output range in amperes.Number: 100e-9,1e-6,10e-6,100e-6,1e-3,10e-3,100e-3,1,3
:SOURce:VOLTage:RANGe:AUTO <State>Set Voltage Auto Range. Enables or disables auto-range for the voltage source output.Text: ON,OFF
:SOURce:CURRent:RANGe:AUTO <State>Set Current Auto Range. Enables or disables auto-range for the current source output.Text: ON,OFF
:SOURce:VOLTage:LEVel:TRIGgered:AMPLitude <Voltage>Set Triggered Voltage. Sets the triggered voltage source level applied on next trigger event.Number
:SOURce:CURRent:LEVel:TRIGgered:AMPLitude <Current>Set Triggered Current. Sets the triggered current source level applied on next trigger event.Number
:SOURce:<Function>:STARt <Value>Set Sweep Start. Sets the start value for a linear or log sweep on the selected source function.Text: VOLTage,CURRent; Number
:SOURce:<Function>:STOP <Value>Set Sweep Stop. Sets the stop value for a linear or log sweep on the selected source function.Text: VOLTage,CURRent; Number
:SOURce:<Function>:STEP <Value>Set Sweep Step. Sets the step size for a linear sweep on the selected source function.Text: VOLTage,CURRent; Number
:SOURce:<Function>:POINts <Points>Set Sweep Points. Sets the number of data points for the source sweep.Text: VOLTage,CURRent; Number

Sense (SENSe) (10)

CommandWhat it doesArguments
:SENSe:VOLTage:PROTection:LEVel <Voltage>Set Voltage Compliance. Sets the voltage compliance (protection) limit in volts when sourcing current.Number
:SENSe:CURRent:PROTection:LEVel <Current>Set Current Compliance. Sets the current compliance (protection) limit in amperes when sourcing voltage.Number
:SENSe:FUNCtion:ON "<Function>"Set Sense Function. Selects the measurement (sense) function.Text: VOLTage,CURRent,RESistance
:SENSe:VOLTage:RANGe:UPPer <Range>Set Sense Voltage Range. Sets the measurement range for voltage sensing in volts.Number: 0.2,2,20
:SENSe:CURRent:RANGe:UPPer <Range>Set Sense Current Range. Sets the measurement range for current sensing in amperes.Number: 100e-9,1e-6,10e-6,100e-6,1e-3,10e-3,100e-3,1,3
:SENSe:<Function>:RANGe:AUTO <State>Set Sense Auto Range. Enables or disables auto-range for the selected sense function.Text: VOLTage,CURRent,RESistance; Text: ON,OFF
:SENSe:<Function>:NPLCycles <NPLC>Set NPLC. Sets the integration time in number of power line cycles (NPLC) for the selected sense function.Text: VOLTage,CURRent,RESistance; Number: 0.01,0.1,1,10
:SENSe:<Function>:APERture <Seconds>Set Aperture. Sets the measurement aperture (integration time in seconds) for the selected sense function.Text: VOLTage,CURRent,RESistance; Number
:SENSe:REMote <State>Set Remote Sense. Enables or disables 4-wire (Kelvin) remote sensing mode.Text: ON,OFF
:SENSe:<Function>:PROTection:TRIPped?Check Compliance. Queries whether a compliance (protection) trip event has occurred on the selected function.Text: VOLTage,CURRent

Output (OUTPut) (6)

CommandWhat it doesArguments
:OUTPut ONTurn On. Enables the SMU output channel.None
:OUTPut OFFTurn Off. Disables the SMU output channel.None
:OUTPut:STATe?Read Output State. Queries and returns the current output state (0=OFF / 1=ON).None
:OUTPut:OFF:MODE <Mode>Set Output Off Mode. Sets the output terminal condition when the output is turned off.Text: NORMal,HIZ,ZERO
:OUTPut:LOW <State>Set Output Low. Sets the output LO terminal to ground or floating when output is off.Text: GROund,FLOat
:OUTPut:FILTer:LPASs:STATe <State>Set Output Filter. Enables or disables the output low-pass filter.Text: ON,OFF

Fetch (FETCh) (5)

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

Measurement (MEASure) (3)

CommandWhat it doesArguments
:MEASure:VOLTage?Measure Voltage. Triggers a measurement and returns the measured voltage in volts.None
:MEASure:CURRent?Measure Current. Triggers a measurement and returns the measured current in amperes.None
:MEASure:RESistance?Measure Resistance. Triggers a measurement and returns the measured resistance in ohms.None

Read (READ) (2)

CommandWhat it doesArguments
:READ:SCALar?Read Scalar. Triggers a single measurement and returns all enabled measurement data as a scalar result.None
:READ:ARRay?Read Array. Triggers a sweep measurement and returns all data points as an array.None

Trigger (TRIGger) (2)

CommandWhat it doesArguments
:TRIGger:COUNt <Count>Set Trigger Count. Sets the number of trigger events (measurement points) in a single measurement sequence.Number
:TRIGger:DELay <Seconds>Set Trigger Delay. Sets the time delay in seconds between the trigger event and the start of measurement.Number

Display (DISPlay) (2)

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

FORM subsystem (2)

CommandWhat it doesArguments
:FORMat:ELEMents:SENSe <Elements>Set Format Elements. Selects which data elements are included in the measurement data output string.Text: VOLTage,CURRent,RESistance,TIME,STATus,SOURce
:FORMat:DATA <Format>Set Data Format. Sets the output data format for measurement results (ASCII or binary).Text: ASCii

ARM subsystem (1)

CommandWhat it doesArguments
:ARM:COUNt <Count>Set Arm Count. Sets the number of times the trigger layer is executed per arm event.Number

Initiate (INITiate) (1)

CommandWhat it doesArguments
:INITiate:IMMediateInitiate Trigger. Initiates a measurement sequence by moving the instrument from idle to arm layer.None

Abort (1)

CommandWhat it doesArguments
:ABORtAbort Trigger. Aborts any in-progress measurement sequence and returns the instrument to idle state.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 (9)

CommandWhat it doesArguments
*SAV <Register>Save State. Saves the current instrument settings to non-volatile memory register (0 to 4).Number: 0,1,2,3,4
*RCL <Register>Recall State. Recalls and restores instrument settings from the specified non-volatile memory register.Number: 0,1,2,3,4
*IDN?Identify. Queries and returns the instrument identification string (manufacturer model serial firmware).None
*RSTReset. Resets the instrument to factory default settings and aborts any pending operations.None
*TST?Self Test. Executes the instrument self-test and returns 0 if passed or a non-zero error code if failed.None
*CAL?Self Calibration. Executes self-calibration and returns 0 if successful or a non-zero error code if failed.None
*CLSClear Status. Clears the event status registers and the error queue.None
*OPCOperation Complete. Sets the OPC bit in the Event Status Register when all pending operations are complete.None
*WAIWait For Complete. Prevents the instrument from executing further commands until all pending operations are complete.None

Where these commands come from

This reference is generated from TestFlow's instrument library, which is drafted from Keysight's programming documentation for the B2901B and B2911B 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 B2901B support SCPI remote control?

Yes. The Keysight B2901B accepts SCPI commands over its remote interfaces. TestFlow's instrument library holds 61 SCPI commands for it: 15 queries that read values or state, and 46 settings and actions.

How do I control the Keysight B2901B 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 Keysight B2901B?

:MEASure:VOLTage? (measure voltage). Triggers a measurement 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 Keysight B2901B 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 B2901B 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.