Spectrum Analyzer · SCPI command comparison

Keysight E4440A vs N9020B: SCPI commands and remote control compared

In TestFlow's instrument library, the Keysight E4440A takes 86 SCPI commands, 20 of them queries, and the Keysight N9020B takes 103 SCPI commands, 22 of them queries. That is 17 more on the N9020B. Counting distinct command headers (the command path without its arguments), 70 are accepted by both, 4 exist only on the E4440A, and 17 only on the N9020B. 95% of the E4440A's command headers also exist on the N9020B.

Both libraries have commands under SENSe, CALCulate, DISPlay, INITiate, CONFigure, READ, TRACe, and TRIGger, plus 7 more roots. Neither has a command root the other lacks: the differences are inside shared subsystems.

Both libraries synchronise with *OPC?. Neither library has an error-queue read such as SYSTem:ERRor?.

TestFlow's library gives the E4443A, E4445A, E4446A, E4447A, and E4448A the same command set as the E4440A, so the E4440A column applies to them too. TestFlow's library gives the N9021B, N9030B, N9038A, N9040B, N9041B, and N9048B the same command set as the N9020B, so the N9020B column applies to them too.

E4440A commands
86
N9020B commands
103
Shared headers
70
Unique headers
21

Run this on your bench

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

Get started

E4440A vs N9020B 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.

Keysight E4440AKeysight N9020B
Commands in TestFlow's library86103
Queries (read a value or state)2022
Settings and actions6681
Subsystems1919
Distinct command headers7487
Headers the other lacks417
Command languageSCPISCPI
Operation complete*OPC?*OPC?
Error queueNot in libraryNot in library
Models on this command setE4440A, E4443A, E4445A, E4446A, E4447A, E4448AN9020B, N9021B, N9030B, N9038A, N9040B, N9041B, N9048B

Commands both accept

70 command headers are in both libraries. Here are 12, taken across subsystems.

CommandWhat it does
:SENSe:FREQuency:CENTer <Frequency>Set Center Freq. Sets the center frequency of the displayed span in Hz.
:CALCulate:MARKer<MkrNum>:STATe ONMarker On. Turns on the specified marker.
:DISPlay:WINDow:TRACe:Y:SCALe:RLEVel <Level>Set Ref Level. Sets the reference level (top of the display grid) in the current Y units.
:INITiate:CONTinuous ONContinuous Sweep On. Sets the analyzer to continuous (free-run) sweep mode.
:CONFigure:CHPowerConfig Channel Power. Configures the analyzer for the Channel Power (CHP) measurement.
:READ:CHPower?Read Channel Power. Initiates and reads the channel power and power-spectral-density result.
:TRACe:DATA? <TraceName>Read Trace Data. Reads back the amplitude data points of the specified trace.
:TRIGger:SOURce <Source>Set Trigger Source. Selects the sweep trigger source.
:INSTrument:SELect SASelect SA Mode. Selects the basic Spectrum Analyzer measurement personality.
:UNIT:POWer <Units>Set Y Units. Sets the amplitude (Y-axis) units for power readouts.
:ABORtAbort. Aborts the current sweep or measurement in progress.
:INPut:COUPling <Coupling>Set Input Coupling. Sets the RF input coupling to AC or DC.

Only on the Keysight E4440A

4 command headers in the E4440A library have no match in the N9020B library. Below are 4 of them from the 4 largest subsystems; the full list is in the Keysight E4440A command reference.

DISPlay (1 only on the E4440A)

CommandWhat it does
:DISPlay:WINDow:TRACe:Y:SCALe:SPACing <Spacing>Set Y Scale Type. Sets the vertical scale to logarithmic or linear.

FORMat (1 only on the E4440A)

CommandWhat it does
:FORMat:DATA <Format>Set Trace Format. Sets the numeric data format used when transferring trace data.

SENSe (1 only on the E4440A)

CommandWhat it does
:SENSe:DETector:FUNCtion <Detector>Set Detector. Sets the detector type used to reduce sweep data to trace points.

TRACe (1 only on the E4440A)

CommandWhat it does
:TRACe<TraceNum>:MODE <TraceMode>Set Trace Mode. Sets the update mode for the specified trace (clear-write/max-hold/min-hold/view/blank).

Only on the Keysight N9020B

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

CALCulate (6 only on the N9020B)

CommandWhat it does
:CALCulate:MARKer<MkrNum>:MAXimum:LEFTMarker Peak Left. Moves the specified marker to the next peak to the left.
:CALCulate:MARKer<MkrNum>:MAXimum:RIGHtMarker Peak Right. Moves the specified marker to the next peak to the right.
:CALCulate:MARKer<MkrNum>:FUNCtion:BAND:SPAN <Span>Set Marker Band Span. Sets the integration bandwidth (band span) for the marker band power function.
:CALCulate:MARKer:PEAK:TABLe:STATe ONPeak Table On. Turns on the peak table display listing detected signal peaks.

SENSe (3 only on the N9020B)

CommandWhat it does
:SENSe:DETector:TRACe <Detector>Set Detector. Sets the detector type used to reduce sweep data to trace points.
:SENSe:CORRection:IMPedance:INPut:MAGNitude <Impedance>Set Input Impedance. Sets the input impedance reference (50 or 75 ohms) for amplitude correction.
:SENSe:CORRection:SA:GAIN <Gain>Set Ext Gain. Sets an external gain/loss correction value applied to displayed amplitudes in dB.

CONFigure (2 only on the N9020B)

CommandWhat it does
:CONFigure:TOIConfig TOI. Configures the analyzer for the third-order intercept (TOI) measurement.
:CONFigure:HARMonicsConfig Harmonics. Configures the analyzer for the harmonic distortion measurement.

READ (2 only on the N9020B)

CommandWhat it does
:READ:TOI?Read TOI. Initiates and reads the third-order intercept measurement results.
:READ:HARMonics:DISTortion?Read Harmonics. Initiates and reads the total harmonic distortion result.

TRACe (2 only on the N9020B)

CommandWhat it does
:TRACe<TraceNum>:TYPE <TraceType>Set Trace Type. Sets the update type for the specified trace (clear-write/average/max-hold/min-hold).
:TRACe<TraceNum>:UPDate:STATe ONSet Trace Update On. Enables live updating of the specified trace.

DISPlay (1 only on the N9020B)

CommandWhat it does
:DISPlay:ENABle ONDisplay All On. Turns the front-panel display update on.

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:FREQuency:SPAN:FULL (set full span), and the same line runs on each. For the reading, both libraries hold :READ:CHPower? (read channel power), 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_E4440A_ADDRESS")  # Keysight E4440A
b = rm.open_resource("PASTE_N9020B_ADDRESS")  # Keysight N9020B
for inst in (a, b):
    inst.timeout = 5000  # ms
    print(inst.query("*IDN?"))

# The same setting on both: Set Full Span
a.write(":SENSe:FREQuency:SPAN:FULL")
b.write(":SENSe:FREQuency:SPAN:FULL")

# The same reading on both: Read Channel Power
print(a.query(":READ:CHPower?"))
print(b.query(":READ:CHPower?"))

a.close()
b.close()

Run this on your bench

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

Get started

Frequently asked questions

What is the difference between the Keysight E4440A and the Keysight N9020B for remote control?

In TestFlow's library the E4440A has 86 SCPI commands and the N9020B has 103 SCPI commands. 70 command headers are common to both, 4 are only on the E4440A (mostly DISPlay and FORMat), and 17 are only on the N9020B (mostly CALCulate and SENSe).

Can I use the same SCPI code for the Keysight E4440A and the Keysight N9020B?

Partly. 70 command headers are accepted by both, including :SENSe:FREQuency:CENTer, :CALCulate:MARKer<MkrNum>:STATe, and :DISPlay:WINDow:TRACe:Y:SCALe:RLEVel. 21 are not, for example :DISPlay:WINDow:TRACe:Y:SCALe:SPACing on the E4440A and :CALCulate:MARKer<MkrNum>:MAXimum:LEFT on the N9020B, so a script that uses those needs a separate branch for each instrument.

Which has more remote commands, the E4440A or the N9020B?

The N9020B: 86 commands for the E4440A against 103 for the N9020B in TestFlow's library. Of those, 20 on the E4440A and 22 on the N9020B are queries that read a value or state, and the library splits them into 19 and 19 subsystems.

How do the E4440A and N9020B signal operation complete and report errors?

Both libraries synchronise with *OPC?. Neither library has an error-queue read such as 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.