SCPI
SCPI (Standard Commands for Programmable Instruments) is a a standard with particular relevance for OpenTAP and the ecosystem of instruments that it supports. SCPI defines an interface for controlling programmable test and measurement devices. Introduced in 1990 as an additional layer on top of IEEE 488.2-1987, SCPI provides a consistent set of commands for a wide range of instruments, such as oscilloscopes, multimeters, spectrum analyzers, and power supplies. Today SCPI is maintained and promoted by the IVI Foundation.
SCPI has become an essential part of instrument control in various industries, enabling efficient automation and integration of test and measurement systems. Absent SCPI, test automation software ends up being specific to vendors and/ to individual instruments, limiting interoperability and imposing technology silos on testing organizations.
OpenTAP SCPI capabilities not only offer support for a range of instruments from Keysight, but also provide a bridge between OpenTAP, a large ecosystem of legacy instruments and test equipment from Keysight industry peers.
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.
Attributes of SCPI
Instrument Types supported - SCPI includes built-in supprt for a range of instrument classes:
Digital multimeter (DMM)
Oscilloscope
Arbitrary waveform/function generator
DC power supply
AC power supply
Switch
Power meter
Spectrum analyzer
RF signal generator
Upconverter
Downconverter
Digitizer
Counter/timer
Standardized Command Set – SCPI provides a set of ASCII-based instrument control commands, allowing users to control different types of instruments using the same or similar commands, simplifying the learning curve and reducing development time. Download the Keysight SCPI Command Set Reference.
Text-Based Commands – SCPI commands are text-based and human-readable. For example, a command to measure voltage might look like MEAS:VOLT?
, easing understanding and troubleshooting of scripts and programs that interact with instruments.
Hierarchy and Structure – SCPI commands are organized in a tree structure and grouped logically into subsystems, simplifying navigation and use. For instance, all commands related to voltage measurements might be grouped under a VOLT
subsystem.
Compatibility – SCPI is backward-compatible with earlier instrument control standards, such as IEEE-488.2 (a.k.a. GPIB), allowing integration of older instruments into modern test systems with minimal changes to existing code.
Interface Agnostic – SCPI functions over diverse communication interfaces, including GPIB, USB, Ethernet, and RS-232. This flexibility allows SCPI to support a wide range of test and measurement environments.
SCPI Support in OpenTAP
The SCPI interface provides a straightforward avenue for OpenTAP to support a range of legacy instruments. There are several options for OpenTAP users wanting to leverage this popular and ubiquitous interface, including utilities and programming libraries for using SCPI instruments and SCPI in general.
ScpiNetInstrumentBase
This OpenTAP package provides the base infrastructure for all Scpi-Net instrument plugins.
The ScpiInstrument base class:
Has properties and methods useful for controlling SCPI based instruments
Includes a predefined VisaAddress property
Requires Open and Close logic
Important methods and properties here include:
ScpiCommand
, which sends a command.ScpiQuery
, which sends the query and returns the results.VisaAddress
, which specifies the Visa address of the instrument.ScpiQueryBlock<T>
, which sends the block query, and parses the binary block as an array of type T. All numeric types except Decimal are supported.
The SCPI attribute is used to identify a method or enumeration value that can be handled by the SCPI class. Learn more.
Generic SCPI-99
The Generic SCPI-99 Instrument package adds support for any SCPI instrument and is compatible with plugins usable in over three dozens types of OpenTAP test steps.
Conclusion
SCPI in OpenTAP provides a much-needed avenue for expanding the reach of OpenTAP and interoperability across the OpenTAP ecosystem. Leveraging industry-standard SCPI interfaces opens a capacious toolbox working with home-grown test equipment, legacy instruments and COTS test equipment from Keysight customers and peers.
Additional References
A Beginner's Guide on Programming Instruments with SCPI and Python