In TestFlow's instrument library, the Keysight N9020B takes 103 SCPI commands, 22 of them queries, and the Keysight N9042B takes 386 SCPI commands, 193 of them queries. That is 283 more on the N9042B. Counting distinct command headers (the command path without its arguments), 32 are accepted by both, 55 exist only on the N9020B, and 346 only on the N9042B. 37% of the N9020B's command headers also exist on the N9042B.
Both libraries have commands under SENSe, CALCulate, DISPlay, CONFigure, READ, INITiate, TRIGger, and ABORt, plus 1 more root. Only the N9020B has TRACe, INSTrument, UNIT, FORMat, MMEMory, and CALibration. Only the N9042B has SYSTem, FETCh, MEASure, FREQ, POW, and SWE and 8 more.
Both libraries synchronise with *OPC?. Only the N9042B 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 N9020B or Keysight N9042B 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 N9020B | Keysight N9042B | |
|---|---|---|
| Commands in TestFlow's library | 103 | 386 |
| Queries (read a value or state) | 22 | 193 |
| Settings and actions | 81 | 193 |
| Subsystems | 19 | 23 |
| Distinct command headers | 87 | 378 |
| Headers the other lacks | 55 | 346 |
| Command language | SCPI | SCPI |
| Operation complete | *OPC? | *OPC? |
| Error queue | Not in library | SYSTem:ERRor? |
| Models on this command set | N9020B, N9021B, N9030B, N9038A, N9040B, N9041B, N9048B | N9042B |
32 command headers are in both libraries. Here are 12, taken across subsystems. Where the N9042B library writes the command differently, its form is shown under the N9020B's.
| Command | What it does |
|---|---|
| :SENSe:FREQuency:CENTer <Frequency>N9042B: :SENSe:FREQuency:CENTer <freq> | Set Center Freq. Sets the center frequency of the displayed span in Hz. |
| :CALCulate:MARKer<MkrNum>:X <Position>N9042B: :CALC:MARK<n>:X <freq> | Set Marker X. Sets the X-axis (frequency or time) position of the specified marker. |
| :CONFigure:OBWidth | Config OBW. Configures the analyzer for the Occupied Bandwidth (OBW) measurement. |
| :READ:OBWidth?N9042B: :READ:OBWidth<n>? | Read OBW. Initiates and reads the occupied bandwidth result. |
| :INITiate:CONTinuous ONN9042B: :INITiate:CONTinuous <state> | Continuous Sweep On. Sets the analyzer to continuous (free-run) sweep mode. |
| :ABORt | Abort. Aborts the current sweep or measurement in progress. |
| *IDN? | Identify. Returns the instrument identification string (manufacturer, model, serial, firmware). |
| :SENSe:FREQuency:CENTer? | Get Center Freq. Queries the current center frequency in Hz. |
| :CALCulate:MARKer<MkrNum>:X?N9042B: :CALC:MARK<n>:X? | Get Marker X. Queries the X-axis position (frequency/time) of the specified marker. |
| :CONFigure:TOI | Config TOI. Configures the analyzer for the third-order intercept (TOI) measurement. |
| :READ:TOI?N9042B: :READ:TOI<n>? | Read TOI. Initiates and reads the third-order intercept measurement results. |
| :INITiate:IMMediate | Initiate Sweep. Triggers a new sweep/measurement (single-shot when not continuous). |
55 command headers in the N9020B library have no match in the N9042B library. Below are 20 of them from the 6 largest subsystems; the full list is in the Keysight N9020B command reference.
| Command | What it does |
|---|---|
| :SENSe:FREQuency:STARt <Frequency> | Set Start Freq. Sets the start (left edge) frequency of the sweep in Hz. |
| :SENSe:FREQuency:STARt? | Get Start Freq. Queries the start frequency in Hz. |
| :SENSe:FREQuency:STOP <Frequency> | Set Stop Freq. Sets the stop (right edge) frequency of the sweep in Hz. |
| :SENSe:FREQuency:STOP? | Get Stop Freq. Queries the stop frequency in Hz. |
| Command | What it does |
|---|---|
| :CALCulate:MARKer<MkrNum>:STATe ON | Marker On. Turns on the specified marker. |
| :CALCulate:MARKer<MkrNum>:MAXimum:LEFT | Marker Peak Left. Moves the specified marker to the next peak to the left. |
| :CALCulate:MARKer<MkrNum>:MINimum | Marker Min Search. Moves the specified marker to the minimum point on the trace. |
| :CALCulate:MARKer<MkrNum>:CENTer | Marker To Center. Sets the center frequency to the marker's current frequency. |
| Command | What it does |
|---|---|
| :DISPlay:WINDow:TRACe:Y:SCALe:RLEVel <Level> | Set Ref Level. Sets the reference level (top of the display grid) in the current Y units. |
| :DISPlay:WINDow:TRACe:Y:SCALe:RLEVel? | Get Ref Level. Queries the current reference level. |
| :DISPlay:WINDow:TRACe:Y:SCALe:PDIVision <ScalePerDiv> | Set Y Scale Div. Sets the vertical scale per division (dB/div in log mode). |
| :DISPlay:ENABle ON | Display All On. Turns the front-panel display update on. |
| Command | What it does |
|---|---|
| :CONFigure:CHPower | Config Channel Power. Configures the analyzer for the Channel Power (CHP) measurement. |
| :CONFigure:ACPower | Config ACP. Configures the analyzer for the Adjacent Channel Power (ACP) measurement. |
| :CONFigure:HARMonics | Config Harmonics. Configures the analyzer for the harmonic distortion measurement. |
| Command | What 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 ON | Set Trace Update On. Enables live updating of the specified trace. |
| :TRACe:DATA? <TraceName> | Read Trace Data. Reads back the amplitude data points of the specified trace. |
| Command | What it does |
|---|---|
| :READ:CHPower? | Read Channel Power. Initiates and reads the channel power and power-spectral-density result. |
| :READ:ACPower? | Read ACP. Initiates and reads the adjacent channel power ratio results. |
346 command headers in the N9042B library have no match in the N9020B library. Below are 24 of them from the 6 largest subsystems; the full list is in the Keysight N9042B command reference.
| Command | What it does |
|---|---|
| :SENSe:CORRection:CSET:GROup:BReak <state> | Set Break State. Turns the correction group break on or off. |
| :SENSe:CORRection:CSET:GROup:BReak? | Query Break State. Returns the correction group break state. |
| :SENSe:CORRection:CSET:GROup:COMMent <text> | Set Correction Group Comment. Sets a comment for the correction group. |
| :SENSe:CORRection:CSET:GROup:COMMent? | Query Correction Group Comment. Returns the correction group comment. |
| Command | What it does |
|---|---|
| :CALCulate:OBWidth:MARKer1:MODE <mode> | Set Marker Mode. Sets the control mode of marker 1 to Normal, Delta or Off. |
| :CALCulate:OBWidth:MARKer1:MODE? | Query Marker Mode. Returns the control mode of marker 1. |
| :CALCulate:OBWidth:MARKer1:MAXimum | Marker Peak Search. Moves marker 1 to the trace point with the maximum Y value; query SYST:ERR? to confirm a peak was found. |
| :CALCulate:OBWidth:MARKer1:X <freq> | Set Marker X Value. Sets the marker X-axis value for marker 1. |
| Command | What it does |
|---|---|
| :SYSTem:CALibration:CGRoup <integer> | Set Cal Group. Selects the calibration group. |
| :SYSTem:CALibration:CGRoup? | Query Cal Group. Returns the selected calibration group. |
| :SYSTem:CALibration:CGRoup:APPLy <state> | Set Apply Cal Group. Controls whether the checked Apply rows of the selected Cal Group are applied. |
| :SYSTem:CALibration:CGRoup:APPLy? | Query Apply Cal Group. Returns the Apply Cal Group state. |
| Command | What it does |
|---|---|
| :FETCh:SANalyzern? | Fetch Swept SA Results. Returns the Swept SA results without initiating a new measurement. |
| :FETCh:PAVTime<n>? | Fetch Phase and Amplitude vs Time. Returns Phase and Amplitude vs Time results without measuring. |
| :FETCh:OBWidth<n>? | Fetch Occupied BW Results. Retrieves the last OBW results for index n without starting a new measurement. |
| :FETCh:OBWidth:OBWidth? | Measure Occupied BW Occupied Bandwidth. Returns the occupied bandwidth in Hz from the last OBW measurement. |
| Command | What it does |
|---|---|
| :TRIGger:SEQuence:RF:SOURce <source> | Set RF Trigger Source. Selects the RF trigger source for the Swept SA measurement. |
| :TRIGger:SEQuence:RF:SOURce? | Query RF Trigger Source. Returns the RF trigger source for the Swept SA measurement. |
| :TRIGger:<Source>:DELay <time> | Set Trigger Delay. Sets the trigger delay for the selected trigger source. |
| :TRIGger:<Source>:DELay? | Query Trigger Delay. Returns the trigger delay for the selected trigger source. |
| Command | What it does |
|---|---|
| :CONFigure:<measurement>:NDEFault | Configure Measurement. Stops the current measurement and sets up the specified measurement with defaults. |
| :CONFigure? | Query Configured Measurement. Returns the current measurement. |
| :CONFigure:CATalog? | Query Measurement Catalog. Returns a quoted string of all licensed measurement names in the current mode. |
| :CONFigure:PAVTime | Configure Phase and Amplitude vs Time. Configures the Phase and Amplitude vs Time measurement. |
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:POWer:RF:ATTenuation:AUTO (set atten auto on); the N9042B library writes it as :SENSe:POWer:RF:ATTenuation:AUTO OFF | ON | 0 | 1. For the reading, both libraries hold :SENSe:FREQuency:CENTer? (get 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_N9020B_ADDRESS") # Keysight N9020B
b = rm.open_resource("PASTE_N9042B_ADDRESS") # Keysight N9042B
for inst in (a, b):
inst.timeout = 5000 # ms
print(inst.query("*IDN?"))
# The same setting on both: Set Atten Auto On
a.write(":SENSe:POWer:RF:ATTenuation:AUTO ON")
b.write(":SENSe:POWer:RF:ATTenuation:AUTO OFF | ON | 0 | 1")
# The same reading on both: Get 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 N9020B or Keysight N9042B and writes the report from the measured results.
In TestFlow's library the N9020B has 103 SCPI commands and the N9042B has 386 SCPI commands. 32 command headers are common to both, 55 are only on the N9020B (mostly SENSe and CALCulate), and 346 are only on the N9042B (mostly SENSe and CALCulate).
Partly. 32 command headers are accepted by both, including :SENSe:FREQuency:CENTer, :CALCulate:MARKer<MkrNum>:X, and :CONFigure:OBWidth. 401 are not, for example :SENSe:FREQuency:STARt on the N9020B and :SENSe:CORRection:CSET:GROup:BReak on the N9042B, so a script that uses those needs a separate branch for each instrument.
The N9042B: 103 commands for the N9020B against 386 for the N9042B in TestFlow's library. Of those, 22 on the N9020B and 193 on the N9042B are queries that read a value or state, and the library splits them into 19 and 23 subsystems.
Both libraries synchronise with *OPC?. Only the N9042B 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.