The Keysight N5172B and N5182B vector signal generator is controlled remotely with SCPI commands. TestFlow's instrument library holds 193 commands for it, 64 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 N5172B on a real bench.
Describe the test; TestFlow's agent uses this command set to drive your Keysight N5172B or N5182B and writes the report from the measured results.
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 N5172B's VISA address
# Paste the address of your Keysight N5172B (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(":OUTPut:STATe ON") # Turn On RF Output
print(inst.query(":OUTPut:STATe?")) # Read RF Output State
inst.close()Describe the test; TestFlow's agent uses this command set to drive your Keysight N5172B or N5182B and writes the report from the measured results.
Describe the test in a sentence, for example “turn on rf output on the N5172B, then read rf output state 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.
193 commands in 8 groups. A ? marks a query that returns a value. Placeholders in angle brackets take the listed values. The N5172B and N5182B share this command set in TestFlow's library.
| Command | What it does | Arguments |
|---|---|---|
| :SOURce:FREQuency:FIXed <Freq> | Set Frequency. Sets the CW/fixed RF output frequency in Hz (9 kHz to 6 GHz). | Number |
| :SOURce:FREQuency:FIXed? | Read Frequency. Reads the current CW/fixed RF output frequency in Hz. | None |
| :SOURce:FREQuency:MODE <Mode> | Set Frequency Mode. Sets the frequency entry mode (fixed CW value or list/step sweep). | Text: CW,FIXed,LIST |
| :SOURce:FREQuency:MODE? | Read Frequency Mode. Reads the current frequency entry mode. | None |
| :SOURce:FREQuency:CENTer <Freq> | Set Frequency Center. Sets the center frequency of the frequency sweep range in Hz. | Number |
| :SOURce:FREQuency:CENTer? | Read Frequency Center. Reads the sweep center frequency in Hz. | None |
| :SOURce:FREQuency:SPAN <Freq> | Set Frequency Span. Sets the span of the frequency sweep range in Hz. | Number |
| :SOURce:FREQuency:SPAN? | Read Frequency Span. Reads the sweep frequency span in Hz. | None |
| :SOURce:FREQuency:STARt <Freq> | Set Frequency Start. Sets the start frequency of the frequency sweep range in Hz. | Number |
| :SOURce:FREQuency:STARt? | Read Frequency Start. Reads the sweep start frequency in Hz. | None |
| :SOURce:FREQuency:STOP <Freq> | Set Frequency Stop. Sets the stop frequency of the frequency sweep range in Hz. | Number |
| :SOURce:FREQuency:STOP? | Read Frequency Stop. Reads the sweep stop frequency in Hz. | None |
| :SOURce:FREQuency:OFFSet <Freq> | Set Frequency Offset. Sets a frequency offset added to the displayed RF frequency to account for external hardware. | Number |
| :SOURce:FREQuency:OFFSet? | Read Frequency Offset. Reads the current frequency offset value in Hz. | None |
| :SOURce:FREQuency:MULTiplier <Mult> | Set Frequency Multiplier. Sets a multiplication factor applied to the displayed RF frequency for external multipliers. | Number |
| :SOURce:FREQuency:MULTiplier? | Read Frequency Multiplier. Reads the frequency multiplier factor. | None |
| :SOURce:POWer:LEVel:IMMediate:AMPLitude <Power> | Set Power Level. Sets the RF output power level in dBm. | Number |
| :SOURce:POWer:LEVel:IMMediate:AMPLitude? | Read Power Level. Reads the current RF output power level in dBm. | None |
| :SOURce:POWer:LEVel:IMMediate:OFFSet <Offset> | Set Power Offset. Sets a power offset in dB added to the displayed RF level to account for external gain or loss. | Number |
| :SOURce:POWer:LEVel:IMMediate:OFFSet? | Read Power Offset. Reads the current RF power offset in dB. | None |
| :SOURce:POWer:MODE <Mode> | Set Power Mode. Sets the RF power entry mode (fixed level or list/step sweep). | Text: FIXed,LIST |
| :SOURce:POWer:MODE? | Read Power Mode. Reads the current RF power entry mode. | None |
| :SOURce:POWer:STARt <Power> | Set Power Start. Sets the start level of the RF power sweep range in dBm. | Number |
| :SOURce:POWer:STARt? | Read Power Start. Reads the power sweep start level in dBm. | None |
| :SOURce:POWer:STOP <Power> | Set Power Stop. Sets the stop level of the RF power sweep range in dBm. | Number |
| :SOURce:POWer:STOP? | Read Power Stop. Reads the power sweep stop level in dBm. | None |
| :SOURce:POWer:ALC:STATe ON | Turn On ALC. Enables the automatic level control (ALC) loop. | None |
| :SOURce:POWer:ALC:STATe OFF | Turn Off ALC. Disables the automatic level control loop; the instrument runs open-loop. | None |
| :SOURce:POWer:ALC:STATe? | Read ALC State. Reads whether the ALC loop is enabled. | None |
| :SOURce:POWer:ALC:SOURce <Source> | Set ALC Source. Selects the leveling source used by the ALC loop. | Text: INTernal,DIODe |
| :SOURce:POWer:ALC:SOURce? | Read ALC Source. Reads the currently selected ALC leveling source. | None |
| :SOURce:POWer:ALC:LEVel <Level> | Set ALC Level. Sets the ALC level in dB used when leveling with an external detector. | Number |
| :SOURce:POWer:ALC:BANDwidth:AUTO ON | Turn On ALC Bandwidth Auto. Lets the instrument select the ALC loop bandwidth automatically. | None |
| :SOURce:POWer:ALC:BANDwidth:AUTO OFF | Turn Off ALC Bandwidth Auto. Allows the ALC loop bandwidth to be set manually. | None |
| :SOURce:POWer:ALC:BANDwidth <Freq> | Set ALC Bandwidth. Sets the ALC loop bandwidth in Hz when automatic bandwidth selection is off. | Number |
| :SOURce:POWer:ATTenuation <Atten> | Set Attenuation. Sets the RF output attenuator value in dB when the attenuator is in manual mode. | Number |
| :SOURce:POWer:ATTenuation? | Read Attenuation. Reads the current RF output attenuation in dB. | None |
| :SOURce:POWer:ATTenuation:AUTO ON | Turn On Attenuator Auto. Couples the attenuator to the power level setting (automatic attenuator mode). | None |
| :SOURce:POWer:ATTenuation:AUTO OFF | Turn Off Attenuator Auto. Decouples the attenuator so it can be set manually. | None |
| :SOURce:POWer:REFerence <Power> | Set Power Reference. Sets the RF power reference level in dBm used for relative power display. | Number |
| :SOURce:POWer:REFerence:STATe ON | Turn On Power Reference. Enables relative power mode using the stored power reference. | None |
| :SOURce:POWer:REFerence:STATe OFF | Turn Off Power Reference. Disables relative power mode. | None |
| :SOURce:PHASe:ADJust <Phase> | Set Phase. Adjusts the phase of the RF output signal relative to the current phase reference in radians or degrees. | Number |
| :SOURce:PHASe:ADJust? | Read Phase. Reads the current RF phase adjustment. | None |
| :SOURce:PHASe:REFerence | Set Phase Reference. Sets the current output phase as the zero reference for subsequent phase adjustments. | None |
| :SOURce:ROSCillator:SOURce <Source> | Set Reference Oscillator Source. Selects the reference oscillator source used by the instrument. | Text: INTernal,EXTernal,BBG |
| :SOURce:ROSCillator:SOURce? | Read Reference Oscillator Source. Reads the currently selected reference oscillator source. | None |
| :SOURce:ROSCillator:SOURce:AUTO ON | Turn On Reference Source Auto. Lets the instrument select the reference oscillator source automatically. | None |
| :SOURce:ROSCillator:SOURce:AUTO OFF | Turn Off Reference Source Auto. Forces manual selection of the reference oscillator source. | None |
| :SOURce:ROSCillator:FREQuency:EXTernal <Freq> | Set External Reference Frequency. Sets the expected frequency of the external reference input signal in Hz. | Number |
| :SOURce:ROSCillator:FREQuency:EXTernal? | Read External Reference Frequency. Reads the configured external reference input frequency in Hz. | None |
| :SOURce:SWEep:DWELl <Sec> | Set Sweep Dwell Time. Sets the dwell time per point of the step sweep in seconds. | Number |
| :SOURce:SWEep:DWELl? | Read Sweep Dwell Time. Reads the step sweep dwell time in seconds. | None |
| :SOURce:SWEep:POINts <N> | Set Sweep Points. Sets the number of points in the step sweep. | Number |
| :SOURce:SWEep:POINts? | Read Sweep Points. Reads the number of step sweep points. | None |
| :SOURce:SWEep:SPACing <Spacing> | Set Sweep Spacing. Selects linear or logarithmic spacing for the step sweep. | Text: LINear,LOGarithmic |
| :SOURce:SWEep:SPACing? | Read Sweep Spacing. Reads the current step sweep spacing. | None |
| :SOURce:SWEep:GENeration <Type> | Set Sweep Generation. Selects analog (ramp) or stepped sweep generation. | Text: ANALog,STEPped |
| :SOURce:SWEep:GENeration? | Read Sweep Generation. Reads the current sweep generation type. | None |
| :SOURce:LIST:TYPE <Type> | Set List Type. Selects whether the sweep uses the list table or the step sweep settings. | Text: LIST,STEP |
| :SOURce:LIST:TYPE? | Read List Type. Reads whether list or step sweep is selected. | None |
| :SOURce:LIST:MODE <Mode> | Set List Mode. Sets list processing to automatic advance or manual point selection. | Text: AUTO,MANual |
| :SOURce:LIST:MODE? | Read List Mode. Reads the current list processing mode. | None |
| :SOURce:LIST:DIRection <Dir> | Set List Direction. Sets the direction in which the list or step sweep is processed. | Text: UP,DOWN |
| :SOURce:LIST:MANual <Point> | Set List Manual Point. Selects the list point to output when list mode is set to manual. | Number |
| :SOURce:LIST:MANual? | Read List Manual Point. Reads the currently selected manual list point. | None |
| :SOURce:LIST:RETRace ON | Turn On List Retrace. Makes the sweep return to the first point at the end of each sweep cycle. | None |
| :SOURce:LIST:RETRace OFF | Turn Off List Retrace. Leaves the sweep at the last point at the end of each sweep cycle. | None |
| :SOURce:LIST:TRIGger:SOURce <Source> | Set List Trigger Source. Selects the trigger source that starts processing of the list or step sweep. | Text: BUS,IMMediate,EXTernal,KEY |
| :SOURce:LIST:TRIGger:SOURce? | Read List Trigger Source. Reads the current list trigger source. | None |
| :SOURce:LIST:FREQuency:POINts? | Read List Frequency Points. Reads the number of frequency entries in the list table. | None |
| :SOURce:LIST:POWer:POINts? | Read List Power Points. Reads the number of power entries in the list table. | None |
| :SOURce:SWEep:CPOINt? | Read Current Sweep Point. Reads the current point number of the running sweep. | None |
| :SOURce:DM:STATe ON | Turn On IQ Modulation. Enables the I/Q modulator. | None |
| :SOURce:DM:STATe OFF | Turn Off IQ Modulation. Disables the I/Q modulator. | None |
| :SOURce:DM:STATe? | Read IQ Modulation State. Reads whether the I/Q modulator is enabled. | None |
| :SOURce:DM:SOURce <Source> | Set IQ Source. Selects the I/Q source driving the modulator (external inputs, internal baseband generator, or their sum). | Text: EXTernal,INTernal,SUM |
| :SOURce:DM:SOURce? | Read IQ Source. Reads the currently selected I/Q modulation source. | None |
| :SOURce:DM:INTernal:CHANnel:OPTimization <Mode> | Set IQ Optimization. Optimizes the internal I/Q path for best EVM or best adjacent channel power. | Text: EVM,ACP |
| :SOURce:DM:INTernal:CHANnel:CORRection:STATe ON | Turn On IQ Channel Correction. Enables internal I/Q channel correction. | None |
| :SOURce:DM:INTernal:CHANnel:CORRection:STATe OFF | Turn Off IQ Channel Correction. Disables internal I/Q channel correction. | None |
| :SOURce:DM:IQADjustment:STATe ON | Turn On IQ Adjustments. Enables the manual I/Q adjustments (offset, gain, skew). | None |
| :SOURce:DM:IQADjustment:STATe OFF | Turn Off IQ Adjustments. Disables the manual I/Q adjustments. | None |
| :SOURce:DM:IQADjustment:GAIN <Gain> | Set IQ Gain Balance. Sets the I/Q gain balance in dB. | Number |
| :SOURce:DM:IQADjustment:GAIN? | Read IQ Gain Balance. Reads the current I/Q gain balance in dB. | None |
| :SOURce:DM:IQADjustment:IOFFset <Offset> | Set IQ I Offset. Sets the I channel DC offset as a percentage of full scale. | Number |
| :SOURce:DM:IQADjustment:QOFFset <Offset> | Set IQ Q Offset. Sets the Q channel DC offset as a percentage of full scale. | Number |
| :SOURce:DM:IQADjustment:QSKew <Skew> | Set IQ Quadrature Skew. Sets the quadrature angle error between the I and Q channels in degrees. | Number |
| :SOURce:DM:IQADjustment:DELay <Sec> | Set IQ Delay. Sets the delay applied to the I/Q signal in seconds. | Number |
| :SOURce:DM:EXTernal:POLarity <Pol> | Set External IQ Polarity. Sets the polarity of the externally applied I/Q signal. | Text: NORMal,INVerted |
| :SOURce:RADio:ARB:STATe ON | Turn On ARB. Enables the arbitrary waveform generator (dual ARB player). | None |
| :SOURce:RADio:ARB:STATe OFF | Turn Off ARB. Disables the arbitrary waveform generator. | None |
| :SOURce:RADio:ARB:STATe? | Read ARB State. Reads whether the ARB generator is enabled. | None |
| :SOURce:RADio:ARB:WAVeform <File> | Load ARB Waveform. Selects the waveform or sequence for the dual ARB player to play, e.g. "WFM1:my_waveform". | Text |
| :SOURce:RADio:ARB:WAVeform? | Read ARB Waveform. Reads the name of the waveform currently selected in the ARB player. | None |
| :SOURce:RADio:ARB:SCLock:RATE <Rate> | Set ARB Sample Clock. Sets the ARB sample clock rate in samples per second. | Number |
| :SOURce:RADio:ARB:SCLock:RATE? | Read ARB Sample Clock. Reads the ARB sample clock rate. | None |
| :SOURce:RADio:ARB:RSCaling <Percent> | Set ARB Runtime Scaling. Sets the ARB runtime waveform scaling as a percentage of full scale. | Number |
| :SOURce:RADio:ARB:RSCaling? | Read ARB Runtime Scaling. Reads the ARB runtime scaling percentage. | None |
| :SOURce:RADio:ARB:TRIGger:SOURce <Source> | Set ARB Trigger Source. Selects the trigger source that starts ARB waveform playback. | Text: KEY,EXT,BUS |
| :SOURce:RADio:ARB:TRIGger:SOURce? | Read ARB Trigger Source. Reads the current ARB trigger source. | None |
| :SOURce:RADio:ARB:TRIGger:TYPE <Type> | Set ARB Trigger Type. Selects how the ARB responds to a trigger event. | Text: CONTinuous,SINGle,SADVance,GATE |
| :SOURce:RADio:ARB:TRIGger:TYPE? | Read ARB Trigger Type. Reads the current ARB trigger type. | None |
| :SOURce:RADio:ARB:TRIGger:TYPE:GATE <Level> | Set ARB Gate Active Level. Sets which external gate level makes the ARB play in gated trigger mode. | Text: LOW,HIGH |
| :SOURce:RADio:ARB:BASeband:FREQuency:OFFSet <Freq> | Set ARB Baseband Frequency Offset. Sets a frequency offset applied to the ARB baseband signal in Hz. | Number |
| :SOURce:RADio:ARB:BASeband:FREQuency:OFFSet:PHASe:RESet | Reset ARB Baseband Offset Phase. Resets the phase accumulator of the ARB baseband frequency offset. | None |
| :SOURce:RADio:ARB:GENerate:SINE | Generate ARB Sine. Generates and loads a sine wave test waveform into ARB memory. | None |
| :SOURce:RADio:ARB:IQ:MODulation:ATTen <Atten> | Set ARB IQ Modulation Attenuation. Sets the I/Q modulator attenuation in dB used by the ARB. | Number |
| :SOURce:RADio:ARB:IQ:MODulation:ATTen:AUTO ON | Turn On ARB IQ Attenuation Auto. Lets the instrument set the ARB I/Q modulator attenuation automatically. | None |
| :SOURce:RADio:ARB:IQ:MODulation:ATTen:AUTO OFF | Turn Off ARB IQ Attenuation Auto. Allows the ARB I/Q modulator attenuation to be set manually. | None |
| :SOURce:IQ:OUTPut:IMPairments:AWGN:STATe ON | Turn On AWGN. Adds additive white Gaussian noise to the output signal. | None |
| :SOURce:IQ:OUTPut:IMPairments:AWGN:STATe OFF | Turn Off AWGN. Removes the added AWGN from the output signal. | None |
| :SOURce:IQ:OUTPut:IMPairments:AWGN:SNR <SNR> | Set AWGN SNR. Sets the signal-to-noise ratio of the added AWGN in dB. | Number |
| :SOURce:IQ:OUTPut:IMPairments:AWGN:SNR? | Read AWGN SNR. Reads the configured AWGN signal-to-noise ratio. | None |
| :SOURce:IQ:OUTPut:IMPairments:AWGN:BANDwidth <Freq> | Set AWGN Bandwidth. Sets the bandwidth of the added AWGN in Hz. | Number |
| :SOURce:IQ:OUTPut:IMPairments:PHASe:NOISe:STATe ON | Turn On Phase Noise Impairment. Enables the phase noise impairment generator. | None |
| :SOURce:IQ:OUTPut:IMPairments:PHASe:NOISe:STATe OFF | Turn Off Phase Noise Impairment. Disables the phase noise impairment generator. | None |
| :SOURce:AM:STATe ON | Turn On AM. Enables amplitude modulation. | None |
| :SOURce:AM:STATe OFF | Turn Off AM. Disables amplitude modulation. | None |
| :SOURce:AM:STATe? | Read AM State. Reads whether amplitude modulation is enabled. | None |
| :SOURce:AM:DEPTh:LINear <Percent> | Set AM Depth. Sets the linear AM depth as a percentage. | Number |
| :SOURce:AM:DEPTh:LINear? | Read AM Depth. Reads the linear AM depth percentage. | None |
| :SOURce:AM:SOURce <Source> | Set AM Source. Selects the source that generates the amplitude modulation. | Text: FUNCtion,FUNCtion2,SWEep,DUAL,NOISe,NOISe2,EXT,EXT2 |
| :SOURce:AM:SOURce? | Read AM Source. Reads the currently selected AM source. | None |
| :SOURce:AM:INTernal:FUNCtion:FREQuency <Freq> | Set AM Internal Frequency. Sets the internal AM modulating frequency in Hz. | Number |
| :SOURce:AM:INTernal:FUNCtion:SHAPe <Shape> | Set AM Internal Shape. Sets the internal AM modulating waveform shape. | Text: SINE,TRIangle,SQUare,RAMP,PULSe |
| :SOURce:AM:MODE <Mode> | Set AM Mode. Selects normal or deep amplitude modulation mode. | Text: DEEP,NORMal |
| :SOURce:FM:STATe ON | Turn On FM. Enables frequency modulation. | None |
| :SOURce:FM:STATe OFF | Turn Off FM. Disables frequency modulation. | None |
| :SOURce:FM:STATe? | Read FM State. Reads whether frequency modulation is enabled. | None |
| :SOURce:FM:DEViation <Freq> | Set FM Deviation. Sets the FM peak frequency deviation in Hz. | Number |
| :SOURce:FM:DEViation? | Read FM Deviation. Reads the FM peak frequency deviation in Hz. | None |
| :SOURce:FM:SOURce <Source> | Set FM Source. Selects the source that generates the frequency modulation. | Text: FUNCtion,FUNCtion2,SWEep,DUAL,NOISe,NOISe2,EXT,EXT2 |
| :SOURce:FM:INTernal:FUNCtion:FREQuency <Freq> | Set FM Internal Frequency. Sets the internal FM modulating frequency in Hz. | Number |
| :SOURce:FM:INTernal:FUNCtion:SHAPe <Shape> | Set FM Internal Shape. Sets the internal FM modulating waveform shape. | Text: SINE,SQUare,RAMP,PULSe |
| :SOURce:PM:STATe ON | Turn On PM. Enables phase modulation. | None |
| :SOURce:PM:STATe OFF | Turn Off PM. Disables phase modulation. | None |
| :SOURce:PM:STATe? | Read PM State. Reads whether phase modulation is enabled. | None |
| :SOURce:PM:DEViation <Dev> | Set PM Deviation. Sets the PM peak phase deviation in radians or degrees. | Number |
| :SOURce:PM:DEViation? | Read PM Deviation. Reads the PM peak phase deviation. | None |
| :SOURce:PM:SOURce <Source> | Set PM Source. Selects the source that generates the phase modulation. | Text: FUNCtion,FUNCtion2,SWEep,DUAL,NOISe,NOISe2,EXT,EXT2 |
| :SOURce:PM:INTernal:FUNCtion:FREQuency <Freq> | Set PM Internal Frequency. Sets the internal PM modulating frequency in Hz. | Number |
| :SOURce:PM:BANDwidth <Mode> | Set PM Bandwidth. Selects normal or high phase modulation bandwidth. | Text: NORMal,HIGH |
| :SOURce:PULM:STATe ON | Turn On Pulse Modulation. Enables pulse modulation. | None |
| :SOURce:PULM:STATe OFF | Turn Off Pulse Modulation. Disables pulse modulation. | None |
| :SOURce:PULM:STATe? | Read Pulse Modulation State. Reads whether pulse modulation is enabled. | None |
| :SOURce:PULM:SOURce <Source> | Set Pulse Source. Selects the internal pulse generator or an external pulse input. | Text: INTernal,EXTernal |
| :SOURce:PULM:SOURce? | Read Pulse Source. Reads the currently selected pulse modulation source. | None |
| :SOURce:PULM:INTernal:FREQuency <Freq> | Set Pulse Frequency. Sets the internal pulse repetition frequency in Hz. | Number |
| :SOURce:PULM:INTernal:PERiod <Sec> | Set Pulse Period. Sets the internal pulse period in seconds. | Number |
| :SOURce:PULM:INTernal:PERiod? | Read Pulse Period. Reads the internal pulse period in seconds. | None |
| :SOURce:PULM:INTernal:PWIDth <Sec> | Set Pulse Width. Sets the internal pulse width in seconds. | Number |
| :SOURce:PULM:INTernal:PWIDth? | Read Pulse Width. Reads the internal pulse width in seconds. | None |
| :SOURce:PULM:INTernal:DELay <Sec> | Set Pulse Delay. Sets the internal pulse delay in seconds. | Number |
| :SOURce:PULM:EXTernal:POLarity <Pol> | Set Pulse External Polarity. Sets the polarity of the external pulse modulation input. | Text: NORMal,INVerted |
| :SOURce:LFOutput:STATe ON | Turn On LF Output. Enables the low frequency (LF) output. | None |
| :SOURce:LFOutput:STATe OFF | Turn Off LF Output. Disables the low frequency (LF) output. | None |
| :SOURce:LFOutput:STATe? | Read LF Output State. Reads whether the LF output is enabled. | None |
| :SOURce:LFOutput:AMPLitude <Volt> | Set LF Amplitude. Sets the LF output amplitude in volts. | Number |
| :SOURce:LFOutput:AMPLitude? | Read LF Amplitude. Reads the LF output amplitude in volts. | None |
| :SOURce:LFOutput:FUNCtion:FREQuency <Freq> | Set LF Frequency. Sets the LF generator frequency in Hz. | Number |
| :SOURce:LFOutput:FUNCtion:FREQuency? | Read LF Frequency. Reads the LF generator frequency in Hz. | None |
| :SOURce:LFOutput:SOURce <Source> | Set LF Source. Selects the signal routed to the LF output connector. | Text: FUNCtion,FUNCtion2,SWEep,DUAL,NOISe,NOISe2 |
| Command | What it does | Arguments |
|---|---|---|
| :OUTPut:STATe ON | Turn On RF Output. Enables the RF output signal. | None |
| :OUTPut:STATe OFF | Turn Off RF Output. Disables the RF output signal. | None |
| :OUTPut:STATe? | Read RF Output State. Reads whether the RF output is currently ON or OFF. | None |
| :OUTPut:MODulation:STATe ON | Turn On Modulation. Enables the modulation of the RF output signal (front-panel MOD ON/OFF). | None |
| :OUTPut:MODulation:STATe OFF | Turn Off Modulation. Disables the modulation of the RF output signal. | None |
| :OUTPut:MODulation:STATe? | Read Modulation State. Reads whether RF modulation is enabled. | None |
| :OUTPut:BLANking:STATe ON | Turn On Output Blanking. Enables RF output blanking so the RF is muted while the synthesizer settles. | None |
| :OUTPut:BLANking:STATe OFF | Turn Off Output Blanking. Disables RF output blanking. | None |
| :OUTPut:BLANking:STATe? | Read Output Blanking State. Reads the RF output blanking state. | None |
| :OUTPut:BLANking:AUTO ON | Turn On Output Blanking Auto. Lets the instrument decide automatically when to blank the RF output. | None |
| :OUTPut:BLANking:AUTO OFF | Turn Off Output Blanking Auto. Disables automatic RF output blanking control. | None |
| Command | What it does | Arguments |
|---|---|---|
| :SYSTem:ERRor:NEXt? | Read Error. Reads and removes the next entry from the error queue. | None |
| :SYSTem:PRESet | System Preset. Returns the instrument to its preset state. | None |
| :SYSTem:PRESet:TYPE <Type> | Set Preset Type. Selects whether preset restores the factory (normal) or a user-defined state. | Text: NORMal,USER |
| :SYSTem:CAPability? | Read Capability. Returns the instrument capability string. | None |
| Command | What it does | Arguments |
|---|---|---|
| :MMEMory:DELete <File> | Delete File. Deletes the named file from instrument memory. | Text |
| :MMEMory:CATalog? | List Files. Lists the files in the current instrument directory. | None |
| Command | What it does | Arguments |
|---|---|---|
| <Output Variable>=<Equation> | Math. Variable equals an equation like (${Var_name}= ${Var_name}/2) | Number; Text |
| Command | What it does | Arguments |
|---|---|---|
| wait(<ms>) | Wait. Waits for number of milliseconds | Number |
| Command | What it does | Arguments |
|---|---|---|
| save2var <Variable_name> | Save2Variable. Saves last measurement to a variable | Text |
| Command | What it does | Arguments |
|---|---|---|
| *SAV <Reg>,<Seq> | Save State Slot. Saves the current instrument state to an internal register. | Number: 0-99; Number: 0-9 |
| *RCL <Reg>,<Seq> | Recall State Slot. Recalls the instrument state from an internal register. | Number: 0-99; Number: 0-9 |
| *IDN? | Identify. Returns the instrument identification string (manufacturer, model, serial, firmware). | None |
| *RST | Reset. Resets the instrument to its default state. | None |
| *CLS | Clear 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 |
| *WAI | Wait To Continue. Waits until all pending operations are complete before continuing. | None |
| *TRG | Trigger Bus. Generates a bus trigger when the instrument is in wait-for-trigger state. | None |
| *OPT? | Read Options. Returns the list of options installed in the instrument. | None |
This reference is generated from TestFlow's instrument library, which is drafted from Keysight's programming documentation for the N5172B and N5182B 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.
Yes. The Keysight N5172B accepts SCPI commands over its remote interfaces. TestFlow's instrument library holds 193 SCPI commands for it: 64 queries that read values or state, and 129 settings and actions.
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?, :OUTPut:STATe ON and :OUTPut:STATe?.
:OUTPut:STATe? (read rf output state). Reads whether the RF output is currently ON or OFF. The full list of queries is in the command reference on this page, grouped by subsystem.
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 N5172B through the TestFlow desktop app, and writes the report from the measured results.
Describe the test. TestFlow builds the workflow, runs it on your instruments, and writes the report. See it on a bench like yours.