# Example SCPI code

The following sections contain SCPI command sequences for a performing a variety of tasks. These tasks are not specific to any particular programming language.

## Hardware Configuration

> :SYSTem:VSA:HARDware:DISCover

> :SYSTem:VSA:HARDware:CONFiguration:ADD "DualSa","TCPIP0::hostname01::inst0::INSTR","TCPIP0::hostname02::inst0::INSTR"

> :SYSTem:VSA:HARDware:CONFiguration:CATalog?

> :SYST:VSA:HARD:CONF:SEL "DualSa"

> :SYST:VSA:HARD:CONF:SEL?

The instrument connection strings are case sensitive and must match exactly what is shown in the Discovered Instruments dialog.

## Querying Summary Tables and Trace Data

> :MMEM:LOAD:DEMO "C:\Program Files\Agilent\89600 Software 15.0\89600 VSA Software\Help\Signals\802_11n\80211n-MCS15-40MHz-GF.htm"

> :INIT:CONT 0

> :INIT:IMM;*OPC?

> :FORMat:DATA ASC

> :TRAC1:DATA:NAME? // "IQ Meas1"

> :TRAC1:DATA? // Returns comma separated X,Y data for constellation in Trace A.

> // -0.780095100402832,0.465920984745026,...

> :FORMat:DATA REAL64

> :TRAC1:DATA? // Binary data formatted as an IEEE 488.2 binary block array of X,Y data for

> // constellation in Trace A in the format:

> // #Nnnnn<byte><byte>...

> :TRACe4:DATA:NAME? // "OFDM Error Summary1"

> :TRACe4:DATA:TABLe:COUNt? // 65

> :TRACe4:DATA:TABLe:NAME? // Returns the name of the items listed in the data table

> // "Ch1EVM","Ch2EVM","EVM","Ch1EVMPeak","Ch2EVMPeak","EVMPeak","Ch1PilotEVM",...

> :TRACe4:DATA:TABLe:NAME? 3 // "EVM"

> :TRACe4:DATA:TABLe:UNIT? 3 // "%rms"

> :TRACe4:DATA:TABLe:VALue? 3 // 0.831055700778961

## Working with Markers

> :INIT:IMM;*OPC?

> TRACe1:MARKer1:MAX

> TRACe1:MARKer1:Y?

> TRACe1:MARKer1:X?

> TRACe1:MARKer2:MAX

> TRACe1:MARKer2:DOWN

> TRAC:MARK2:TYPE DELTA

## Trace 3D Mapping Styles (Spectrogram, Cumulative History, Digital Persistence)

> TRAC1:SPECtrogram:STYle? // OFF

> TRAC1:SPECtrogram:STYle DEC // Enable Digital Persistence on Trace A

> TRAC2:SPECtrogram:STYle? // OFF

> TRAC2:SPECtrogram:STYle SPEC // Enable Spectrogram on Trace B

> TRACe:ADD

> TRACe:COUNt? // 3

> TRACe3:DATA:NAME? // "No Data"

> TRACe3:DATA:NAME "Spectrum1"

> TRAC3:SPECtrogram:STYle SUM // Enable Cumulative History on Trace C

> DISPlay:LAYout 3,1 // Set the window layout to 3 rows and 1 column

> INIT:CONT 1

## Recording and Playback

> :INPut:DATA HW

> :INPut:RECording:LENGth?

> :INPut:RECording:LENGth:MAXimum:TIME?

> :INPut:RECording:LENGth:MAXimum?

> :INPut:RECording:LENGth:MAXimum 1

> :INPut:RECording:LENGth:EXTRa?

> :INPut:RECording:LENGth:EXTRa 1

> :INITiate:RECording:IMMediate;

> :INITiate:RECording:WAIT? 30000 // Return 0 if the recording has not completed before the specified timeout (30 sec)

> // Return 1 if the recording has completed successfully

> :INIT:REC:IMM;WAIT? 30000 // Equivalent to previous 2 lines using abbreviated SCPI syntax

> :INPut:RECording:PLAY:LOOP 1

> :INITiate:RESume

> :MMEM:STORe:RECording "C:\Users\YourUserName\Documents\Agilent\89600B VSA\Signal01.sdf","sdf",1,1,1

17.00

Copyright © 2000-2013 Agilent Technologies, Inc. |