Introduction to the SCPI Language
SCPI (Standard Commands for Programmable Instruments) is an ASCII-based instrument command lan-
guage designed for test and measurement instruments. SCPI commands are based on a hierarchical struc-
ture, also known as a tree system. In this system, associated commands are grouped together under a
common node or root, thus forming subsystems. A portion of the SENSe subsystem is shown below to
illustrate the tree system.
SENSe:
FUNCtion:
[:ON] "function"
[:ON]?
ROSCillator:
EXTernal:FREQuency?
SOURce { INTernal|EXTernal|AUTO }
SENSe is the root keyword of the command, FUNCtion and ROSCillator are second-level keywords, and
ON and SOURce are third-level keywords. Acolon ( : ) separates a command keyword from a lower-level
keyword.
Syntax Conventions
The format used to show commands is illustrated below:
SAMPle:COUNt {<count> | MINimum | MAXimum | DEFault}
The command syntax shows most commands (and some parameters) as amixture of upper- and lower-
case letters. The upper-case letters indicate the abbreviated spelling for the command. For shorter pro-
gram lines, you can send the abbreviated form. For better program readability, you can send the long
form.
For example, in the above syntax statement, SAMP and SAMPLE are both acceptable forms. You can use
upper- or lower-case letters. Therefore, SAMPLE, samp, and Samp are all acceptable. Other forms, such
as SAM and SAMPL, are not valid and will generate an error.
l Braces ( { } ) enclose the parameter choices for a given command string. The braces are not sent with the com-
mand string.
l A vertical bar ( | ) separates multiple parameter choices for a given command string. For example, {<count>
|MINimum | MAXimum | DEFault} in the above command indicates that you can specify a numeric range para-
meter, or "MINimum", "MAXimum", or "DEFault". The bar is not sent with the command string.
l Triangle brackets ( < > ) indicate that you must specify a value for the enclosed parameter. For example, the
above syntax statement shows the <range> parameter enclosed in triangle brackets. The brackets are not
sent with the command string. You must specify a value for the parameter (for example "SAMP:COUN 10")
unless you select one of the other options shown in the syntax (for example "SAMP:COUN MIN").
l Some parameters are enclosed in square brackets ( [ ] ). This indicates that the parameter is optional and can
be omitted. Thebrackets are not sent with the command string. If you donot specify a value for an optional
parameter, the instrument chooses a default value.
Introduction to the SCPI Language
12 Keysight 53220A/53230A Programmer's Reference