4 - Introduction to Programming
32
Introduction to SCPI
SCPI (Standard Commands for Programmable Instruments) is a programming language for controlling
instrument functions over the GPIB. SCPI is layered on top of the hardware-portion of IEEE 488.2. The
same SCPI commands and parameters control the same functions in different classes of instruments.
Conventions Used in This Guide
Angle brackets < > Items within angle brackets are parameter abbreviations. For example, <NR1>
indicates a specific form of numerical data.
Vertical bar | Vertical bars separate alternative parameters. For example, VOLT | CURR
indicates that either "VOLT" or "CURR" can be used as a parameter.
Square Brackets [ ] Items within square brackets are optional. The representation [SOURce:].
VOLTage means that SOURce: may be omitted.
Braces { } Braces indicate parameters that may be repeated zero or more times. It is used
especially for showing arrays. The notation <A>{<,B>} shows that parameter "A"
must be entered, while parameter "B" may be omitted or may be entered one or
more times.
Parentheses ( ) Items within parentheses are used in place of the usual parameter types to specify a
channel list. The notation (@1:3) specifies a channel list that includes channels 1,
2, and 3. The notation (@1,3) specifies a channel list that includes only channels 1
and 3.
Computer font Computer font is used to show program lines in text.
TRIGger:ACQuire:SOURce BUS shows a program line.
Types of SCPI Commands
SCPI has two types of commands, common and subsystem.
Common commands generally are not related to specific operation but to controlling overall dc
source functions, such as reset, status, and synchronization. All common commands consist of a
three-letter mnemonic preceded by an asterisk: *RST *IDN? *SRE 8
Subsystem commands perform specific dc source functions. They are organized into an inverted tree
structure with the "root" at the top. The following figure shows a portion of a subsystem command
tree, from which you access the commands located along the various paths. You can see the complete
tree in Appendix. D.
:OUTPut [:STATe]
:OSCProtect
:PROTection
ROOT
:CLEar
:STATus
:CONDition?
:OPERation [:EVEN]?
[:STATe]
Figure 4-1. Partial Command Tree