Vector Network Analyzer · SCPI command comparison

Anritsu MS4642A vs Keysight E5061B: SCPI commands and remote control compared

In TestFlow's instrument library, the Anritsu MS4642A takes 58 SCPI commands, 14 of them queries, and the Keysight E5061B takes 58 SCPI commands, 14 of them queries. The two libraries are the same size, but they do not hold the same commands. Counting distinct command headers (the command path without its arguments), 39 are accepted by both, 10 exist only on the MS4642A, and 10 only on the E5061B. 80% of the MS4642A's command headers also exist on the E5061B.

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

Both libraries synchronise with *OPC?. Both libraries read errors with SYSTem:ERRor?.

TestFlow's library gives the MS4642B, MS4644A, MS4644B, MS4645A, MS4647A, and MS4647B the same command set as the MS4642A, so the MS4642A column applies to them too.

MS4642A commands
58
E5061B commands
58
Shared headers
39
Unique headers
20

Run this on your bench

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

Get started

MS4642A vs E5061B 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 MS4642AKeysight E5061B
Commands in TestFlow's library5858
Queries (read a value or state)1414
Settings and actions4444
Subsystems1113
Distinct command headers4949
Headers the other lacks1010
Command languageSCPISCPI
Operation complete*OPC?*OPC?
Error queueSYSTem:ERRor?SYSTem:ERRor?
Models on this command setMS4642A, MS4642B, MS4644A, MS4644B, MS4645A, MS4647A, MS4647BE5061B

Commands both accept

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

CommandWhat it does
SENSe:FREQuency:STARt <Frequency>Set Start Freq. Sets the sweep start frequency in Hz.
CALCulate:PARameter<Trace>:DEFine <Parameter>Define Measurement. Creates a new measurement trace with the given name and S-parameter.
SYSTem:PRESetPreset. Presets the analyzer to its default measurement state.
MMEMory:STORe '<Filename>'Save State. Saves the instrument state/data to the named file.
TRIGger:SOURce <Source>Set Trigger Source. Sets the trigger source for the sweep.
*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:PARameter<Trace>:SELectE5061B: CALCulate:PARameter<Number>:SELectSelect By Number. Selects the active measurement by its trace number.
SYSTem:ERRor?Read Error. Reads the next message from the error queue.
MMEMory:LOAD '<Filename>'Recall State. Recalls an instrument state from the named file.
*RSTReset. Resets the instrument to its default state.
SENSe:FREQuency:CENTer <Frequency>Set Center Freq. Sets the sweep center frequency in Hz.

Only on the Anritsu MS4642A

10 command headers in the MS4642A library have no match in the E5061B library. Below are 10 of them from the 6 largest subsystems; the full list is in the Anritsu MS4642A command reference.

DISPlay (3 only on the MS4642A)

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

SENSe (2 only on the MS4642A)

CommandWhat it does
SENSe:SWEep:TYPe <Type>Set Sweep Type. Sets the sweep type (linear, log, segment, power, or CW).
SENSe:HOLD:FUNCtion CONTinuousContinuous On. Enables continuous (free-run) triggering.

SOURce (2 only on the MS4642A)

CommandWhat it does
SOURce:POWer:PORT<Port> <Power>Set Power Level. Sets the source output power level in dBm.
SOURce:POWer:PORT<Port>?Read Power Level. Returns the source output power level in dBm.

CALCulate (1 only on the MS4642A)

CommandWhat it does
CALCulate:MARKer<Marker>:ACTivate ; ...Marker Search Max. Moves the marker to the trace maximum.

SYSTem (1 only on the MS4642A)

CommandWhat it does
SYSTem:HOLD:RF ONRF Power On. Turns the RF source power output on.

TRIGger (1 only on the MS4642A)

CommandWhat it does
TRIGger:SINGleTrigger Single. Triggers a single sweep when not in continuous mode.

Only on the Keysight E5061B

10 command headers in the E5061B library have no match in the MS4642A library. Below are 10 of them from the 6 largest subsystems; the full list is in the Keysight E5061B command reference.

DISPlay (3 only on the E5061B)

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.

INITiate (2 only on the E5061B)

CommandWhat it does
INITiate:CONTinuous ONContinuous On. Enables continuous (free-run) triggering.
INITiate:IMMediateTrigger Single. Triggers a single sweep when not in continuous mode.

SOURce (2 only on the E5061B)

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

CALCulate (1 only on the E5061B)

CommandWhat it does
CALCulate:MARKer<Marker>:FUNCtion:TYPE MAXimum ; ...Marker Search Max. Moves the marker to the trace maximum.

OUTPut (1 only on the E5061B)

CommandWhat it does
OUTPut:STATe ONRF Power On. Turns the RF source power output on.

SENSe (1 only on the E5061B)

CommandWhat it does
SENSe:SWEep:TYPE <Type>Set Sweep Type. Sets the sweep type (linear, log, segment, power, or CW).

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 SENSe:AVERage:STATe (average on), and the same line runs on each. 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_MS4642A_ADDRESS")  # Anritsu MS4642A
b = rm.open_resource("PASTE_E5061B_ADDRESS")  # Keysight E5061B
for inst in (a, b):
    inst.timeout = 5000  # ms
    print(inst.query("*IDN?"))

# The same setting on both: Average On
a.write("SENSe:AVERage:STATe ON")
b.write("SENSe:AVERage:STATe ON")

# 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 MS4642A or Keysight E5061B and writes the report from the measured results.

Get started

Frequently asked questions

What is the difference between the Anritsu MS4642A and the Keysight E5061B for remote control?

In TestFlow's library the MS4642A has 58 SCPI commands and the E5061B has 58 SCPI commands. 39 command headers are common to both, 10 are only on the MS4642A (mostly DISPlay and SENSe), and 10 are only on the E5061B (mostly DISPlay and INITiate).

Can I use the same SCPI code for the Anritsu MS4642A and the Keysight E5061B?

Partly. 39 command headers are accepted by both, including SENSe:FREQuency:STARt, CALCulate:PARameter<Trace>:DEFine, and SYSTem:PRESet. 20 are not, for example DISPlay:WINDow:TRACe:Y:AUTO on the MS4642A and DISPlay:WINDow:TRACe:Y:SCALe:AUTO on the E5061B, so a script that uses those needs a separate branch for each instrument.

Which has more remote commands, the MS4642A or the E5061B?

Neither: both have 58 commands in TestFlow's library. Of those, 14 on the MS4642A and 14 on the E5061B are queries that read a value or state, and the library splits them into 11 and 13 subsystems.

How do the MS4642A and E5061B signal operation complete and report errors?

Both libraries synchronise with *OPC?. Both libraries read errors with SYSTem:ERRor?. 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.