Structure and Syntax of Device Messages R&S®SML / R&S®SMV03
1090.3123.12 E-6 5.6
Structure and Syntax of Device Messages
Introduction to SCPI
SCPI (Standard Commands for Programmable Instruments) describes a standard command set for
programming instruments, irrespective of the type of instrument or manufacturer. The objective of the
SCPI consortium is to standardize the device-specific commands to a large extent. For this purpose, a
model was developed which defines identical functions of a device or of different devices. Command
systems were generated which are assigned to these functions. Thus it is possible to address identical
functions with identical commands. The command systems are of a hierarchical structure. Fig. 5-1
illustrates this tree structure using a section of command system SOURce, which operates the signal
sources of the devices. The other examples concerning syntax and structure of the commands are
derived from this command system.
SCPI is based on standard IEEE 488.2, ie it uses the same basic syntax elements as well as the
common commands defined in this standard. Part of the syntax of the device responses is defined in
greater detail than in standard IEEE 488.2 (see section "Responses to Queries").
Structure of Commands
Commands consist of a header and, in most cases, one or several parameters. The header and the
parameters are separated by a "white space" (ASCII code 0 to 9, 11 to 32 decimal, eg a blank). Headers
may consist of several key words. Queries are formed by appending a question mark directly to the
header.
Note: The commands used in the following examples are not in every case implemented in the
instrument.
Common commands Common (device-independent) commands consist of a header
preceded by an asterisk "*" and of one or several parameters, if any.
Examples: *RST RESET, resets the instrument
*ESE 253 EVENT STATUS ENABLE, sets the bits of
the event status enable register
*ESR? EVENT STATUS QUERY, queries the
contents of the event status register
Device-specific commands The following examples are general, they are not necessarly available
with R&S SML / R&S SMV03.
Hierarchy: Device-specific commands are of a hierarchical structure (see Fig. 5-1).
The different levels are represented by combined headers. Headers of
the highest level (root level) have only one key word. This key word
denotes a complete command system.
Example: SOURce
This key word denotes the SOURce command system.
For commands of lower levels, the complete path has to be specified,
starting on the left with the highest level, the individual key words being
separated by a colon ":".
Example: SOURce:FM:EXTernal:COUPling AC
This command is at the fourth level of the SOURce system. It selects
AC coupling of the external signal source.