HOME

TheInfoList



OR:

The Standard Commands for Programmable Instruments (SCPI; often pronounced "skippy") defines a standard for syntax and commands to use in controlling programmable test and measurement devices, such as automatic test equipment and
electronic test equipment Electronic test equipment is used to create signals and capture responses from electronic devices under test (DUTs). In this way, the proper operation of the DUT can be proven or faults in the device can be traced. Use of electronic test equipmen ...
.SCPI-1999 Specification; SCPI Consortium.
/ref>


Overview

SCPI was defined as an additional layer on top of the specification "Standard Codes, Formats, Protocols, and Common Commands". The standard specifies a common syntax,
command Command may refer to: Computing * Command (computing), a statement in a computer language * COMMAND.COM, the default operating system shell and command-line interpreter for DOS * Command key, a modifier key on Apple Macintosh computer keyboards * ...
structure, and data formats, to be used with all instruments. It introduced generic commands (such as CONFigure 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
power supply A power supply is an electrical device that supplies electric power to an electrical load. The main purpose of a power supply is to convert electric current from a source to the correct voltage, current, and frequency to power the load. As a ...
would implement the same DCPSUPPLY base functionality class. Instrument classes specify which subsystems they implement, as well as any instrument-specific features. The physical hardware communications link is not defined by SCPI. While it was originally created for the
IEEE-488 IEEE 488 is a short-range digital communications 8-bit parallel multi-master interface bus specification developed by Hewlett-Packard as HP-IB (Hewlett-Packard Interface Bus). It subsequently became the subject of several standards, and is ...
.1 (GPIB) bus, SCPI can also be used with
RS-232 In telecommunications, RS-232 or Recommended Standard 232 is a standard originally introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a ''DTE'' (''data terminal equipment'') such ...
,
RS-422 RS-422, also known as TIA/EIA-422, is a technical standard originated by the Electronic Industries Alliance that specifies electrical characteristics of a digital signaling circuit. It was meant to be the foundation of a suite of standards that ...
,
Ethernet Ethernet () is a family of wired computer networking technologies commonly used in local area networks (LAN), metropolitan area networks (MAN) and wide area networks (WAN). It was commercially introduced in 1980 and first standardized in 1 ...
,
USB Universal Serial Bus (USB) is an industry standard that establishes specifications for cables, connectors and protocols for connection, communication and power supply (interfacing) between computers, peripherals and other computers. A broad ...
,
VXIbus VME eXtensions for instrumentation bus (VXI bus) refers to standards for automated test based upon VMEbus. VXI defines additional bus lines for timing and triggering as well as mechanical requirements and standard protocols for configuration, me ...
, HiSLIP, etc. SCPI commands are
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
textual strings, which are sent to the instrument over the physical layer (e.g., IEEE-488.1). Commands are a series of one or more keywords, many of which take parameters. In the specification, keywords are written 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 a free PDF file.


SCPI history

First released in 1990, SCPI originated as an additional layer for
IEEE-488 IEEE 488 is a short-range digital communications 8-bit parallel multi-master interface bus specification developed by Hewlett-Packard as HP-IB (Hewlett-Packard Interface Bus). It subsequently became the subject of several standards, and is ...
. 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,
IEEE The Institute of Electrical and Electronics Engineers (IEEE) is a 501(c)(3) professional association for electronic engineering and electrical engineering (and associated disciplines) with its corporate office in New York City and its operat ...
introduced IEEE 488.2-1987 specification "''Standard Codes, Formats, Protocols, and Common Commands''", it was later revised in 1992 as IEEE 488.2-1992. While IEEE 488.2 provided a device-independent syntax, there was still no standard for instrument-specific commands. Commands to control the same class of instrument, e.g., multimeters, would vary between manufacturers and even models. The United States Air Force, and later Hewlett-Packard, recognized this problem. In 1989, HP developed their TML language which was the forerunner to SCPI. The IEC developed their own standards in parallel with the IEEE, with IEC 60625-2-1993 (IEC 625). In 2004, the IEEE and IEC combined their respective standards into a "dual logo" IEEE/IEC standard IEC 60488-2-2004,'' Part 2: Codes, Formats, Protocols and Common Commands'', replaces IEEE 488.2-1992 and IEC 60625-2-1993.


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 the ACQuire: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? ...


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 In telecommunications and computing, bit rate (bitrate or as a variable ''R'') is the number of bits that are conveyed or processed per unit of time. The bit rate is expressed in the unit bit per second (symbol: bit/s), often in conjunction w ...
. 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.


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 require an additional argument. Arguments are given after the command, and are separated by 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.


Integer arguments

For commands that accept
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
arguments, values may be specified in multiple
computer number format A computer number format is the internal representation of numeric values in digital device hardware and software, such as in programmable computers and calculators. Numerical values are stored as groupings of bits, such as bytes and words. The ...
s: decimal, hexadecimal, octal, binary. The last three formats are defined by IEEE 488.2, which SCPI is based upon. Decimal numbers ( radix 10) aren't prefixed, hexadecimal numbers (radix 16) are prefixed with # H or #h,
octal The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. This is to say that 10octal represents eight and 100octal represents sixty-four. However, English, like most languages, uses a base-10 number ...
numbers (radix 8) with # Q or # q, and
binary Binary may refer to: Science and technology Mathematics * Binary number, a representation of numbers using only two digits (0 and 1) * Binary function, a function that takes two arguments * Binary operation, a mathematical operation that ta ...
numbers (radix 2) with # B or #b. Hexadecimal digits may use either
uppercase Letter case is the distinction between the letters that are in larger uppercase or capitals (or more formally ''majuscule'') and smaller lowercase (or more formally ''minuscule'') in the written representation of certain languages. The writing ...
letters (ABCDEF), or
lowercase Letter case is the distinction between the letters that are in larger uppercase or capitals (or more formally ''majuscule'') and smaller lowercase (or more formally ''minuscule'') in the written representation of certain languages. The writing ...
letters (abcdef), or
mixed case Capitalization (American English) or capitalisation (British English) is writing a word with its first letter as a capital letter (uppercase letter) and the remaining letters in lower case, in writing systems with a case distinction. The term a ...
letters (aBcDeF). For octal, the letter " Q" was chosen instead of the letter " O" to minimize the visual confusion with the number " 0" (zero). The following argument examples are numerically equivalent: * Decimal: 26 * Hexadecimal: #H1A or #h1a * Octal: #Q32 or #q32 * Binary: #B11010 or #b11010


See also

*
IEEE-488 IEEE 488 is a short-range digital communications 8-bit parallel multi-master interface bus specification developed by Hewlett-Packard as HP-IB (Hewlett-Packard Interface Bus). It subsequently became the subject of several standards, and is ...
(GPIB) *
Virtual Instrument Software Architecture Virtual instrument software architecture (VISA) is a widely used application programming interface (API) in the test and measurement (T&M) industry for communicating with instruments from a computer. VISA is an industry standard implemented by sev ...
(VISA) * Instrument driver *
List of TCP and UDP port numbers This is a list of TCP and UDP port numbers used by protocols for operation of network applications. The Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP) only need one port for duplex, bidirectional traffic. They usually u ...
- scpi-raw on TCP port 5025 and UDP port 5025


References


External links

*{{Official website, http://www.ivifoundation.org/scpi/default.aspx, SCPI Consortium, official website ;Specifications
SCPI-1999 Specification, Volume 1-4
free, 819 page PDF file.

USD$44 cost, available as PDF file.
IEEE/IEC 60488-2-2004 Specification
USD$332 cost, available as PDF file. ;Test Equipment SCPI Examples
Keysight InfiniiVision 2000 X-Series Oscilloscopes Programmer's Guide
938 page PDF file. Electronic engineering Electronics standards Input/output Electronic test equipment