The Keysight B2961B source meter is controlled remotely with SCPI commands. TestFlow's instrument library holds 51 commands for it, 11 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 B2961B on a real bench.
Commands
51
Queries
11
Subsystems
14
Models covered
1
Run this on your bench
Describe the test; TestFlow's agent uses this command set to drive your Keysight B2961B and writes the report from the measured results.
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 B2961B's VISA address
# Paste the address of your Keysight B2961B (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(":OUTPut1 ON") # Turn On
print(inst.query(":MEASure:VOLTage? (@1)")) # Measure Voltage
inst.close()
Run this on your bench
Describe the test; TestFlow's agent uses this command set to drive your Keysight B2961B and writes the report from the measured results.
Describe the test in a sentence, for example “turn on on the B2961B, 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.
51 commands in 14 groups. A ? marks a query that returns a value. Placeholders in angle brackets take the listed values.
Source (SOURce) (13)
Command
What it does
Arguments
:SOURce1:FUNCtion:MODE <Function>
Set Source Function. Sets the source function of the channel to voltage or current mode.
Text: VOLTage,CURRent
:SOURce1:FUNCtion:MODE?
Read Source Function. Reads the present source function of the channel.
None
:SOURce1:VOLTage <Voltage>
Set Voltage Source. Sets the output voltage level in volts when in voltage source mode.
Number
:SOURce1:CURRent <Amp>
Set Current Source. Sets the output current level in amps when in current source mode.
Number
:SOURce1:VOLTage:RANGe <Range>
Set Source Voltage Range. Sets the source voltage range in volts.
Number
:SOURce1:CURRent:RANGe <Range>
Set Source Current Range. Sets the source current range in amps.
Number
:SOURce1:VOLTage:RANGe:AUTO ON
Source Voltage Autorange On. Enables source voltage autorange on the channel.
None
:SOURce1:VOLTage:RANGe:AUTO OFF
Source Voltage Autorange Off. Disables source voltage autorange on the channel.
None
:SOURce1:VOLTage:MODE FIXed
Set Source Mode Fixed. Sets the source to fixed (DC) output mode.
None
:SOURce1:VOLTage:MODE SWEep
Set Source Mode Sweep. Sets the source to sweep output mode.
None
:SOURce1:VOLTage:STARt <Voltage>
Set Sweep Start. Sets the sweep start voltage in volts.
Number
:SOURce1:VOLTage:STOP <Voltage>
Set Sweep Stop. Sets the sweep stop voltage in volts.
Number
:SOURce1:SWEep:POINts <Points>
Set Sweep Points. Sets the number of points in the sweep.
Number
Sense (SENSe) (12)
Command
What it does
Arguments
:SENSe1:VOLTage:PROTection <Voltage>
Set Voltage Compliance. Sets the voltage compliance (limit) in volts.
Number
:SENSe1:CURRent:PROTection <Amp>
Set Current Compliance. Sets the current compliance (limit) in amps.
Number
:SENSe1:FUNCtion:ON "VOLTage"
Set Sense Function Voltage. Enables voltage as a measurement function on the channel.
None
:SENSe1:FUNCtion:ON "CURRent"
Set Sense Function Current. Enables current as a measurement function on the channel.
None
:SENSe1:FUNCtion:ON "RESistance"
Set Sense Function Resistance. Enables resistance as a measurement function on the channel.
None
:SENSe1:VOLTage:RANGe <Range>
Set Voltage Sense Range. Sets the voltage measurement range in volts.
Number
:SENSe1:CURRent:RANGe <Range>
Set Current Sense Range. Sets the current measurement range in amps.
Number
:SENSe1:VOLTage:RANGe:AUTO ON
Voltage Sense Autorange On. Enables voltage measurement autorange on the channel.
None
:SENSe1:VOLTage:RANGe:AUTO OFF
Voltage Sense Autorange Off. Disables voltage measurement autorange on the channel.
None
:SENSe1:CURRent:NPLCycles <Cycles>
Set NPLC. Sets the integration time in power line cycles for the channel.
Number
:SENSe1:REMote ON
Set Four Wire On. Enables 4-wire (remote sense) measurement on the channel.
None
:SENSe1:REMote OFF
Set Four Wire Off. Disables 4-wire sense on the channel (uses 2-wire).
None
Output (OUTPut) (6)
Command
What it does
Arguments
:OUTPut1 ON
Turn On. Enables the output of channel 1.
None
:OUTPut1 OFF
Turn Off. Disables the output of channel 1.
None
:OUTPut1?
Read Output State. Reads whether the selected channel output is ON or OFF.
None
:OUTPut1:OFF:MODE HIZ
Set Output Off Mode Himp. Sets the output-off state to high impedance.
None
:OUTPut1:OFF:MODE NORMal
Set Output Off Mode Normal. Sets the output-off state to normal.
None
:OUTPut1:OFF:MODE ZERO
Set Output Off Mode Zero. Sets the output-off state to zero.
None
Measurement (MEASure) (3)
Command
What it does
Arguments
:MEASure:VOLTage? (@1)
Measure Voltage. Triggers and returns the measured voltage in volts for the channel.
None
:MEASure:CURRent? (@1)
Measure Current. Triggers and returns the measured current in amps for the channel.
None
:MEASure:RESistance? (@1)
Measure Resistance. Triggers and returns the measured resistance in ohms for the channel.
None
Trigger (TRIGger) (2)
Command
What it does
Arguments
:TRIGger1:COUNt <Count>
Set Trigger Count. Sets the number of triggers before returning to idle.
Number
:TRIGger1:DELay <Seconds>
Set Trigger Delay. Sets the trigger delay in seconds.
Number
Read (READ) (1)
Command
What it does
Arguments
:READ? (@1)
Read Value. Triggers and returns one measurement for the channel.
None
Fetch (FETCh) (1)
Command
What it does
Arguments
:FETCh? (@1)
Fetch Value. Returns the last measurement for the channel without re-triggering.
None
Initiate (INITiate) (1)
Command
What it does
Arguments
:INITiate (@1)
Initiate. Places the channel in the wait-for-trigger state.
None
Abort (1)
Command
What it does
Arguments
:ABORt (@1)
Abort. Aborts the current operation on the channel and returns to idle.
None
System (SYSTem) (1)
Command
What it does
Arguments
:SYSTem:ERRor?
Read Error. Reads the first message from the error queue.
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 Keysight's programming documentation for the B2961B 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 June 18, 2026.
Frequently asked questions
Does the Keysight B2961B support SCPI remote control?
Yes. The Keysight B2961B accepts SCPI commands over its remote interfaces. TestFlow's instrument library holds 51 SCPI commands for it: 11 queries that read values or state, and 40 settings and actions.
How do I control the Keysight B2961B 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?, :OUTPut1 ON and :MEASure:VOLTage? (@1).
Which command reads a value from the Keysight B2961B?
:MEASure:VOLTage? (@1) (measure voltage). Triggers and returns the measured voltage in volts for the channel. The full list of queries is in the command reference on this page, grouped by subsystem.
Can I automate the Keysight B2961B 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 B2961B 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.