Remote Spectrum Monitor User Guide : Programming with SCPI : SCPI Command Programming Examples
 
SCPI Command Programming Examples
This section provides information on spectrum trace data and I/Q data via SCPI commands.
Spectrum Trace Data via SCPI
SCPI commands are sent to port 9001 of the instrument. Below is a simple example to capture spectrum trace data.
SENS:FREQ:START 88 MHz
SENS:FREQ:STOP 108 MHz
 
//Set sweep mode
SWEEP:MODE FFT
 
//Set RBW 30 kHz
BANDWIDTH 30 KHz
 
//Set Reference Level to -30 dBm
DISP:WIND:TRAC:Y:SCAL:RLEV -30
 
//Set to single sweep
INIT:CONT OFF
 
//Get trace amplitude data
TRACE:DATA? 1
 
//Get number of display points to calculate frequency array
DISP:POIN?
Spectrum Trace Data Format
Trace data uses SCPI standard (IEEE 488.2) block data format. The data format is '#AXD', where D is a comma separated list of amplitudes (in ASCII), X is one or more ASCII digits specifying the number of bytes in D, and A is a single ASCII digit specifying the number of digits in X.
Trace data only contains amplitude. The frequency information for each point is
Frequency = [start_frequency + (span/(display_points-1))*N
N = 0, 1, … display_points