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.
Describe the test; TestFlow's agent uses this command set to drive your Keysight B2962B 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 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()Describe the test; TestFlow's agent uses this command set to drive your Keysight B2962B and writes the report from the measured results.
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.
91 commands in 14 groups. A ? marks a query that returns a value. Placeholders in angle brackets take the listed values.
| Command | What it does | Arguments |
|---|---|---|
| :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 ON | Source Voltage Autorange On CH1. Enables source voltage autorange on the channel. | None |
| :SOURce1:VOLTage:RANGe:AUTO OFF | Source Voltage Autorange Off CH1. Disables source voltage autorange on the channel. | None |
| :SOURce1:VOLTage:MODE FIXed | Set Source Mode Fixed CH1. Sets the source to fixed (DC) output mode. | None |
| :SOURce1:VOLTage:MODE SWEep | Set 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 ON | Source Voltage Autorange On CH2. Enables source voltage autorange on the channel. | None |
| :SOURce2:VOLTage:RANGe:AUTO OFF | Source Voltage Autorange Off CH2. Disables source voltage autorange on the channel. | None |
| :SOURce2:VOLTage:MODE FIXed | Set Source Mode Fixed CH2. Sets the source to fixed (DC) output mode. | None |
| :SOURce2:VOLTage:MODE SWEep | Set 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 |
| Command | What it does | Arguments |
|---|---|---|
| :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 ON | Voltage Sense Autorange On CH1. Enables voltage measurement autorange on the channel. | None |
| :SENSe1:VOLTage:RANGe:AUTO OFF | Voltage 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 ON | Set Four Wire On CH1. Enables 4-wire (remote sense) measurement on the channel. | None |
| :SENSe1:REMote OFF | Set 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 ON | Voltage Sense Autorange On CH2. Enables voltage measurement autorange on the channel. | None |
| :SENSe2:VOLTage:RANGe:AUTO OFF | Voltage 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 ON | Set Four Wire On CH2. Enables 4-wire (remote sense) measurement on the channel. | None |
| :SENSe2:REMote OFF | Set Four Wire Off CH2. Disables 4-wire sense on the channel (uses 2-wire). | None |
| Command | What it does | Arguments |
|---|---|---|
| :OUTPut1 ON | Turn On CH1. Enables the output of channel 1. | None |
| :OUTPut1 OFF | Turn 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 HIZ | Set Output Off Mode Himp CH1. Sets the output-off state to high impedance. | None |
| :OUTPut1:OFF:MODE NORMal | Set Output Off Mode Normal CH1. Sets the output-off state to normal. | None |
| :OUTPut1:OFF:MODE ZERO | Set Output Off Mode Zero CH1. Sets the output-off state to zero. | None |
| :OUTPut2 ON | Turn On CH2. Enables the output of channel 1. | None |
| :OUTPut2 OFF | Turn 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 HIZ | Set Output Off Mode Himp CH2. Sets the output-off state to high impedance. | None |
| :OUTPut2:OFF:MODE NORMal | Set Output Off Mode Normal CH2. Sets the output-off state to normal. | None |
| :OUTPut2:OFF:MODE ZERO | Set Output Off Mode Zero CH2. Sets the output-off state to zero. | None |
| Command | What it does | Arguments |
|---|---|---|
| :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 |
| Command | What it does | Arguments |
|---|---|---|
| :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 |
| Command | What it does | Arguments |
|---|---|---|
| :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 |
| Command | What it does | Arguments |
|---|---|---|
| :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 |
| Command | What it does | Arguments |
|---|---|---|
| :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 |
| Command | What it does | Arguments |
|---|---|---|
| :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 |
| Command | What it does | Arguments |
|---|---|---|
| :SYSTem:ERRor? | Read Error. Reads the first message from the error queue. | None |
| Command | What it does | Arguments |
|---|---|---|
| <Output Variable>=<Equation> | Math. Variable equals an equation like (${Var_name}= ${Var_name}/2) | Number; Text |
| Command | What it does | Arguments |
|---|---|---|
| wait(<ms>) | Wait. Waits for number of milliseconds | Number |
| Command | What it does | Arguments |
|---|---|---|
| save2var <Variable_name> | Save2Variable. Saves last measurement to a variable | Text |
| 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 |
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.
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.
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).
: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.
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.
Describe the test. TestFlow builds the workflow, runs it on your instruments, and writes the report. See it on a bench like yours.