Test & Measurement

Interactive software assistants

27th March 2015
Phil Ling
0

How software tools can streamline the process of automating instruments. By Kace Dreitlein, Applications Engineer, Keysight Technologies.

As Test Engineers are being pushed to automate more sophisticated measurements in less time with increasingly complex instruments, what’s beginning to emerge in the test industry are smart, interactive software assistants that streamline the software development process for test systems. These assistants can help by rapidly identifying the required instrument commands without the need to refer to documentation; creating and testing code segments interactively to reduce or eliminate lengthy debugging cycles, and by reducing coding time by transferring commands into the target development environment. To understand how interactive software assistants simplify test development, it’s useful to revisit some history of instrument control.

While the introduction of the General Purpose Interface Bus (GPIB) interface in the early 1970s standardised the way that instruments and computers connected to each other, it did not set forth any requirements for an instrument command language. This would be partially remedied in 1987 with the introduction of the IEEE 488.2 specification, but most of the instrument command definitions were still specified by the instrument vendor. Early instruments simply mapped front panel keys to simple codes, often referred to as R2-D2 style commands due to their two-character mnemonics. The programming command for a particular function on an instrument would often be found printed next to the button on the front panel.

As instruments became more complex, this approach was replaced by more detailed mnemonics that made it easier to interpret the meaning from the name. In 1990, Hewlett-Packard introduced the Test and Measurement System Language, or TMSL, in an effort to standardise the naming structure for instrument commands. This was later adopted industry-wide as Standard Commands for Programmable Instrumentation (SCPI).

Today, it’s not uncommon for an instrument to have hundreds of SCPI commands, which leaves the test engineer in the difficult position of trying to find the right command for the right task. Drivers are often touted as an answer to the problem, but they too add a level of complexity. Add to this the complexity of setting up the I/O connection to the instrument along with numerous software development environments, and the simple task of automating a measurement is no longer quite that simple.

Interactive assistance

To help minimise the learning curve on instrument automation technology, vendors are addressing the problem with software tools to help users get started. At the most basic level, software assistants provide a means of scanning the instrument bus and locating example programs that demonstrate the basic operation of an instrument, using either direct SCPI calls or with the aid of an instrument driver. Examples of these assistants can be found in Keysight’s VEE Pro and National Instruments’ LabVIEW.

More advanced software assistants aid in the development of the actual source code. For example, MATLAB’s Instrument Control Toolbox’s Test & Measurement Tool (via the tmtool command) allows you to connect to an instrument via an interface-based communications session and generate a MATLAB script as you send SCPI commands and read the responses.

In addition, the Instrument Control Toolbox can access IVI-C and IVI-COM drivers installed on the system. Once created, you can browse through the list of available driver commands, interactively execute them, and keep a running log of the associated MATLAB calls for use in your own code. Driver help is available at a click of the button.

Another example is Command Expert from Keysight Technologies, which is a free tool that integrates the instrument commands and documentation into a ‘command set’ that is used within an interactive environment for building command sequences. Once created, these sequences can be used to generate C/C#/VB source code or can be called directly from other environments, such as VEE Pro, LabVIEW, Excel, Python, or MATLAB.

By linking the documentation with the instrument commands, Command Expert allows the user to perform task-oriented searches to help locate the required SCPI command or IVI-COM call without requiring knowledge of the command or driver structure.

Using a Keysight N9020A spectrum analyser to illustrate how Command Expert works; when first launched, Command Expert presents the user with a welcome screen to help get started with connecting to a new instrument, along with some examples. By clicking on the ‘Create an instrument’ link under Quick Start, the wizard will scan the available interfaces for instruments. A list of available command sets will then appear. For a more complex instrument, there may be more than one command set, depending on the application to be used within the instrument. The final step allows the user to specify a name for a specific instance; this is particularly useful if using Command Expert with more than one instrument.

Once the command set is loaded, connecting to the instrument is achieved by selecting it from the list in ‘My Instruments’ and clicking the Connect button. A simulation option is also useful for working with Command Expert when the instrument isn’t available. After the connection is complete a window will be displayed with the SCPI command tree for the instrument. It’s possible at this point to browse the command tree, but a built-in documentation search capability speeds up the process. Entering ‘center frequency’ into the search box above the tree renders a list of commands with a documentation match. Four items down, a command named SENSe:FREQuency:CENTer appears, which sounds like what we may need. Clicking on it brings up the documentation to the right, allowing the user to confirm the operation performed by the command.
Above the documentation, the interactive execution pane allows commands to be executed. By entering a frequency of 1.0e9 and clicking the ‘Perform’ button, the command is sent to the instrument and also logged in the sequence pane at the bottom of the window. After gathering together all of the required commands the user can play back the sequence from within Command Expert, or export the commands to C#, C++, Visual Basic, or MATLAB, by selecting Export Sequence from the File menu. Command Expert can also call any sequence file created from VEE Pro, LabVIEW, Microsoft Excel, or Python.

Interactive software assistants offer the test engineer the opportunity to save time and reduce the debugging cycle in a user-friendly environment. By helping to mask the complexity of an instrument, engineers are free to focus on the task of automating measurements, rather than flipping through the pages of a manual.

Product Spotlight

Upcoming Events

View all events
Newsletter
Latest global electronics news
© Copyright 2024 Electronic Specifier