Radio Test Set · SCPI command reference

Viavi 2945B SCPI commands

The Viavi 2945B radio test set is controlled remotely with SCPI commands. TestFlow's instrument library holds 92 commands for it, 36 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 2945B on a real bench.

Commands
92
Queries
36
Subsystems
20
Models covered
1

Run this on your bench

Describe the test; TestFlow's agent uses this command set to drive your Viavi 2945B and writes the report from the measured results.

Get started

Control the Viavi 2945B 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 Viavi 2945B's VISA address

# Paste the address of your Viavi 2945B (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(":RECEiver:Autotune ON")  # Turn On Autotune
print(inst.query(":MEASUre:TXFreq?"))  # Measure TX Frequency

inst.close()

Run this on your bench

Describe the test; TestFlow's agent uses this command set to drive your Viavi 2945B and writes the report from the measured results.

Get started

Run a 2945B test without writing code

Describe the test in a sentence, for example “turn on autotune on the 2945B, then measure tx frequency 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

92 commands in 20 groups. A ? marks a query that returns a value. Placeholders in angle brackets take the listed values.

MEASU subsystem (22)

CommandWhat it doesArguments
:MEASUre:TXFreq?Measure TX Frequency. Returns the RF counter reading in MHz (1 Hz resolution).None
:MEASUre:TXOffset?Measure TX Offset. Returns the offset from the receiver frequency in kHz.None
:MEASUre:TXLevel?Measure TX Power. Returns the RF power meter reading in the selected units.None
:MEASUre:FMdevn?Measure FM Deviation. Returns the measured transmitter FM deviation in Hz.None
:MEASUre:FLevel?Measure FM Deviation PosNeg. Returns the positive and negative FM deviation in Hz.None
:MEASUre:AMdepth?Measure AM Depth. Returns the measured transmitter AM depth in percent.None
:MEASUre:ALevel?Measure AM Depth PosNeg. Returns the positive and negative AM depth in percent.None
:MEASUre:MOdfreq?Measure Mod Frequency. Returns the modulation frequency in kHz.None
:MEASUre:TXDistn?Measure TX Distortion. Returns the transmitter distortion in percent.None
:MEASUre:TXSInad?Measure TX SINAD. Returns the transmitter SINAD in dB.None
:MEASUre:TXSN?Measure TX SN. Returns the transmitter signal-to-noise ratio in dB.None
:MEASUre:AFFreq?Measure AF Frequency. Returns the audio frequency in kHz (0.1 Hz resolution).None
:MEASUre:AFLevel?Measure AF Level. Returns the audio input level in the selected units.None
:MEASUre:RXSInad?Measure RX SINAD. Returns the receiver audio SINAD in dB.None
:MEASUre:RXDistn?Measure RX Distortion. Returns the receiver audio distortion in percent.None
:MEASUre:RXSN?Measure RX SN. Returns the receiver audio signal-to-noise ratio in dB.None
:MEASUre:Occbw?Measure Occupied Bandwidth. Returns the occupied bandwidth in kHz.None
:MEASUre:HARM2?Measure Harmonic 2. Returns the second harmonic level in dBc.None
:MEASUre:MKr1?Measure Marker Level. Returns the spectrum/transient analyzer marker level in dBm.None
:MEASUre:FWdpwr?Measure Forward Power. Returns the directional power head forward power in dBm.None
:MEASUre:REvpwr?Measure Reverse Power. Returns the directional power head reverse power in dBm.None
:MEASUre:Vswr?Measure VSWR. Returns the VSWR from the directional power accessory.None

RECE subsystem (13)

CommandWhat it doesArguments
:RECEiver:FREQ <Freq>Set Receiver Frequency. Sets the receiver frequency (default suffix MHZ).Number
:RECEiver:FREQ?Read Receiver Frequency. Returns the receiver frequency in MHz.None
:RECEiver:Autotune ONTurn On Autotune. Turns the receiver autotune function on.None
:RECEiver:Autotune OFFTurn Off Autotune. Turns the receiver autotune function off.None
:RECEiver:FIlter <Filter>Set Receiver IF Filter. Sets the receiver IF bandwidth.Text: FIL_300HZ,FIL_3KHZ,FIL_30KHZ,FIL_300KHZ
:RECEiver:FERror <Method>Set Frequency Error Method. Sets the Rx test frequency error measurement method.Text: PPM,FREQ
:RECEiver:FRESn <Res>Set Counter Resolution. Sets the RF counter resolution.Text: RESN_1HZ,RESN_10HZ,RESN_P1HZ
:RECEiver:Powerbw <Meter>Set Power Measurement. Selects broadband or inband power measurement.Text: BROADBAND,INBAND
:RECEiver:Deemph ONTurn On Deemphasis. Turns the receiver de-emphasis filter on.None
:RECEiver:Deemph OFFTurn Off Deemphasis. Turns the receiver de-emphasis filter off.None
:RECEiver:HARMOnics ONTurn On Harmonics. Enables harmonic measurement in TX test mode.None
:RECEiver:HARMOnics OFFTurn Off Harmonics. Disables harmonic measurement in TX test mode.None
:RECEiver?Read Receiver Status. Returns the combined receiver settings.None

SP subsystem (11)

CommandWhat it doesArguments
:SPecana:Center <Freq>Set SA Center Frequency. Sets the spectrum analyzer center frequency (default suffix MHZ).Number
:SPecana:SPan <Span>Set SA Span. Sets the spectrum analyzer span (default suffix MHZ).Number
:SPecana:Reflevel <Level>Set SA Reference Level. Sets the spectrum analyzer reference level in dBm.Number
:SPecana:Filter <Filter>Set SA Filter. Sets the spectrum analyzer resolution bandwidth.Text: AUTO,FIL_300HZ,FIL_3KHZ,FIL_30KHZ,FIL_300KHZ,FIL_3MHZ
:SPecana:MOde <Mode>Set SA Mode. Sets the spectrum analyzer mode.Text: NORMAL,LOOK_LIST
:SPecana:Peakhold ONTurn On SA Peak Hold. Turns spectrum analyzer peak hold on.None
:SPecana:Peakhold OFFTurn Off SA Peak Hold. Turns spectrum analyzer peak hold off.None
:SPecana:MArker ONTurn On SA Marker. Turns the spectrum analyzer marker on.None
:SPecana:MArker OFFTurn Off SA Marker. Turns the spectrum analyzer marker off.None
:SPecana:MKRFreq <Freq>Set SA Marker Frequency. Sets the spectrum analyzer marker frequency (default suffix MHZ).Number
:SPecana:MKRPeakSA Marker To Peak. Moves the marker to the highest level on the display.None

RF subsystem (9)

CommandWhat it doesArguments
:RFgen:Status ONTurn On RF Generator. Turns the RF generator for receiver testing on.None
:RFgen:Status OFFTurn Off RF Generator. Turns the RF generator for receiver testing off.None
:RFgen:Freq <Freq>Set RF Generator Frequency. Sets the RF generator frequency (default suffix MHZ; MHZ, KHZ, HZ allowed).Number
:RFgen:Freq?Read RF Generator Frequency. Returns the RF generator frequency in MHz.None
:RFgen:Level <Level>Set RF Generator Level. Sets the RF generator level (default suffix DBM; DBM, DBUV, UV, MV allowed).Number
:RFgen:Level?Read RF Generator Level. Returns the RF generator level in dBm.None
:RFgen:Mode <Mode>Set RF Generator Atten Mode. Sets the RF generator attenuator hold mode.Text: NORMAL,SEAMLESS
:RFgen:Volts <Mode>Set RF Generator Volts Mode. Selects whether the RF generator volts level is EMF or PD.Text: PD,EMF
:RFgen?Read RF Generator Status. Returns the combined RF generator settings (freq;level;mode;status;top seamless level;volts).None

MODGEN subsystem (7)

CommandWhat it doesArguments
:MODGEN<Gen>:STatus ONTurn On Mod Generator. Turns modulation generator 1 or 2 on.Number: 1,2
:MODGEN<Gen>:STatus OFFTurn Off Mod Generator. Turns modulation generator 1 or 2 off.Number: 1,2
:MODGEN<Gen>:FReq <Freq>Set Mod Generator Frequency. Sets modulation generator frequency (default suffix KHZ).Number: 1,2; Number
:MODGEN<Gen>:FMdevn <Deviation>Set Mod Generator FM Deviation. Sets modulation generator FM deviation (default suffix KHZ).Number: 1,2; Number
:MODGEN<Gen>:Amdepth <Depth>Set Mod Generator AM Depth. Sets modulation generator AM depth in percent.Number: 1,2; Number: 0,100
:MODGEN<Gen>:SHape <Shape>Set Mod Generator Shape. Sets modulation generator shape.Number: 1,2; Text: SINE,SQUARE
:MODGEN<Gen>?Read Mod Generator Status. Returns the combined settings of modulation generator 1 or 2.Number: 1,2

AFGEN subsystem (6)

CommandWhat it doesArguments
:AFGEN<Gen>:STatus ONTurn On AF Generator. Turns audio generator 1 or 2 on.Number: 1,2
:AFGEN<Gen>:STatus OFFTurn Off AF Generator. Turns audio generator 1 or 2 off.Number: 1,2
:AFGEN<Gen>:Freq <Freq>Set AF Generator Frequency. Sets audio generator frequency (default suffix KHZ; KHZ or HZ).Number: 1,2; Number
:AFGEN<Gen>:Level <Level>Set AF Generator Level. Sets audio generator level (default suffix MV; MV, V, DBM).Number: 1,2; Number
:AFGEN<Gen>:SHape <Shape>Set AF Generator Shape. Sets audio generator shape.Number: 1,2; Text: SINE,SQUARE
:AFGEN<Gen>?Read AF Generator Status. Returns the combined settings of audio generator 1 or 2.Number: 1,2

TE subsystem (2)

CommandWhat it doesArguments
:TEstmode <Mode>Set Test Mode. Sets the basic mode of the service monitor.Text: RX_TEST,TX_TEST,DX_TEST,SYSTEMS,AF_TEST,SPEC_ANA,TONES_MODE,ACC_PWR
:TEstmode?Read Test Mode. Returns the current test mode.None

MEASC subsystem (2)

CommandWhat it doesArguments
:MEASCycl ONTurn On Measure Cycle. Starts the instrument measure cycle.None
:MEASCycl OFFTurn Off Measure Cycle. Stops the instrument measure cycle.None

AUDF subsystem (2)

CommandWhat it doesArguments
:AUDFilt:Psoph ONTurn On Psophometric Filter. Turns the receiver psophometric audio filter on.None
:AUDFilt:Psoph OFFTurn Off Psophometric Filter. Turns the receiver psophometric audio filter off.None

G subsystem (1)

CommandWhat it doesArguments
:Genswitch <Port>Set Generator Output Port. Selects the RF output routing.Text: GEN_N,GEN_BNC

MODT subsystem (1)

CommandWhat it doesArguments
:MODType <Type>Set Modulation Type. Sets the modulation type of the signal generator.Text: AM,FM

RECS subsystem (1)

CommandWhat it doesArguments
:RECSwitch <Input>Set Receiver Input. Selects the RF input routing from the transmitter under test.Text: REC_N,REC_ANT

DEM subsystem (1)

CommandWhat it doesArguments
:DEModtype <Type>Set Demodulation Type. Sets the demodulation type used on the received signal.Text: AM,FM,SSB

AFI subsystem (1)

CommandWhat it doesArguments
:AFInput <Coupling>Set Audio Input Coupling. Sets the audio input socket coupling.Text: AC,DC

RECA subsystem (1)

CommandWhat it doesArguments
:RECAll <Store>Recall Store. Recalls instrument settings from the given store number.Number

DEV subsystem (1)

CommandWhat it doesArguments
:DEVerror?Read Device Error. Returns the last device error generated by the instrument.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 (8)

CommandWhat it doesArguments
*IDN?Identify. Returns the identification string (manufacturer, type number, serial number, firmware version).None
*RSTReset. Sets the instrument functions to the factory default power-up state.None
*CLSClear Status. Clears all status event registers.None
*TST?Self Test. Runs the self test and returns 0 if all tests passed.None
*OPC?Operation Complete. Returns 1 when the preceding operation has completed.None
*WAIWait To Continue. Inhibits execution of an overlapped command until the preceding operation is complete.None
*OPT?Read Options. Returns the state of enabled options in 32 data fields.None
*STB?Read Status Byte. Returns the value of the status byte.None

Where these commands come from

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

Frequently asked questions

Does the Viavi 2945B support SCPI remote control?

Yes. The Viavi 2945B accepts SCPI commands over its remote interfaces. TestFlow's instrument library holds 92 SCPI commands for it: 36 queries that read values or state, and 56 settings and actions.

How do I control the Viavi 2945B 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?, :RECEiver:Autotune ON and :MEASUre:TXFreq?.

Which command reads a value from the Viavi 2945B?

:MEASUre:TXFreq? (measure tx frequency). Returns the RF counter reading in MHz (1 Hz resolution). The full list of queries is in the command reference on this page, grouped by subsystem.

Can I automate the Viavi 2945B 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 Viavi 2945B 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.