Overview
SCPI was defined as an additional layer on top of the specification "Standard Codes, Formats, Protocols, and Common Commands". The standard specifies a commonCONFigure
and MEASure
) that could be used with any instrument. These commands are grouped into subsystems. SCPI also defines several classes of instruments. For example, any controllable DCPSUPPLY
base functionality class. Instrument classes specify which subsystems they implement, as well as any instrument-specific features.
The physical hardware communications link (physical layer) is not defined by SCPI. While it was originally created for the IEEE-488.1 (GPIB) bus, SCPI can also be used with RS-232, RS-422, RS-485, CONFigure
: The entire keyword can be used, or it can be abbreviated to just the uppercase portion. Responses to query commands are typically ASCII strings. However, for bulk data, binary formats can be used.
The SCPI specification consists of four volumes: Volume 1: "Syntax and Style", Volume 2: "Command Reference", Volume 3: "Data Interchange Format", Volume 4: "Instrument Classes". The specification was originally released as non-free printed manuals, then later as one free SCPI history
First released in 1990, SCPI originated as an additional layer for IEEE-488. IEEE-488.1 specified the physical and electrical bus, and IEEE-488.2 specified protocol and data format, but neither specified instrument commands. Different manufacturers, and even different models, of the same type of instrument would use different command sets. SCPI created a standard which could be common across all manufacturers and models. It requires use of the IEEE-488.2 data formats, but does not mandate the IEEE-488.1 bus. In 2002-2003, the ''SCPI Consortium'' voted to become part of the ''IVI Foundation'' (Interchangeable Virtual Instruments).IEEE 488.2 history
In 1987,Command syntax
SCPI commands to an instrument may either perform a ''set'' operation (e.g. switching a power supply on) or a ''query'' operation (e.g. reading a voltage). Queries are issued to an instrument by appending a question-mark to the end of a command. Some commands can be used for both setting and querying an instrument. For example, the data-acquisition mode of an instrument could be set by using theACQuire:MODe
command or it could be queried by using the ACQuire:MODe?
command. Some commands can both set and query an instrument at once. For example, the *CAL?
command runs a self-calibration routine on some equipment, and then returns the results of the calibration.
Similar commands are grouped into a hierarchy or "tree" structure. For example, any instruction to read a measurement from an instrument will begin with "MEASure
". Specific sub-commands within the hierarchy are nested with a colon (:
) character. For example, the command to "Measure a DC voltage" would take the form MEASure:VOLTage:DC?
, and the command to "Measure an AC current" would take the form MEASure:CURRent:AC?
.
:MEASure
:VOLTage
:DC?
:AC?
:CURRent
:DC?
:AC?
...
Case
Though the command syntax above shows commands in mixed case, SCPI is not case sensitive. :For example, forVOLTage
, all of the following are valid representations:VOLTAGE
, voltage
, Voltage
, VoLtAgE
.
Abbreviating commands
The command syntax shows some characters in a mixture of upper and lower case. Abbreviating the command to only sending the upper case has the same meaning as sending the upper and lower case command. :For example, the command “SYSTem:COMMunicate:SERial:BAUD 2400
” would set an RS-232 serial communications interface to 2400 bit/s. This could also alternatively be abbreviated “SYST:COMM:SER:BAUD 2400
”. The query command “SYSTem:COMMunicate:SERial:BAUD?
” or “SYST:COMM:SER:BAUD?
” would instruct the instrument to report its current baud rate.
The only valid commands are the short form and long form of each command, all other subset variations are invalid.
:For example, for COMMunicate
, only COMM
(short form) and COMMUNICATE
(long form) are valid, but COM
, COMMUN
, COMMUNIC
subsets are invalid, also appended letters are invalid too, such as COMMUNICATED
.
Concatenating commands
Multiple commands can be issued to an instrument in a single string. They are made of simple commands separated by a semicolon character (;
).
:For example, the command to "Measure a DC voltage then measure an AC current" would be issued as MEASure:VOLTage:DC?;:MEASure:CURRent:AC?
.
Simple commands which start with a colon (:
) are interpreted with respect to the root of the command tree. Otherwise, they refer implicitly to the last node of the previous command (unless they already begin with an asterisk). For example,
:SOURce:FREQuency:STARt 100;STOP 200
is a shorthand for the message
:SOURce:FREQuency:STARt 100;:SOURce:FREQuency:STOP 200
Arguments
Some commands accept or require one or more additional arguments. Arguments are given after the command, and are separated from the command using a space. For example, the command to set the trigger mode of an instrument to "normal" may be given as "TRIGger:MODe NORMal
". Here, the word "NORMal
" is used as the argument to the "TRIGger:MODe
" command. When multiple arguments are provided, the arguments are written as a comma-separated list. For example, a query command that performs an AC Volts measurement on a digital multimeter, using the meter's 10 VRMS measurement range, and displaying the measured voltage value with 4-1/2 digits of resolution, would be written as "MEASure:VOLTage:AC? 10,4
".
Integer arguments
For commands that accept# H
or #h
, # Q
or # q
, and binary numbers (radix 2) with # B
or #b
. Hexadecimal digits may use either 26
* Hexadecimal: #H1A
or #h1a
* Octal: #Q32
or #q32
* Binary: #B11010
or #b11010
488.2 commands
Since SCPI was defined as an additional layer on top of the IEEE 488.2 specification, a SCPI compliant device should recognize various 488.2 commands too. These commands might also be known unofficially as asterisk commands (or star commands), because they start with the*
character.
According to section 4.1.1 of Volume 1 of SCPI, all SCPI devices must implement the following 488.2 commands. In the real world some low-end devices may only support a subset of these 488.2 commands, or may even accept the commands but not perform any operation. A user should check the official programmers manual for each device before assuming all of these 488.2 commands are supported.
* *CLS
* *ESE
* *ESE?
* *ESR?
* *IDN?
* *OPC
* *OPC?
* *RST
* *SRE
* *SRE?
* *STB?
* *TST?
* *WAI
According to section 4.1.2 of Volume 1 of SCPI, all other 488.2 commands not listed above are considered optional and not required by SCPI.
* *AAD
* *CAL?
* *DDT
* *DDT?
* *DLF
* *DMC
* *EMC
* *EMC?
* *GMC?
* *IST?
* *LMC?
* *LRN?
* *OPT?
* *PCB
* *PMC
* *PRE
* *PRE?
* *PSC
* *PSC?
* *PUD
* *PUD?
* *RCL
* *RDT
* *RDT?
* *SAV
* *TRG
* *RMC
* *SDS
See also
* IEEE-488 (GPIB) * Virtual Instrument Software Architecture (VISA) * Instrument driver *References
External links
{{CommonscatProgramming Manual Examples
;Multimeters