Spectrum Analyzer · SCPI command reference

Keysight E4440A and E4445A SCPI commands

The Keysight E4440A and E4445A spectrum analyzer is controlled remotely with SCPI commands. TestFlow's instrument library holds 86 commands for it, 20 of them queries that read values or state, grouped below by subsystem with their arguments. It is the same library TestFlow's AI agent uses to drive the E4440A on a real bench.

Commands
86
Queries
20
Subsystems
19
Models covered
2

Run this on your bench

Describe the test; TestFlow's agent uses this command set to drive your Keysight E4440A or E4445A and writes the report from the measured results.

Get started

Control the Keysight E4440A from Python

With PyVISA, any VISA backend, and the instrument on USB, LAN or GPIB, this opens a session, identifies the instrument, sends one setting, and reads one value. Every command in it comes from the reference below. For a full walkthrough, see the PyVISA tutorial and the SCPI command cheat sheet.

import pyvisa

rm = pyvisa.ResourceManager()
print(rm.list_resources())  # find the Keysight E4440A's VISA address

# Paste the address of your Keysight E4440A (USB, LAN or GPIB).
inst = rm.open_resource("PASTE_VISA_ADDRESS_HERE")
inst.timeout = 5000  # ms

print(inst.query("*IDN?"))  # identify the instrument
inst.write(":SENSe:FREQuency:SPAN:FULL")  # Set Full Span
print(inst.query(":READ:CHPower?"))  # Read Channel Power

inst.close()

Run this on your bench

Describe the test; TestFlow's agent uses this command set to drive your Keysight E4440A or E4445A and writes the report from the measured results.

Get started

Run a E4440A test without writing code

Describe the test in a sentence, for example “set full span on the E4440A, then read channel power and log it against a limit”. TestFlow's agent builds the steps from this command library, runs them on your bench through the TestFlow desktop app, and writes the report from the measured values. See AI test automation for lab instruments for how that works and where it stops.

Get started

SCPI command reference

86 commands in 19 groups. A ? marks a query that returns a value. Placeholders in angle brackets take the listed values. The E4440A and E4445A share this command set in TestFlow's library.

Sense (SENSe) (40)

CommandWhat it doesArguments
:SENSe:FREQuency:CENTer <Frequency>Set Center Freq. Sets the center frequency of the displayed span in Hz.Number
:SENSe:FREQuency:CENTer?Get Center Freq. Queries the current center frequency in Hz.None
:SENSe:FREQuency:STARt <Frequency>Set Start Freq. Sets the start (left edge) frequency of the sweep in Hz.Number
:SENSe:FREQuency:STARt?Get Start Freq. Queries the start frequency in Hz.None
:SENSe:FREQuency:STOP <Frequency>Set Stop Freq. Sets the stop (right edge) frequency of the sweep in Hz.Number
:SENSe:FREQuency:STOP?Get Stop Freq. Queries the stop frequency in Hz.None
:SENSe:FREQuency:SPAN <Span>Set Span. Sets the frequency span of the sweep in Hz.Number
:SENSe:FREQuency:SPAN?Get Span. Queries the current frequency span in Hz.None
:SENSe:FREQuency:SPAN:FULLSet Full Span. Sets the span to the full frequency range of the analyzer.None
:SENSe:FREQuency:SPAN 0Set Zero Span. Sets the analyzer to zero span (time-domain at the center frequency).None
:SENSe:FREQuency:OFFSet <Offset>Set Freq Offset. Sets a frequency offset added to all displayed frequency readouts in Hz.Number
:SENSe:POWer:RF:ATTenuation:AUTO ONSet Atten Auto On. Enables automatic input attenuation coupling to the reference level.None
:SENSe:POWer:RF:ATTenuation:AUTO OFFSet Atten Auto Off. Disables automatic attenuation so the manual attenuation value is used.None
:SENSe:POWer:RF:ATTenuation <Atten>Set Attenuation. Sets the input RF attenuation in dB (manual mode).Number
:SENSe:POWer:RF:ATTenuation?Get Attenuation. Queries the current input RF attenuation in dB.None
:SENSe:POWer:RF:GAIN:STATe ONPreamp On. Turns the internal RF preamplifier on (option dependent).None
:SENSe:POWer:RF:GAIN:STATe OFFPreamp Off. Turns the internal RF preamplifier off.None
:SENSe:BANDwidth:RESolution:AUTO ONSet RBW Auto On. Enables automatic coupling of resolution bandwidth to span.None
:SENSe:BANDwidth:RESolution:AUTO OFFSet RBW Auto Off. Disables automatic RBW so the manual value is used.None
:SENSe:BANDwidth:RESolution <RBW>Set RBW. Sets the resolution bandwidth (RBW) in Hz.Number
:SENSe:BANDwidth:RESolution?Get RBW. Queries the current resolution bandwidth in Hz.None
:SENSe:BANDwidth:VIDeo:AUTO ONSet VBW Auto On. Enables automatic coupling of video bandwidth to RBW.None
:SENSe:BANDwidth:VIDeo:AUTO OFFSet VBW Auto Off. Disables automatic VBW so the manual value is used.None
:SENSe:BANDwidth:VIDeo <VBW>Set VBW. Sets the video bandwidth (VBW) in Hz.Number
:SENSe:BANDwidth:VIDeo?Get VBW. Queries the current video bandwidth in Hz.None
:SENSe:SWEep:TIME:AUTO ONSet Sweep Time Auto On. Enables automatic sweep time coupling to span and bandwidth.None
:SENSe:SWEep:TIME:AUTO OFFSet Sweep Time Auto Off. Disables automatic sweep time so the manual value is used.None
:SENSe:SWEep:TIME <Time>Set Sweep Time. Sets the sweep time in seconds.Number
:SENSe:SWEep:TIME?Get Sweep Time. Queries the current sweep time in seconds.None
:SENSe:SWEep:POINts <Points>Set Sweep Points. Sets the number of sweep (trace) data points.Number
:SENSe:SWEep:POINts?Get Sweep Points. Queries the number of sweep data points.None
:SENSe:DETector:FUNCtion <Detector>Set Detector. Sets the detector type used to reduce sweep data to trace points.Text: NORMal,AVERage,POSitive,NEGative,SAMPle,RMS
:SENSe:DETector:AUTO ONSet Detector Auto. Enables automatic detector selection based on the measurement.None
:SENSe:AVERage:STATe ONSet Average On. Turns trace averaging on.None
:SENSe:AVERage:STATe OFFSet Average Off. Turns trace averaging off.None
:SENSe:AVERage:COUNt <Count>Set Average Count. Sets the number of averages to accumulate.Number
:SENSe:AVERage:TYPE <AvgType>Set Average Type. Sets the averaging type used for trace averaging.Text: RMS,LOG,SCALar
:SENSe:CHPower:BANDwidth:INTegration <IBW>Set CHP Integ BW. Sets the integration bandwidth used by the channel power measurement in Hz.Number
:SENSe:OBWidth:PERCent <Percent>Set OBW Percent. Sets the percent of total power used to define occupied bandwidth (typically 99).Number
:SENSe:ROSCillator:SOURce <Source>Set Ref Osc Source. Selects the reference oscillator (timebase) source: internal or external.Text: INTernal,EXTernal

Calculate (CALCulate) (12)

CommandWhat it doesArguments
:CALCulate:MARKer<MkrNum>:STATe ONMarker On. Turns on the specified marker.Number: 1,2,3,4
:CALCulate:MARKer<MkrNum>:STATe OFFMarker Off. Turns off the specified marker.Number: 1,2,3,4
:CALCulate:MARKer<MkrNum>:X <Position>Set Marker X. Sets the X-axis (frequency or time) position of the specified marker.Number: 1,2,3,4; Number
:CALCulate:MARKer<MkrNum>:X?Get Marker X. Queries the X-axis position (frequency/time) of the specified marker.Number: 1,2,3,4
:CALCulate:MARKer<MkrNum>:Y?Get Marker Y. Queries the Y-axis amplitude value at the specified marker.Number: 1,2,3,4
:CALCulate:MARKer<MkrNum>:MAXimumMarker Peak Search. Moves the specified marker to the highest peak on the trace.Number: 1,2,3,4
:CALCulate:MARKer<MkrNum>:MAXimum:NEXTMarker Peak Next. Moves the specified marker to the next-highest peak.Number: 1,2,3,4
:CALCulate:MARKer<MkrNum>:MINimumMarker Min Search. Moves the specified marker to the minimum point on the trace.Number: 1,2,3,4
:CALCulate:MARKer<MkrNum>:CENTerMarker To Center. Sets the center frequency to the marker's current frequency.Number: 1,2,3,4
:CALCulate:MARKer<MkrNum>:RLEVelMarker To Ref Level. Sets the reference level to the marker's current amplitude.Number: 1,2,3,4
:CALCulate:MARKer<MkrNum>:MODE DELTaSet Marker Delta. Sets the specified marker to delta (relative) mode.Number: 1,2,3,4
:CALCulate:MARKer<MkrNum>:FUNCtion NOISeSet Marker Noise. Turns on the noise marker function for the specified marker.Number: 1,2,3,4

Display (DISPlay) (4)

CommandWhat it doesArguments
:DISPlay:WINDow:TRACe:Y:SCALe:RLEVel <Level>Set Ref Level. Sets the reference level (top of the display grid) in the current Y units.Number
:DISPlay:WINDow:TRACe:Y:SCALe:RLEVel?Get Ref Level. Queries the current reference level.None
:DISPlay:WINDow:TRACe:Y:SCALe:PDIVision <ScalePerDiv>Set Y Scale Div. Sets the vertical scale per division (dB/div in log mode).Number
:DISPlay:WINDow:TRACe:Y:SCALe:SPACing <Spacing>Set Y Scale Type. Sets the vertical scale to logarithmic or linear.Text: LOGarithmic,LINear

Initiate (INITiate) (3)

CommandWhat it doesArguments
:INITiate:CONTinuous ONContinuous Sweep On. Sets the analyzer to continuous (free-run) sweep mode.None
:INITiate:CONTinuous OFFContinuous Sweep Off. Sets the analyzer to single-sweep mode.None
:INITiate:IMMediateInitiate Sweep. Triggers a new sweep/measurement (single-shot when not continuous).None

Configure (CONFigure) (3)

CommandWhat it doesArguments
:CONFigure:CHPowerConfig Channel Power. Configures the analyzer for the Channel Power (CHP) measurement.None
:CONFigure:ACPowerConfig ACP. Configures the analyzer for the Adjacent Channel Power (ACP) measurement.None
:CONFigure:OBWidthConfig OBW. Configures the analyzer for the Occupied Bandwidth (OBW) measurement.None

Read (READ) (3)

CommandWhat it doesArguments
:READ:CHPower?Read Channel Power. Initiates and reads the channel power and power-spectral-density result.None
:READ:ACPower?Read ACP. Initiates and reads the adjacent channel power ratio results.None
:READ:OBWidth?Read OBW. Initiates and reads the occupied bandwidth result.None

Trace (TRACe) (2)

CommandWhat it doesArguments
:TRACe<TraceNum>:MODE <TraceMode>Set Trace Mode. Sets the update mode for the specified trace (clear-write/max-hold/min-hold/view/blank).Number: 1,2,3; Text: WRITe,MAXHold,MINHold,VIEW,BLANk
:TRACe:DATA? <TraceName>Read Trace Data. Reads back the amplitude data points of the specified trace.Text: TRACE1,TRACE2,TRACE3

Trigger (TRIGger) (2)

CommandWhat it doesArguments
:TRIGger:SOURce <Source>Set Trigger Source. Selects the sweep trigger source.Text: IMMediate,VIDeo,LINE,EXTernal,RFBurst
:TRIGger:VIDeo:LEVel <Level>Set Trigger Level. Sets the video trigger level in the current amplitude units.Number

Instrument (INSTrument) (1)

CommandWhat it doesArguments
:INSTrument:SELect SASelect SA Mode. Selects the basic Spectrum Analyzer measurement personality.None

UNIT subsystem (1)

CommandWhat it doesArguments
:UNIT:POWer <Units>Set Y Units. Sets the amplitude (Y-axis) units for power readouts.Text: DBM,DBMV,DBMA,V,W,A,DBUV,DBUA,DBUVM,DBUAM,DBPT,DBG

FORM subsystem (1)

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

Abort (1)

CommandWhat it doesArguments
:ABORtAbort. Aborts the current sweep or measurement in progress.None

INP subsystem (1)

CommandWhat it doesArguments
:INPut:COUPling <Coupling>Set Input Coupling. Sets the RF input coupling to AC or DC.Text: AC,DC

Mass memory (MMEMory) (1)

CommandWhat it doesArguments
:MMEMory:STORe:SCReen "C:\Temp\scrn.gif" ; wait(500) ; :MMEMory:DELete "C:\Temp\scrn.gif"Capture. Saves a screen image to a temporary file on the analyzer, reads it back to the controller, then deletes the temp file.None

CAL subsystem (1)

CommandWhat it doesArguments
:CALibration:ALL?Self Calibration. Runs internal self-alignment/calibration and returns 0 on success.None

Other subsystem (1)

CommandWhat it doesArguments
<Output Variable>=<Equation>Math. Variable equals an equation like (${Var_name}= ${Var_name}/2)Number; Text

WAIT subsystem (1)

CommandWhat it doesArguments
wait(<ms>)Wait. Waits for number of millisecondsNumber

SAVE subsystem (1)

CommandWhat it doesArguments
save2var <Variable_name>Save2Variable. Saves last measurement to a variableText

IEEE 488.2 common commands (7)

CommandWhat it doesArguments
*IDN?Identify. Returns the instrument identification string (manufacturer, model, serial, firmware).None
*RSTReset. Resets the instrument to its default state.None
*CLSClear Status. Clears all event registers and the error queue.None
*TST?Self Test. Runs the self-test and returns 0 for pass or 1 for failure.None
*OPC?Operation Complete. Returns 1 when all pending operations are complete.None
*WAIWait To Continue. Waits until all pending operations are complete before continuing.None
*TRGTrigger Bus. Generates a bus trigger when the instrument is in wait-for-trigger state.None

Where these commands come from

This reference is generated from TestFlow's instrument library, which is drafted from Keysight's programming documentation for the E4440A and E4445A and checked when the agent runs it. Ranges, timing, and option-dependent commands are defined by Keysight's programming manual: check it before you rely on an edge case. Last updated November 17, 2026.

Frequently asked questions

Does the Keysight E4440A support SCPI remote control?

Yes. The Keysight E4440A accepts SCPI commands over its remote interfaces. TestFlow's instrument library holds 86 SCPI commands for it: 20 queries that read values or state, and 66 settings and actions.

How do I control the Keysight E4440A from Python?

Install PyVISA and a VISA backend, find the instrument's address with ResourceManager().list_resources(), open it, then send commands with write() and read values with query(). The example on this page sends *IDN?, :SENSe:FREQuency:SPAN:FULL and :READ:CHPower?.

Which command reads a value from the Keysight E4440A?

:READ:CHPower? (read channel power). Initiates and reads the channel power and power-spectral-density result. The full list of queries is in the command reference on this page, grouped by subsystem.

Can I automate the Keysight E4440A without writing code?

Yes. TestFlow is an AI agent for electronics testing: you describe the test, and it builds the automation from this command library, runs it on the Keysight E4440A through the TestFlow desktop app, and writes the report from the measured results.

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.