In TestFlow's instrument library, the Keysight N9000B takes 84 SCPI commands, 27 of them queries, and the Keysight N9020B takes 103 SCPI commands, 22 of them queries. That is 19 more on the N9020B. Counting distinct command headers (the command path without its arguments), 59 are accepted by both, 14 exist only on the N9000B, and 28 only on the N9020B. 81% of the N9000B's command headers also exist on the N9020B.
Both libraries have commands under SENSe, CALCulate, INITiate, CONFigure, DISPlay, TRACe, INSTrument, and TRIGger, plus 3 more roots. Only the N9000B has FETCh and SYSTem. Only the N9020B has FORMat, ABORt, INPut, and MMEMory.
Both libraries synchronise with *OPC?. Only the N9000B library has an error-queue read (SYSTem:ERRor?); the N9020B library has none.
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.
Describe the test; TestFlow's agent uses these command sets to drive your Keysight N9000B or Keysight N9020B and writes the report from the measured results.
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 N9000B | Keysight N9020B | |
|---|---|---|
| Commands in TestFlow's library | 84 | 103 |
| Queries (read a value or state) | 27 | 22 |
| Settings and actions | 57 | 81 |
| Subsystems | 17 | 19 |
| Distinct command headers | 73 | 87 |
| Headers the other lacks | 14 | 28 |
| Command language | SCPI | SCPI |
| Operation complete | *OPC? | *OPC? |
| Error queue | SYSTem:ERRor? | Not in library |
| Models on this command set | N9000B | N9020B, N9021B, N9030B, N9038A, N9040B, N9041B, N9048B |
59 command headers are in both libraries. Here are 12, taken across subsystems. Where the N9020B library writes the command differently, its form is shown under the N9000B's.
| Command | What it does |
|---|---|
| :SENSe:FREQuency:CENTer <Frequency> | Set Center Freq. Sets the center frequency of the displayed span in Hz. |
| :CALCulate:MARKer1:STATe ONN9020B: :CALCulate:MARKer<MkrNum>:STATe ON | Marker On. Turns marker 1 on (normal marker). |
| :INITiate:CONTinuous ON | Continuous Sweep On. Sets the analyzer to continuous (free-run) sweep mode. |
| :CONFigure:CHPower | Config Channel Power. Selects and configures the Channel Power measurement. |
| :DISPlay:WINDow:TRACe:Y:SCALe:RLEVel <Level> | Set Ref Level. Sets the amplitude reference level (top of the graticule) in the current Y-axis units. |
| :TRACe1:TYPE <Type>N9020B: :TRACe<TraceNum>:TYPE <TraceType> | Set Trace Type. Sets trace 1 update type (clear write, average, max hold, or min hold). |
| :INSTrument:SELect SA | Select SA Mode. Selects the Spectrum Analyzer (SA) mode on the X-Series analyzer. |
| :TRIGger:SOURce <Source> | Set Trigger Source. Selects the trigger source for the sweep. |
| :READ:CHPower? | Measure Channel Power. Initiates a Channel Power measurement and returns the result. |
| :UNIT:POWer <Units> | Set Y Units. Sets the amplitude (Y-axis) measurement units. |
| :CALibration:ALL? | Self Calibration. Runs the full internal alignment (calibration) and returns 0 on success. |
| *IDN? | Identify. Returns the instrument identification string (manufacturer, model, serial, firmware). |
14 command headers in the N9000B library have no match in the N9020B library. Below are 12 of them from the 6 largest subsystems; the full list is in the Keysight N9000B command reference.
| Command | What it does |
|---|---|
| :SENSe:AVERage:COUNt? | Read Average Count. Returns the configured number of averages. |
| :SENSe:AVERage:CLEar | Average Clear. Clears and restarts the average accumulation. |
| :SENSe:DETector:FUNCtion <Detector> | Set Detector. Sets the trace detector function. |
| :SENSe:DETector:FUNCtion? | Read Detector. Returns the current trace detector function. |
| Command | What it does |
|---|---|
| :CALCulate:MARKer1:SET:CENTer | Marker To Center. Sets the center frequency equal to the marker 1 frequency. |
| :CALCulate:MARKer1:SET:RLEVel | Marker To Ref Level. Sets the reference level equal to the marker 1 amplitude. |
| :CALCulate:DATA? | Read Measurement Data. Returns the calculated data for the active measurement. |
| Command | What it does |
|---|---|
| :FETCh:CHPower? | Read Channel Power. Returns the most recent Channel Power measurement result. |
| :FETCh:OBWidth? | Read OBW. Returns the most recent Occupied Bandwidth measurement result. |
| Command | What it does |
|---|---|
| :CONFigure:SANalyzer | Config Swept SA. Selects and configures the Swept SA measurement with its default settings. |
| Command | What it does |
|---|---|
| :INITiate:RESTart | Restart Sweep. Restarts the current sweep/measurement from the beginning. |
| Command | What it does |
|---|---|
| :INSTrument:SELect? | Read Mode. Queries the currently selected instrument mode. |
28 command headers in the N9020B library have no match in the N9000B library. Below are 16 of them from the 6 largest subsystems; the full list is in the Keysight N9020B command reference.
| Command | What it does |
|---|---|
| :CALCulate:MARKer<MkrNum>:MAXimum:LEFT | Marker Peak Left. Moves the specified marker to the next peak to the left. |
| :CALCulate:MARKer<MkrNum>:MAXimum:RIGHt | Marker Peak Right. Moves the specified marker to the next peak to the right. |
| :CALCulate:MARKer<MkrNum>:CENTer | Marker To Center. Sets the center frequency to the marker's current frequency. |
| :CALCulate:MARKer<MkrNum>:RLEVel | Marker To Ref Level. Sets the reference level to the marker's current amplitude. |
| Command | What it does |
|---|---|
| :SENSe:FREQuency:OFFSet <Offset> | Set Freq Offset. Sets a frequency offset added to all displayed frequency readouts in Hz. |
| :SENSe:DETector:TRACe <Detector> | Set Detector. Sets the detector type used to reduce sweep data to trace points. |
| :SENSe:DETector:AUTO ON | Set Detector Auto. Enables automatic detector selection based on the trace and measurement. |
| :SENSe:CORRection:IMPedance:INPut:MAGNitude <Impedance> | Set Input Impedance. Sets the input impedance reference (50 or 75 ohms) for amplitude correction. |
| Command | What it does |
|---|---|
| :CONFigure:ACPower | Config ACP. Configures the analyzer for the Adjacent Channel Power (ACP) measurement. |
| :CONFigure:TOI | Config TOI. Configures the analyzer for the third-order intercept (TOI) measurement. |
| :CONFigure:HARMonics | Config Harmonics. Configures the analyzer for the harmonic distortion measurement. |
| Command | What it does |
|---|---|
| :READ:ACPower? | Read ACP. Initiates and reads the adjacent channel power ratio results. |
| :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. |
| Command | What it does |
|---|---|
| :ABORt | Abort. Aborts the current sweep or measurement in progress. |
| Command | What it does |
|---|---|
| :DISPlay:ENABle ON | Display All On. Turns the front-panel display update on. |
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 :SENSe:FREQuency:CENTer? (read center 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_N9000B_ADDRESS") # Keysight N9000B
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 Center Freq
print(a.query(":SENSe:FREQuency:CENTer?"))
print(b.query(":SENSe:FREQuency:CENTer?"))
a.close()
b.close()Describe the test; TestFlow's agent uses these command sets to drive your Keysight N9000B or Keysight N9020B and writes the report from the measured results.
In TestFlow's library the N9000B has 84 SCPI commands and the N9020B has 103 SCPI commands. 59 command headers are common to both, 14 are only on the N9000B (mostly SENSe and CALCulate), and 28 are only on the N9020B (mostly CALCulate and SENSe).
Partly. 59 command headers are accepted by both, including :SENSe:FREQuency:CENTer, :CALCulate:MARKer1:STATe, and :INITiate:CONTinuous. 42 are not, for example :SENSe:AVERage:COUNt? on the N9000B and :CALCulate:MARKer<MkrNum>:MAXimum:LEFT on the N9020B, so a script that uses those needs a separate branch for each instrument.
The N9020B: 84 commands for the N9000B against 103 for the N9020B in TestFlow's library. Of those, 27 on the N9000B and 22 on the N9020B are queries that read a value or state, and the library splits them into 17 and 19 subsystems.
Both libraries synchronise with *OPC?. Only the N9000B library has an error-queue read (SYSTem:ERRor?); the N9020B library has none. Each command named here is listed in the tables on this page and on each instrument's command reference.
Describe the test. TestFlow builds the workflow, runs it on your instruments, and writes the report. See it on a bench like yours.