SCPI Parser Library

SCPI is defined as "a common interface language between computers and test instruments" and is commonly used to control oscilloscopes, function generators, DMMs, power supplies and other types of instruments. A common set of commands is defined for each of these instrument types and is shared by the manufactures of that type of instrument. This means that, as you move between instruments, the same commands are used to control them. The hierarchical syntax carries over between instrument types, further leveraging the knowledge gained from any instrument. While SCPI is powerful, it is also complex and difficult to program.

The parser offered here can help you learn more about SCPI and help you write your own code to implement your own instrument.

The PC code implements a server (the instrument) and a client (the user) interface that allows you to pass SCPI commands to the server and read its response. The server emulates an Agilent U2741A USB Modular 5.5 Digits Digital Multimeter (with the permission of Agilent) to demonstrate that the parser is capable of handling a full up commercial instrument.

The exact same SCPI.c and SCPI.h code is used to implement a server on a NetBurner MOD54415 embedded controller. This controller was selected because it is both capable and inexpensive. It provides enough functionality to implement a great system. I have used the MOD5282 to implement several custom controllers for industrial customers. The same code can be compiled to run on the MOD5282 with no code changes.

Although the code can be used for GPIB, RS-232, USB, TCP/IP, UDP or any other interface capable of communicating ASCII strings, the examples use AES Encrypted UDP as the communications media. This enables you to use the software across Ethernet and/or WiFi systems without having to worry about it being compromised. The Advanced Encryption System (AES) 128 bit encryption is very secure. When I first started using it, the 128 bit AES was the only encryption system certified by the US government for TOP SECRET messages.

SCPIServer.exe and SCPIClient.exe are both included in the PCSCPI.zip file above so that you can try out the system without having to compile it first. You can also compile it, from scratch, using the free Microsoft Visual Studio Express 2013 compiler and the included project files. Start SCPIServer and bring up SCPIClient from the command line as "Client [<server> [<port>]]". Server defaults to localhost and port defaults to 5025.

Likewise, SCPI_APP.s19 is included in the NBSCPI.zip file so that you can directly program a MOD54415 (to program a MOD5282 you will have to recompile the code as a MOD5282 application). You use the PC SCPIClient.exe code to talk to it, just like you would talk to the PC server.

Valid XHTML 1.0 Transitional

Last updated: Thursday, January 16, 2014