Saturday, 10 January 2015

Standard Commands for Programmable Instruments (SCPI)

An embedded engineer at some stage of his career has to work on complex test and measurement devices. The devices can be a simple multimeter to a complex oscilloscope. There are various vendors for these devices and many of these devices can be tuned as per the requirements. Tuned here meant adjusting the parameters of the test instrument as per the requirement. For example, take an oscilloscope which has some settings to be done before capturing a waveform. Likewise, any test instrument needs an adjustment for usage in real time application. For all these instruments there will be a human interface at the front end and remote interface at the back end. Using both these interfaces settings can be done. Human interface involves display, touch, keypad where as remote interface involves connecting a remote PC using interfaces like GPIB, RS232, Ethernet, USB.
For communicating with instrument from a remote PC/local and to control it some commands are desired which are defined by Standard commands for programmable instruments (SCPI) . IEEE 488 is a standard which talks about the digital interface connections on the test measurements. IEEE 488.1 talks about physical interface. SCPI is an IEEE 488.2 specification. To make command, syntax, formats common across the interface this standard helps. The standard talks about data format and syntax only and never talks about the type of connectivity that exists in practise.

Few snippets from SCPI:
  1. SCPI commands are organized in a tree structure
  2. SCPI is a software standard to communicate between remote PC and instrument
  3. Any instrument from any vendor will use the same standard fro communication
  4. Communication happens by ASCII text strings
  5. The communication can be powering on an instrument, triggering an instrument as in case of oscilloscope, remote calibration, having a view of the instrument from remote, Querying various parameters, etc.
  6. In depth communication is handled by binary formats
  7. Genuine commands like CONFigure, MEASure are some commands which gives a view into what we can expect from the standard.
  8. SCPI is hardware independent
  9. Tests applications like MATLAB, LAB VIEW also support SCPI. MATLAB supports the programming of instruments using SCPI commands through INSTRUMENT CONTROL BOX.
An example of querying DC voltage from a instrument is as follows:

                                                        MEASure:VOLTage:DC?

A look of mandatory IEEE 488.2 commands in the below table:

No comments:

Post a Comment