AnalogHome - News
April 2010 - AnalogHome Announces the Development of a Microprocessor based SCPI Parser

We have finished version 2.0 of our Small SCPI Parser (Pronounced “Skippy”) targeted to embedded controllers like the
Microchip PIC series of Microprocessors and are pleased to be able to offer this functionality in our Virtual Instrument
Designs.

Our Version 2.0 implementation, written in C, has a smaller footprint and is easily expandable and maintainable, keys for
implementation in a small memory footprint microprocessor.

Background

SCPI stands for Standard Commands for Programmable Instrumentation and is used in nearly every Test and Measurement
application today. It is a open and standardized command structure for controlling instruments of every shape, form and
function.

While SCPI has not turned out as “Standard” as was envisioned by the inventors, it is a big step up from everyone doing their
own command structures.

Hewlett-Packard originally developed SCPI and according to one of their original marketing blurbs on the language,

    “The result {of SCPI} is a language that is orthogonal, powerful, extensible, and yet familiar and friendly to users. The
    language never refers to instrument types, only to instrument functions. Therefore, SCPI applies to a wide variety of
    instruments, from power supplies to network analyzers.”  (HP Journal: April 1992)

We use this parser to decode SCPI commands and add true “Test and Measurement” functionality to our clients Virtual
Instrument projects. We have incorporated this parser in: Data Acquisition and Control projects, Analog IQ Up-converter and
a Bluetooth Tester project.

If anyone needs to program your device or virtual instrument, they will really appreciate the standardized command structure
that we can provide with this core functionality. SCPI commands are compatible with any instrument programming or test
language, such as: Agilent VEE, NI LabView and Classic programming languages like C# or Visual Basic.

Example  

A spectrum analyzer developed in the 1980's may have been programmed for a 1 GHz Center frequency and a span of 1
MHz with the commands,

    CF 1 GHZ
    SP 1 MHz

With SCPI the commands would be (with some variation possible),

    :FREQuency:CENTer 1GHz
    :FREQuency:SPAN 1MHz

While more verbose, it is certainly much more intuitive and readable to the programmer or poor chap who has to maintain the
test code.

A note on the long and short version of the commands. In SCPI the commands are always written in a combination of upper
and lower case like: “FREQency”

This upper and lower case denote the long and short version of the commands. So in the above example the frequency
command could be written,
       
      :FREQUENCY:CENTER 1GHz              {Long Version}
      :FREQ:CENT 1GHz                              {Short Version}
      
Either the long form or short form of the command is valid. The rule for making a short form version of the long form command
is: The short form is the first 4 letters of the long form command. If the last character of this resulting short command is a
vowel, it is then omitted. Additionally commands are not to exceed 14 characters in length and are not case sensitive.

Our implementation allows for both long form and short form of the commands.



Note: All product and trade names mentioned are copyright of their respective trademark holder.