Source Meter · SCPI command reference

Keysight B2962B SCPI commands

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

Commands
91
Queries
18
Subsystems
14
Models covered
1

Run this on your bench

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

Get started

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

# Paste the address of your Keysight B2962B (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 CH1
print(inst.query(":MEASure:VOLTage? (@1)"))  # Measure Voltage CH1

inst.close()

Run this on your bench

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

Get started

Run a B2962B test without writing code

Describe the test in a sentence, for example “turn on ch1 on the B2962B, then measure voltage ch1 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

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

Source (SOURce) (26)

CommandWhat it doesArguments
:SOURce1:FUNCtion:MODE <Function>Set Source Function CH1. Sets the source function of the channel to voltage or current mode.Text: VOLTage,CURRent
:SOURce1:FUNCtion:MODE?Read Source Function CH1. Reads the present source function of the channel.None
:SOURce1:VOLTage <Voltage>Set Voltage Source CH1. Sets the output voltage level in volts when in voltage source mode.Number
:SOURce1:CURRent <Amp>Set Current Source CH1. Sets the output current level in amps when in current source mode.Number
:SOURce1:VOLTage:RANGe <Range>Set Source Voltage Range CH1. Sets the source voltage range in volts.Number
:SOURce1:CURRent:RANGe <Range>Set Source Current Range CH1. Sets the source current range in amps.Number
:SOURce1:VOLTage:RANGe:AUTO ONSource Voltage Autorange On CH1. Enables source voltage autorange on the channel.None
:SOURce1:VOLTage:RANGe:AUTO OFFSource Voltage Autorange Off CH1. Disables source voltage autorange on the channel.None
:SOURce1:VOLTage:MODE FIXedSet Source Mode Fixed CH1. Sets the source to fixed (DC) output mode.None
:SOURce1:VOLTage:MODE SWEepSet Source Mode Sweep CH1. Sets the source to sweep output mode.None
:SOURce1:VOLTage:STARt <Voltage>Set Sweep Start CH1. Sets the sweep start voltage in volts.Number
:SOURce1:VOLTage:STOP <Voltage>Set Sweep Stop CH1. Sets the sweep stop voltage in volts.Number
:SOURce1:SWEep:POINts <Points>Set Sweep Points CH1. Sets the number of points in the sweep.Number
:SOURce2:FUNCtion:MODE <Function>Set Source Function CH2. Sets the source function of the channel to voltage or current mode.Text: VOLTage,CURRent
:SOURce2:FUNCtion:MODE?Read Source Function CH2. Reads the present source function of the channel.None
:SOURce2:VOLTage <Voltage>Set Voltage Source CH2. Sets the output voltage level in volts when in voltage source mode.Number
:SOURce2:CURRent <Amp>Set Current Source CH2. Sets the output current level in amps when in current source mode.Number
:SOURce2:VOLTage:RANGe <Range>Set Source Voltage Range CH2. Sets the source voltage range in volts.Number
:SOURce2:CURRent:RANGe <Range>Set Source Current Range CH2. Sets the source current range in amps.Number
:SOURce2:VOLTage:RANGe:AUTO ONSource Voltage Autorange On CH2. Enables source voltage autorange on the channel.None
:SOURce2:VOLTage:RANGe:AUTO OFFSource Voltage Autorange Off CH2. Disables source voltage autorange on the channel.None
:SOURce2:VOLTage:MODE FIXedSet Source Mode Fixed CH2. Sets the source to fixed (DC) output mode.None
:SOURce2:VOLTage:MODE SWEepSet Source Mode Sweep CH2. Sets the source to sweep output mode.None
:SOURce2:VOLTage:STARt <Voltage>Set Sweep Start CH2. Sets the sweep start voltage in volts.Number
:SOURce2:VOLTage:STOP <Voltage>Set Sweep Stop CH2. Sets the sweep stop voltage in volts.Number
:SOURce2:SWEep:POINts <Points>Set Sweep Points CH2. Sets the number of points in the sweep.Number

Sense (SENSe) (24)

CommandWhat it doesArguments
:SENSe1:VOLTage:PROTection <Voltage>Set Voltage Compliance CH1. Sets the voltage compliance (limit) in volts.Number
:SENSe1:CURRent:PROTection <Amp>Set Current Compliance CH1. Sets the current compliance (limit) in amps.Number
:SENSe1:FUNCtion:ON "VOLTage"Set Sense Function Voltage CH1. Enables voltage as a measurement function on the channel.None
:SENSe1:FUNCtion:ON "CURRent"Set Sense Function Current CH1. Enables current as a measurement function on the channel.None
:SENSe1:FUNCtion:ON "RESistance"Set Sense Function Resistance CH1. Enables resistance as a measurement function on the channel.None
:SENSe1:VOLTage:RANGe <Range>Set Voltage Sense Range CH1. Sets the voltage measurement range in volts.Number
:SENSe1:CURRent:RANGe <Range>Set Current Sense Range CH1. Sets the current measurement range in amps.Number
:SENSe1:VOLTage:RANGe:AUTO ONVoltage Sense Autorange On CH1. Enables voltage measurement autorange on the channel.None
:SENSe1:VOLTage:RANGe:AUTO OFFVoltage Sense Autorange Off CH1. Disables voltage measurement autorange on the channel.None
:SENSe1:CURRent:NPLCycles <Cycles>Set NPLC CH1. Sets the integration time in power line cycles for the channel.Number
:SENSe1:REMote ONSet Four Wire On CH1. Enables 4-wire (remote sense) measurement on the channel.None
:SENSe1:REMote OFFSet Four Wire Off CH1. Disables 4-wire sense on the channel (uses 2-wire).None
:SENSe2:VOLTage:PROTection <Voltage>Set Voltage Compliance CH2. Sets the voltage compliance (limit) in volts.Number
:SENSe2:CURRent:PROTection <Amp>Set Current Compliance CH2. Sets the current compliance (limit) in amps.Number
:SENSe2:FUNCtion:ON "VOLTage"Set Sense Function Voltage CH2. Enables voltage as a measurement function on the channel.None
:SENSe2:FUNCtion:ON "CURRent"Set Sense Function Current CH2. Enables current as a measurement function on the channel.None
:SENSe2:FUNCtion:ON "RESistance"Set Sense Function Resistance CH2. Enables resistance as a measurement function on the channel.None
:SENSe2:VOLTage:RANGe <Range>Set Voltage Sense Range CH2. Sets the voltage measurement range in volts.Number
:SENSe2:CURRent:RANGe <Range>Set Current Sense Range CH2. Sets the current measurement range in amps.Number
:SENSe2:VOLTage:RANGe:AUTO ONVoltage Sense Autorange On CH2. Enables voltage measurement autorange on the channel.None
:SENSe2:VOLTage:RANGe:AUTO OFFVoltage Sense Autorange Off CH2. Disables voltage measurement autorange on the channel.None
:SENSe2:CURRent:NPLCycles <Cycles>Set NPLC CH2. Sets the integration time in power line cycles for the channel.Number
:SENSe2:REMote ONSet Four Wire On CH2. Enables 4-wire (remote sense) measurement on the channel.None
:SENSe2:REMote OFFSet Four Wire Off CH2. Disables 4-wire sense on the channel (uses 2-wire).None

Output (OUTPut) (12)

CommandWhat it doesArguments
:OUTPut1 ONTurn On CH1. Enables the output of channel 1.None
:OUTPut1 OFFTurn Off CH1. Disables the output of channel 1.None
:OUTPut1?Read Output State CH1. Reads whether the selected channel output is ON or OFF.None
:OUTPut1:OFF:MODE HIZSet Output Off Mode Himp CH1. Sets the output-off state to high impedance.None
:OUTPut1:OFF:MODE NORMalSet Output Off Mode Normal CH1. Sets the output-off state to normal.None
:OUTPut1:OFF:MODE ZEROSet Output Off Mode Zero CH1. Sets the output-off state to zero.None
:OUTPut2 ONTurn On CH2. Enables the output of channel 1.None
:OUTPut2 OFFTurn Off CH2. Disables the output of channel 1.None
:OUTPut2?Read Output State CH2. Reads whether the selected channel output is ON or OFF.None
:OUTPut2:OFF:MODE HIZSet Output Off Mode Himp CH2. Sets the output-off state to high impedance.None
:OUTPut2:OFF:MODE NORMalSet Output Off Mode Normal CH2. Sets the output-off state to normal.None
:OUTPut2:OFF:MODE ZEROSet Output Off Mode Zero CH2. Sets the output-off state to zero.None

Measurement (MEASure) (6)

CommandWhat it doesArguments
:MEASure:VOLTage? (@1)Measure Voltage CH1. Triggers and returns the measured voltage in volts for the channel.None
:MEASure:CURRent? (@1)Measure Current CH1. Triggers and returns the measured current in amps for the channel.None
:MEASure:RESistance? (@1)Measure Resistance CH1. Triggers and returns the measured resistance in ohms for the channel.None
:MEASure:VOLTage? (@2)Measure Voltage CH2. Triggers and returns the measured voltage in volts for the channel.None
:MEASure:CURRent? (@2)Measure Current CH2. Triggers and returns the measured current in amps for the channel.None
:MEASure:RESistance? (@2)Measure Resistance CH2. Triggers and returns the measured resistance in ohms for the channel.None

Trigger (TRIGger) (4)

CommandWhat it doesArguments
:TRIGger1:COUNt <Count>Set Trigger Count CH1. Sets the number of triggers before returning to idle.Number
:TRIGger1:DELay <Seconds>Set Trigger Delay CH1. Sets the trigger delay in seconds.Number
:TRIGger2:COUNt <Count>Set Trigger Count CH2. Sets the number of triggers before returning to idle.Number
:TRIGger2:DELay <Seconds>Set Trigger Delay CH2. Sets the trigger delay in seconds.Number

Read (READ) (2)

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

Fetch (FETCh) (2)

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

Initiate (INITiate) (2)

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

Abort (2)

CommandWhat it doesArguments
:ABORt (@1)Abort CH1. Aborts the current operation on the channel and returns to idle.None
:ABORt (@2)Abort CH2. 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 B2962B 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 B2962B support SCPI remote control?

Yes. The Keysight B2962B accepts SCPI commands over its remote interfaces. TestFlow's instrument library holds 91 SCPI commands for it: 18 queries that read values or state, and 73 settings and actions.

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

:MEASure:VOLTage? (@1) (measure voltage ch1). 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 B2962B 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 B2962B 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.