Source Meter · SCPI command reference

Keysight B2961B SCPI commands

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.

Get started

Control the Keysight B2961B 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 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.

Get started

Run a B2961B test without writing code

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.

Get started

SCPI command reference

51 commands in 14 groups. A ? marks a query that returns a value. Placeholders in angle brackets take the listed values.

Source (SOURce) (13)

CommandWhat it doesArguments
: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 ONSource Voltage Autorange On. Enables source voltage autorange on the channel.None
:SOURce1:VOLTage:RANGe:AUTO OFFSource Voltage Autorange Off. Disables source voltage autorange on the channel.None
:SOURce1:VOLTage:MODE FIXedSet Source Mode Fixed. Sets the source to fixed (DC) output mode.None
:SOURce1:VOLTage:MODE SWEepSet 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)

CommandWhat it doesArguments
: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 ONVoltage Sense Autorange On. Enables voltage measurement autorange on the channel.None
:SENSe1:VOLTage:RANGe:AUTO OFFVoltage 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 ONSet Four Wire On. Enables 4-wire (remote sense) measurement on the channel.None
:SENSe1:REMote OFFSet Four Wire Off. Disables 4-wire sense on the channel (uses 2-wire).None

Output (OUTPut) (6)

CommandWhat it doesArguments
:OUTPut1 ONTurn On. Enables the output of channel 1.None
:OUTPut1 OFFTurn 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 HIZSet Output Off Mode Himp. Sets the output-off state to high impedance.None
:OUTPut1:OFF:MODE NORMalSet Output Off Mode Normal. Sets the output-off state to normal.None
:OUTPut1:OFF:MODE ZEROSet Output Off Mode Zero. Sets the output-off state to zero.None

Measurement (MEASure) (3)

CommandWhat it doesArguments
: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)

CommandWhat it doesArguments
: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)

CommandWhat it doesArguments
:READ? (@1)Read Value. Triggers and returns one measurement for the channel.None

Fetch (FETCh) (1)

CommandWhat it doesArguments
:FETCh? (@1)Fetch Value. Returns the last measurement for the channel without re-triggering.None

Initiate (INITiate) (1)

CommandWhat it doesArguments
:INITiate (@1)Initiate. Places the channel in the wait-for-trigger state.None

Abort (1)

CommandWhat it doesArguments
:ABORt (@1)Abort. Aborts the current operation on the channel and returns to idle.None

System (SYSTem) (1)

CommandWhat it doesArguments
:SYSTem:ERRor?Read Error. Reads the first message from the error queue.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 (7)

CommandWhat it doesArguments
*IDN?Identify. Returns the instrument identification string (manufacturer, model, serial, firmware).None
*RSTReset. Resets the instrument to its default state.None
*CLSClear 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
*WAIWait To Continue. Waits until all pending operations are complete before continuing.None
*TRGTrigger 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.