Standard Commands for Programmable Instruments

Last updated
Rear-panel of Tektronix TDS210 digital oscilloscope showing RS-232 (DE9) and IEEE-488 connectors that accept remote SCPI commands. Digitaloszilloskop Schnittstellen IMGP1974 WP.jpg
Rear-panel of Tektronix TDS210 digital oscilloscope showing RS-232 (DE9) and IEEE-488 connectors that accept remote SCPI commands.
Rear-panel of Rigol DS1074Z digital oscilloscope showing USB-B and Ethernet (RJ45) connectors that accept remote SCPI commands. Rigol DS1074Z Oscilloscope - back.jpg
Rear-panel of Rigol DS1074Z digital oscilloscope showing USB-B and Ethernet (RJ45) connectors that accept remote SCPI commands.

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. [3]

Contents

Overview

SCPI was defined as an additional layer on top of the IEEE 488.2-1987 specification "Standard Codes, Formats, Protocols, and Common Commands". [4] The standard specifies a common syntax, command 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 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.1 (GPIB) bus, SCPI can also be used with RS-232, RS-422, Ethernet, USB, VXIbus, HiSLIP, etc.

SCPI commands are ASCII 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. [3]

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". [3] The specification was originally released as non-free printed manuals, then later as a free PDF file.

SCPI history

First released in 1990, [3] [5] 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. [6]

In 2002-2003, the SCPI Consortium voted to become part of the IVI Foundation (Interchangeable Virtual Instruments). [6]

IEEE 488.2 history

In 1987, IEEE introduced IEEE 488.2-1987 specification "Standard Codes, Formats, Protocols, and Common Commands", it was later revised in 1992 as IEEE 488.2-1992. [7]

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, [8] and later Hewlett-Packard, recognized this problem. In 1989, HP developed their TML language [9] 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, [10] replaces IEEE 488.2-1992 and IEC 60625-2-1993. [11]

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. [3] 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. [3]

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.

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. [3] 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 integer arguments, values may be specified in multiple computer number formats: decimal, hexadecimal, octal, binary. The last three formats are defined by IEEE 488.2, [10] which SCPI is based upon. [3] Decimal numbers (radix 10) aren't prefixed, hexadecimal numbers (radix 16) are prefixed with #H or #h, octal numbers (radix 8) with #Q or #q , and binary numbers (radix 2) with #B or #b. Hexadecimal digits may use either uppercase letters (ABCDEF), or lowercase letters (abcdef), or mixed case letters (aBcDeF). For octal, the letter "Q" was chosen instead of the letter "O" to minimize the visual confusion with the number "0" (zero). [10]

The following argument examples are numerically equivalent:

See also

Related Research Articles

In mathematics and computing, the hexadecimal numeral system is a positional numeral system that represents numbers using a radix (base) of sixteen. Unlike the decimal system representing numbers using ten symbols, hexadecimal uses sixteen distinct symbols, most often the symbols "0"–"9" to represent values 0 to 9, and "A"–"F" to represent values from ten to fifteen.

<span class="mw-page-title-main">OSI model</span> Model of communication of seven abstraction layers

The Open Systems Interconnection model is a reference model from the International Organization for Standardization (ISO) that "provides a common basis for the coordination of standards development for the purpose of systems interconnection." In the OSI reference model, the communications between systems are split into seven different abstraction layers: Physical, Data Link, Network, Transport, Session, Presentation, and Application.

<span class="mw-page-title-main">Multimeter</span> Electronic measuring instrument that combines several measurement functions in one unit

A multimeter is a measuring instrument that can measure multiple electrical properties. A typical multimeter can measure voltage, resistance, and current, in which case can be used as a voltmeter, ohmmeter, and ammeter. Some feature the measurement of additional properties such as temperature and capacitance.

<span class="mw-page-title-main">IEEE-488</span> General Purpose Interface Bus (GPIB) specification

IEEE 488, also known as HP-IB and generically as GPIB, is a short-range digital communications 8-bit parallel multi-master interface bus specification developed by Hewlett-Packard. It subsequently became the subject of several standards.

<span class="mw-page-title-main">Electronic test equipment</span> Testing appliance for electronics systems

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 equipment is essential to any serious work on electronics systems.

The IEEE Standard for Floating-Point Arithmetic is a technical standard for floating-point arithmetic established in 1985 by the Institute of Electrical and Electronics Engineers (IEEE). The standard addressed many problems found in the diverse floating-point implementations that made them difficult to use reliably and portably. Many hardware floating-point units use the IEEE 754 standard.

LAN eXtensions for Instrumentation (LXI) is a standard which defines the communication protocols for instrumentation and data acquisition systems using Ethernet.

cmp (Unix) Computer file comparison utility

In computing, cmp is a command-line utility on Unix and Unix-like operating systems that compares two files of any type and writes the results to the standard output. By default, cmp is silent if the files are the same; if they differ, the byte and line number at which the first difference occurred is reported. The command is also available in the OS-9 shell.

<span class="mw-page-title-main">Automatic test equipment</span> Apparatus used in hardware testing that carries out a series of tests automatically

Automatic test equipment or automated test equipment (ATE) is any apparatus that performs tests on a device, known as the device under test (DUT), equipment under test (EUT) or unit under test (UUT), using automation to quickly perform measurements and evaluate the test results. An ATE can be a simple computer-controlled digital multimeter, or a complicated system containing dozens of complex test instruments capable of automatically testing and diagnosing faults in sophisticated electronic packaged parts or on wafer testing, including system on chips and integrated circuits.

<span class="mw-page-title-main">JSON</span> Open standard file format and data interchange

JSON is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays. It is a commonly used data format with diverse uses in electronic data interchange, including that of web applications with servers.

In the C programming language, data types constitute the semantics and characteristics of storage of data elements. They are expressed in the language syntax in form of declarations for memory locations or variables. Data types also determine the types of operations or methods of processing of data elements.

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 several T&M companies, such as, Anritsu, Bustec, Keysight Technologies, Kikusui, National Instruments, Rohde & Schwarz, and Tektronix.

SDI-12 is an asynchronous serial communications protocol for intelligent sensors that monitor environment data. These instruments are typically low-power, are used at remote locations, and usually communicate with a data logger or other data acquisition device. The protocol follows a client-server configuration whereby a data logger requests data from the intelligent sensors, each identified with a unique address.

Instrument control consists of connecting a desktop instrument to a computer and taking measurements.

<span class="mw-page-title-main">Digital Addressable Lighting Interface</span> Trademark for network-based product

Digital Addressable Lighting Interface (DALI) is a trademark for network-based products that control lighting. The underlying technology was established by a consortium of lighting equipment manufacturers as a successor for 1-10 V/0–10 V lighting control systems, and as an open standard alternative to several proprietary protocols. The DALI, DALI-2 and D4i trademarks are owned by the lighting industry alliance, DiiA.

od is a command on various operating systems for displaying ("dumping") data in various human-readable output formats. The name is an acronym for "octal dump" since it defaults to printing in the octal data format.

An instrument driver, in the context of test and measurement (T&M) application development, is a set of software routines that simplifies remote instrument control. Instrument drivers are specified by the IVI Foundation and define an I/O abstraction layer using the virtual instrument software architecture (VISA). The VISA hardware abstraction layer provides an interface-independent communication channel to T&M instruments. Furthermore, the instrument drivers encapsulate the Standard Commands for Programmable Instruments (SCPI) commands, which are an ASCII-based set of commands for reading and writing instrument settings and measurement data. This standard allows an abstract way of using various programming languages to program remote-control applications instead of using SCPI commands. An instrument driver usually has a well-defined API.

HiSLIP is a TCP/IP-based protocol for remote instrument control of LAN-based test and measurement instruments. It was specified by the IVI Foundation and is intended to replace the older VXI-11 protocol. Like VXI-11, HiSLIP is normally used via a library that implements the VISA API. Version 1.4 of the LAN eXtensions for Instrumentation (LXI) standard recommends HiSLIP as “LXI HiSLIP Extended Function for LXI based instrumentation”.

Tektronix vintage analog oscilloscopes technologies and evolution. The company was founded in the mid-1940s to produce oscilloscopes.

References

  1. Tektronix TDS2010 Digital Oscilloscope Programmer Manual; 2020; 291 pages.
  2. Rigol DS1074Z Oscilloscope Programmer Manual; 2019; 264 pages.
  3. 1 2 3 4 5 6 7 8 SCPI-1999 Specification; SCPI Consortium.
  4. ni.com - History of GPIB - Developer Zone
  5. "History of GPIB". National Instruments. Retrieved 2010-02-06. In 1990, the IEEE 488.2 specification included the Standard Commands for Programmable Instrumentation (SCPI) document.
  6. 1 2 "SCPI". IVI Foundation. Retrieved 2010-06-02.
  7. IEEE Standard Codes, Formats, Protocols, and Common Commands for Use With IEEE Std 488.1-1987, IEEE Standard Digital Interface for Programmable Instrumentation, Institute of Electrical and Electronics Engineers, 1992, ISBN   1-55937-238-9, IEEE Std 488.2-1992
  8. Project Mate in 1985
  9. "GPIB 101, A Tutorial of the GPIB Bus". ICS Electronics. p. 5, paragraph=SCPI Commands.
  10. 1 2 3 Standard Digital Interface for Programmable Instrumentation- Part 2: Codes, Formats, Protocols and Common Commands (Adoption of (IEEE Std 488.2-1992). IEEE. doi:10.1109/IEEESTD.2004.95390. hdl:11059/14380. ISBN   978-0-7381-4100-8.
  11. "Replaced or Withdrawn Publications". IEC. Archived from the original on 2012-04-17. Retrieved 2010-02-06.
Specifications

Programming Manual Examples

Multimeters
Oscilloscopes