SCPI (Standard Commands for Programmable Instrument) is a standard instruction set for programmable
devices under IEEE 488.2. SCPI commands are divided into two parts: IEEE 488.2 Common Commands
and SCPI Instrument Specific Control Commands.
Common commands are commands that the instrument specified in IEEE 488.2 must support. Its syntax
and semantics follow IEEE 488.2. Common commands are independent from the measurement and are
used to control reset, self-test and status inspection. For an introduction of SCPI common commands,
refer to the relative chapter below.
SCPI instrument-specific control commands are used to measure, read data, and toggle switches,
including all measurement functions and specific functions.。
Command Format
The SCPI command is a tree hierarchy that includes multiple subsystems, each consisting of a root key
and one or more level keys. The command line usually begins with a colon ":"; the keywords are
separated by the colon ":" followed by the optional parameter settings; the question mark "?" is added
after the command line to query this function; the commands and parameters separate with "space".
E.g
:CALCulate:BANDwidth:NDB <rel_ampl>
:CALCulate:BANDwidth:NDB?
CALCulate is the root keyword of the command, BANDwidth and NDB are the second level, third level
keywords. The command line starts with a colon ":" and at the same time separates keywords at all levels,
<rel_ampl> indicates configurable parameters; the question mark "?" indicates a query; the command:
CALCulate:BANDwidth:NDB and parameter <rel_ampl> "separate.
In some commands with parameters, it is common to use commas "," to separate the parameters, for
example:
:SYSTem:DATE <year>,<month>,<day>
Symbol Description
The following four symbols are not part of the SCPI command, but are usually used to assist in specifying
the parameters in the command.。
Brace { }
Parameters in brace are optional and can be set one or more times or even don’t set them. E.g:
1
The frequency and magnitude of {, <freq>, <rel_ampl>} in the command [:SENSe]:CORRection:CSET
<n>:DATA <freq>, <rel ampl> {, <freq>, <rel ampl>} can be omitted, or to set one or more pairs of
frequency and amplitude parameters.
Vertical bar |
Vertical bars are used to separate multiple parameter options, one of which must be selected when
sending commands. E.g,
In DISPlay:MENU:STATe OFF | ON | 0 | 1 command, the parameters that can be selected are "OFF", "ON",
"0" or "1".
Square bracket [ ]
The contents of the square bracket (command key) are optional and are executed regardless of whether
they are omitted. E.g
[:SENSe]:CORRection:OFFSet[:MAGNitude]?
The effect of sending the following three commands is the same:
:CORRection:OFFSet?
:CORRection:OFFSet:MAGNitude?
:SENSe:CORRection:OFFSet?
Triangle bracket < >
The parameters in the triangle brackets must be replaced with a valid value. E.g:
:DISPlay:BRIGtness <integer>
:DISPlay:BRIGtness 10
Parameter Type
The commands contain 8 kinds of parameters, different parameters have different setting methods.
(1) arbitrary block
A specified length of arbitrary data, for example,
#6377512xxxxx . . . where
6 indicates that the following 6 digits (377512) specify the length of the data in bytes; xxxxx ...
indicates the data or #0xxxxx...<LF><&EOI>
(2) boolean
Boolean numbers or values, for example,
ON or ≠ 0
OFF or 0
(3) discrete
A list of specific values, for example,
MIN, MAX
(4) NR1 numeric
2
Integers, for example,
0, 2, 30, -5
(5) NR2 numeric
Decimal numbers, for example,
0.6, 3.1415926, -2.6
(6) NR3 numeric
Floating point numbers, for example,
3.1415E-7, -8.2E3
(7) NRf numeric
Flexible decimal number that may be type NR1, NR2 or NR3
See NR1, NR2, and NR3 examples
(8) string
Alphanumeric characters (must be within quotation marks)
"Model, 123456"
Command abbreviation
All commands are not case sensitive, you can use all uppercase or lowercase. However, if you want to
abbreviate, you must enter all capital letters in the command format, for example:
:CALCulate:BANDwidth:NDB? can be abbreviated into:CALC:BAND:NDB?
Third-party programming entrance
The analyzer and the computer can communicate through the following interfaces: LAN interface and
USB interface. please refer to the product's user manual for the use of various communication interface.
When using commands to program, all command words are sent and recognized as ASCII strings for
operation and secondary development.
You can implement the following actions by programming:
Set the analyzer
Implement the measurement
Get data from the spectrum analyzer (instrument working status and measurement data results)
3
SCPI Command Set
Description
Queries the manufacturer, model number, serial number, and firmware version
of the instrument.
Query Syntax
*IDN?
Return parameter
<string>
Returns the instrument identification as a string in the following
format:
<Manufacturer>,<Model Number>,<Serial Number>,<Firmware
Version>
Description
perform a factory reset.
Syntax
*RST
In this command set, unless otherwise specified, the query function returns "N/A" (without the quotes)
when the function is optional and not installed.And when the query function is not turned on or the type
does not match, it returns "ERR" (without quotes).
IEEE 488.2 Common Commands
The IEEE standard defines some common commands for querying basic information about the instrument
or performing common basic operations. The commands usually start with "*" and the command
keyword is three characters in length.
*IDN?
*RST
4
CALCulate Commands
Description
Sets the power level, below the peak of the signal, at which the signal bandwidth
will be measured by the markers.
Turns NdB BW off.
Turns NdB BW on.
Turns NdB BW off.
Turns NdB BW on.
Return parameter
01NdB BW is off.
NdB BW is on.
Example
:CALC:BAND ON
:CALCulate:BWIDth|BANDwidth:NDB
:CALCulate:BWIDth|BANDwidth:RESult?
:CALCulate:BWIDth|BANDwidth[:STATe]
5
:CALCulate:MARKer:AOFF
Description
Turns all the markers off.
Syntax
:CALCulate:MARKer:AOFF
Example
:CALC:MARK:AOFF
Description
Sets or queries the state of continuous peaking. It continuously puts the selected
marker on the highest displayed signal peak. This function is intended to
maintain the marker on signals with a frequency that is changing, and an
amplitude that is not changing.
<NR1> Marker number 1 to 5
Turns continuous peaking off.
Turns continuous peaking on.
Turns continuous peaking off.
Turns continuous peaking on.
Return parameter
01Continuous peaking is off.
Continuous peaking is on.
Example
:CALC:MARK1:CPE ON
Description
Changes the center frequency of the analyzer to the frequency difference
between the two markers. This command is not available if the delta marker is
off.
Syntax
:CALCulate:MARKer<n>:DELTa[:SET]:CENTer
Parameter
<n>
<NR1> Marker number 1 to 5
Example
:CALC:MARK1:DELT:CENT
Description
Changes the span of the analyzer to the frequency difference between the two
markers. This command is not available if the delta marker is off.
Syntax
:CALCulate:MARKer<n>:DELTa[:SET]:SPAN
Parameter
<n>
<NR1> Marker number 1 to 5
Example
:CALC:MARK1:DELT:SPAN
:CALCulate:MARKer<n>:CPEak[:STATe]
:CALCulate:MARKer<n>:DELTa[:SET]:CENTer
:CALCulate:MARKer<n>:DELTa[:SET]:SPAN
6
SCPI Introduction
Description
Sets or queries the frequency counter resolution in Hz.
<NR1> Marker number 1 to 5.
Normal marker
Delta marker
Example
:CALC:MARK1:MODE NORM
Description
Sets or queries the state of the Marker Noise function for the specified marker.
This function measures the average noise level at the marked point and then
normalize this value to 1 Hz bandwidth.
<NR1> Marker number 1 to 5.
Turns Marker Noise off.
Turns Marker Noise on.
Turns Marker Noise off.
Turns Marker Noise on.
Return parameter
01Marker Noise is off.
Marker Noise is on.
Example
:CALC:MARK1:PHN ON
Description
Returns the normalized noise level over a BW of 1Hz from the marker position.
Query Syntax
:CALCulate:MARKer:PHNoise:Y?
Return parameter
<NR2>
Normalized noise level in dBm.
Example
:CALC:MARK:PHN:Y?
returns
127.8
:CALCulate:MARKer<n>:MODE
:CALCulate:MARKer<n>:PHNoise[:STATe]
:CALCulate:MARKer:PHNoise:Y?
9
SCPI Command Set
Description
Sets the center frequency equal to the specified marker frequency, which moves
the marker to the center of the screen. In delta marker mode, the center
frequency is set to the delta marker frequency. This command is not available in
zero span.
Syntax
:CALCulate:MARKer<n>[:SET]:CENTer
Parameter
<n>
<NR1> Marker number 1 to 5
Example
:CALC:MARK1:CENT
Description
Sets the reference level to the specified marker amplitude. In delta marker mode,
the reference level is set to the delta marker amplitude.
Syntax
:CALCulate:MARKer<n>[:SET]:RLEVel
Parameter
<n>
<NR1> Marker number 1 to 5
Example
:CALC:MARK1:RLEV
Description
Sets the start frequency to the value of the specified marker frequency. In delta
marker mode, the start frequency is set to the delta marker frequency. This
command is not available in zero span.
Syntax
:CALCulate:MARKer<n>[:SET]:STARt
Parameter
<n>
<NR1> Marker number 1 to 5
Example
:CALC:MARK1:STAR
Description
Sets the center frequency step size equal to the specified marker frequency. In
delta marker mode, the center frequency step size is set to the delta marker
frequency. This command is not available in zero span.
Syntax
:CALCulate:MARKer<n>[:SET]:STEP
Parameter
<n>
<NR1> Marker number 1 to 5
Example
:CALC:MARK1:STEP
:CALCulate:MARKer<n>[:SET]:CENTer
:CALCulate:MARKer<n>[:SET]:RLEVel
:CALCulate:MARKer<n>[:SET]:STARt
:CALCulate:MARKer<n>[:SET]:STEP
10
SCPI Command Set
Description
Sets the stop frequency to the value of the specified marker frequency. In delta
marker mode, the stop frequency is set to the delta marker frequency. This
command is not available in zero span.
Turns the table off.
Turns the table on.
Turns the table off.
Turns the table on.
Return parameter
01The table is off.
The table is on.
Example
:CALC:MARK:TABL:STAT ON
:CALCulate:MARKer<n>[:SET]:STOP
:CALCulate:MARKer<n>:STATe
:CALCulate:MARKer:TABLe:STATe
11
SCPI Command Set
Description
Sets or queries the state of continuous peaking. It continuously puts the selected
marker on the highest displayed signal peak. This function is intended to
maintain the marker on signals with a frequency that is changing, and an
amplitude that is not changing.