Vector Network Analyzer · SCPI command reference

Anritsu MS2026C, MS2027C, MS2028C, MS2036C, MS2037C, and MS2038C SCPI commands

The Anritsu MS2026C, MS2027C, MS2028C, MS2036C, MS2037C, and MS2038C vector network analyzer is controlled remotely with SCPI commands. TestFlow's instrument library holds 29 commands for it, 6 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 MS2026C on a real bench.

Commands
29
Queries
6
Subsystems
9
Models covered
6

Run this on your bench

Describe the test; TestFlow's agent uses this command set to drive your Anritsu MS2026C, MS2027C, MS2028C, MS2036C, MS2037C, or MS2038C and writes the report from the measured results.

Get started

Control the Anritsu MS2026C 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 Anritsu MS2026C's VISA address

# Paste the address of your Anritsu MS2026C (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(":SOURce:POWer LOW")  # Set Power Level
print(inst.query(":SENSe:FREQuency:STARt?"))  # Read Start Freq

inst.close()

Run this on your bench

Describe the test; TestFlow's agent uses this command set to drive your Anritsu MS2026C, MS2027C, MS2028C, MS2036C, MS2037C, or MS2038C and writes the report from the measured results.

Get started

Run a MS2026C test without writing code

Describe the test in a sentence, for example “set power level on the MS2026C, then read start freq 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

29 commands in 9 groups. A ? marks a query that returns a value. Placeholders in angle brackets take the listed values. The MS2026C, MS2027C, MS2028C, MS2036C, MS2037C, and MS2038C share this command set in TestFlow's library.

Sense (SENSe) (11)

CommandWhat it doesArguments
:SENSe:FREQuency:STARt <Frequency>Set Start Freq. Sets the sweep start frequency in Hz.Number
:SENSe:FREQuency:STOP <Frequency>Set Stop Freq. Sets the sweep stop frequency in Hz.Number
:SENSe:FREQuency:CENTer <Frequency>Set Center Freq. Sets the sweep center frequency in Hz.Number
:SENSe:FREQuency:SPAN <Frequency>Set Span Freq. Sets the sweep frequency span in Hz.Number
:SENSe:FREQuency:STARt?Read Start Freq. Returns the start frequency in Hz.None
:SENSe:FREQuency:STOP?Read Stop Freq. Returns the stop frequency in Hz.None
:SENSe:SWEep:POINts <Points>Set Points. Sets the number of data points per sweep.Number
:SENSe:SWEep:IFBW <Bandwidth>Set IF Bandwidth. Sets the IF bandwidth in Hz.Number: 10,20,50,100,200,500,1000,2000,5000,10000,20000,50000,100000
:SENSe:AVERage:COUNt <Count>Set Average Count. Sets the number of sweeps to average.Number
:SENSe:TRACe<Trace>:SELectSet Active Trace. Selects the active trace number.Number: 1-4
:SENSe:TRACe<Trace>:SPARams <Parameter>Define Measurement. Assigns an S-parameter to the active trace.Number: 1-4; Text: S11,S21,S12,S22

Calculate (CALCulate) (6)

CommandWhat it doesArguments
:CALCulate<Trace>:FORMat <Format>Set Format. Sets the display format of the active trace.Number: 1-4; Text: LMAGnitude,SWR,PHASe,REAL,IMAGinary,GDELay,SMITh,ISMith,LM/2,LINPolar,LOGPolar,RIMPedance,IIMPedance
:CALCulate<Trace>:DATA? FDATaRead Formatted Data. Returns the formatted trace data array.Number: 1-4
:CALCulate:MARKer<Marker>:TYPE REFerenceMarker On. Turns on the specified marker.Number: 1-12
:CALCulate:MARKer<Marker>:TYPE OFFMarker Off. Turns off the specified marker.Number: 1-12
:CALCulate:MARKer<Marker>:X <Frequency>Set Marker X. Sets the marker stimulus position in Hz.Number: 1,2,3,4,5,6; Number
:CALCulate:MARKer<Marker>:Y?Read Marker Y. Returns the marker response value.Number: 1,2,3,4,5,6

Initiate (INITiate) (4)

CommandWhat it doesArguments
:INITiate:CONTinuous ONContinuous On. Enables continuous sweeping.None
:INITiate:CONTinuous OFFContinuous Off. Stops continuous sweeping (hold).None
:INITiate:IMMediateTrigger Single. Triggers a single sweep.None
:INITiate:HOLD ONHold. Holds (stops) the current sweep.None

Source (SOURce) (1)

CommandWhat it doesArguments
:SOURce:POWer <Power>Set Power Level. Sets the source output power level in dBm.Text: LOW,HIGH

System (SYSTem) (1)

CommandWhat it doesArguments
:SYSTem:PRESetPreset. Presets the instrument to default 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 (3)

CommandWhat it doesArguments
*IDN?Identify. Returns the instrument identification string (manufacturer, model, serial, firmware).None
*RSTReset. Resets the instrument to its default state.None
*OPC?Operation Complete. Returns 1 when all pending operations are complete.None

Where these commands come from

This reference is generated from TestFlow's instrument library, which is drafted from Anritsu's programming documentation for the MS2026C, MS2027C, MS2028C, MS2036C, MS2037C, and MS2038C and checked when the agent runs it. Ranges, timing, and option-dependent commands are defined by Anritsu's programming manual: check it before you rely on an edge case. Last updated November 17, 2026.

Frequently asked questions

Does the Anritsu MS2026C support SCPI remote control?

Yes. The Anritsu MS2026C accepts SCPI commands over its remote interfaces. TestFlow's instrument library holds 29 SCPI commands for it: 6 queries that read values or state, and 23 settings and actions.

How do I control the Anritsu MS2026C 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?, :SOURce:POWer LOW and :SENSe:FREQuency:STARt?.

Which command reads a value from the Anritsu MS2026C?

:SENSe:FREQuency:STARt? (read start freq). Returns the start frequency in Hz. The full list of queries is in the command reference on this page, grouped by subsystem.

Can I automate the Anritsu MS2026C 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 Anritsu MS2026C 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.