Vector Network Analyzer · SCPI command comparison

Anritsu MS2026C vs Keysight N9912A: SCPI commands and remote control compared

In TestFlow's instrument library, the Anritsu MS2026C takes 29 SCPI commands, 6 of them queries, and the Keysight N9912A takes 51 SCPI commands, 13 of them queries. That is 22 more on the N9912A. Counting distinct command headers (the command path without its arguments), 18 are accepted by both, 6 exist only on the MS2026C, and 27 only on the N9912A. 75% of the MS2026C's command headers also exist on the N9912A.

Both libraries have commands under SENSe, CALCulate, INITiate, SOURce, and SYSTem. Only the N9912A has DISPlay, MMEMory, and TRIGger.

Both libraries synchronise with *OPC?. Only the N9912A library has an error-queue read (SYSTem:ERRor?); the MS2026C library has none.

TestFlow's library gives the MS2027C, MS2028C, MS2036C, MS2037C, and MS2038C the same command set as the MS2026C, so the MS2026C column applies to them too. TestFlow's library gives the N9913A, N9914A, N9915A, N9916A, N9917A, N9918A, N9923A, N9925A, N9926A, N9927A, and N9928A the same command set as the N9912A, so the N9912A column applies to them too.

MS2026C commands
29
N9912A commands
51
Shared headers
18
Unique headers
33

Run this on your bench

Describe the test; TestFlow's agent uses these command sets to drive your Anritsu MS2026C or Keysight N9912A and writes the report from the measured results.

Get started

MS2026C vs N9912A at a glance

Counts come from TestFlow's instrument library, the command sets its AI agent uses to drive each instrument. A distinct command header is the command path without its arguments, so :OUTPut ON and :OUTPut OFF count once.

Anritsu MS2026CKeysight N9912A
Commands in TestFlow's library2951
Queries (read a value or state)613
Settings and actions2338
Subsystems912
Distinct command headers2445
Headers the other lacks627
Command languageSCPISCPI
Operation complete*OPC?*OPC?
Error queueNot in librarySYSTem:ERRor?
Models on this command setMS2026C, MS2027C, MS2028C, MS2036C, MS2037C, MS2038CN9912A, N9913A, N9914A, N9915A, N9916A, N9917A, N9918A, N9923A, N9925A, N9926A, N9927A, N9928A

Commands both accept

18 command headers are in both libraries. Here are 12, taken across subsystems. Where the N9912A library writes the command differently, its form is shown under the MS2026C's.

CommandWhat it does
:SENSe:FREQuency:STARt <Frequency>Set Start Freq. Sets the sweep start frequency in Hz.
:CALCulate<Trace>:FORMat <Format>N9912A: CALCulate:FORMat <Format>Set Format. Sets the display format of the active trace.
:INITiate:CONTinuous ONContinuous On. Enables continuous sweeping.
:SOURce:POWer <Power>Set Power Level. Sets the source output power level in dBm.
:SYSTem:PRESetPreset. Presets the instrument to default state.
*IDN?Identify. Returns the instrument identification string (manufacturer, model, serial, firmware).
:SENSe:FREQuency:STOP <Frequency>Set Stop Freq. Sets the sweep stop frequency in Hz.
:CALCulate:MARKer<Marker>:X <Frequency>Set Marker X. Sets the marker stimulus position in Hz.
:INITiate:IMMediateTrigger Single. Triggers a single sweep.
*RSTReset. Resets the instrument to its default state.
:SENSe:FREQuency:CENTer <Frequency>Set Center Freq. Sets the sweep center frequency in Hz.
:CALCulate:MARKer<Marker>:Y?Read Marker Y. Returns the marker response value.

Only on the Anritsu MS2026C

6 command headers in the MS2026C library have no match in the N9912A library. Below are 6 of them from the 3 largest subsystems; the full list is in the Anritsu MS2026C command reference.

SENSe (3 only on the MS2026C)

CommandWhat it does
:SENSe:SWEep:IFBW <Bandwidth>Set IF Bandwidth. Sets the IF bandwidth in Hz.
:SENSe:TRACe<Trace>:SELectSet Active Trace. Selects the active trace number.
:SENSe:TRACe<Trace>:SPARams <Parameter>Define Measurement. Assigns an S-parameter to the active trace.

CALCulate (2 only on the MS2026C)

CommandWhat it does
:CALCulate<Trace>:DATA? FDATaRead Formatted Data. Returns the formatted trace data array.
:CALCulate:MARKer<Marker>:TYPE REFerenceMarker On. Turns on the specified marker.

INITiate (1 only on the MS2026C)

CommandWhat it does
:INITiate:HOLD ONHold. Holds (stops) the current sweep.

Only on the Keysight N9912A

27 command headers in the N9912A library have no match in the MS2026C library. Below are 17 of them from the 6 largest subsystems; the full list is in the Keysight N9912A command reference.

CALCulate (10 only on the N9912A)

CommandWhat it does
CALCulate:PARameter<Trace>:DEFine <Parameter>Define Measurement. Creates a new measurement trace with the given name and S-parameter.
CALCulate:PARameter<Number>:SELectSelect By Number. Selects the active measurement by its trace number.
CALCulate:FORMat?Read Format. Returns the display/data format of the selected trace.
CALCulate:DATA:FDATa?Read Formatted Data. Returns the formatted trace data array for the selected measurement.

SENSe (6 only on the N9912A)

CommandWhat it does
SENSe:SWEep:POINts?Read Points. Returns the number of measurement points per sweep.
SENSe:SWEep:TIME <Seconds>Set Sweep Time. Sets the sweep time in seconds.
SENSe:BANDwidth <Bandwidth>Set IF Bandwidth. Sets the IF (resolution) bandwidth in Hz.
SENSe:BANDwidth?Read IF Bandwidth. Returns the current IF bandwidth in Hz.

DISPlay (3 only on the N9912A)

CommandWhat it does
DISPlay:WINDow:TRACe:Y:SCALe:AUTOAutoscale. Autoscales the active trace to fit the display.
DISPlay:WINDow:TRACe:Y:SCALe:PDIVision <Per_Div>Set Y Scale. Sets the vertical scale per division for the active trace.
DISPlay:WINDow:TRACe:Y:SCALe:RLEVel <Level>Set Ref Level. Sets the reference level for the active trace.

MMEMory (3 only on the N9912A)

CommandWhat it does
MMEMory:STORe:STATe '<Filename>'Save State. Saves the instrument state/data to the named file.
MMEMory:LOAD:STATe '<Filename>'Recall State. Recalls an instrument state from the named file.
MMEMory:STORe:IMAGe '<Filename>'Save Screenshot. Saves a screenshot image to the named file.

IEEE 488.2 common (*) (2 only on the N9912A)

CommandWhat it does
*CLSClear Status. Clears all event registers and the error queue.
*WAIWait To Continue. Waits until all pending operations are complete before continuing.

SOURce (1 only on the N9912A)

CommandWhat it does
SOURce:POWer?Read Power Level. Returns the source output power level in dBm.

Control both from Python

With PyVISA and any VISA backend, this opens both instruments, identifies them, sends one setting, and reads one value from each. For the setting, both libraries hold :CALCulate<Trace>:FORMat (set format); the N9912A library writes it as CALCulate:FORMat MLOGarithmic. For the reading, both libraries hold :SENSe:FREQuency:STARt? (read start freq), and the same line runs on each. For the basics, see the PyVISA tutorial.

import pyvisa

rm = pyvisa.ResourceManager()
print(rm.list_resources())  # find both VISA addresses

a = rm.open_resource("PASTE_MS2026C_ADDRESS")  # Anritsu MS2026C
b = rm.open_resource("PASTE_N9912A_ADDRESS")  # Keysight N9912A
for inst in (a, b):
    inst.timeout = 5000  # ms
    print(inst.query("*IDN?"))

# The same setting on both: Set Format
a.write(":CALCulate1-4:FORMat LMAGnitude")
b.write("CALCulate:FORMat MLOGarithmic")

# The same reading on both: Read Start Freq
print(a.query(":SENSe:FREQuency:STARt?"))
print(b.query("SENSe:FREQuency:STARt?"))

a.close()
b.close()

Run this on your bench

Describe the test; TestFlow's agent uses these command sets to drive your Anritsu MS2026C or Keysight N9912A and writes the report from the measured results.

Get started

Frequently asked questions

What is the difference between the Anritsu MS2026C and the Keysight N9912A for remote control?

In TestFlow's library the MS2026C has 29 SCPI commands and the N9912A has 51 SCPI commands. 18 command headers are common to both, 6 are only on the MS2026C (mostly SENSe and CALCulate), and 27 are only on the N9912A (mostly CALCulate and SENSe).

Can I use the same SCPI code for the Anritsu MS2026C and the Keysight N9912A?

Partly. 18 command headers are accepted by both, including :SENSe:FREQuency:STARt, :CALCulate<Trace>:FORMat, and :INITiate:CONTinuous. 33 are not, for example :SENSe:SWEep:IFBW on the MS2026C and CALCulate:PARameter<Trace>:DEFine on the N9912A, so a script that uses those needs a separate branch for each instrument.

Which has more remote commands, the MS2026C or the N9912A?

The N9912A: 29 commands for the MS2026C against 51 for the N9912A in TestFlow's library. Of those, 6 on the MS2026C and 13 on the N9912A are queries that read a value or state, and the library splits them into 9 and 12 subsystems.

How do the MS2026C and N9912A signal operation complete and report errors?

Both libraries synchronise with *OPC?. Only the N9912A library has an error-queue read (SYSTem:ERRor?); the MS2026C library has none. Each command named here is listed in the tables on this page and on each instrument's command reference.

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.