Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
What is Developer Zone?
United States

Document TypeTutorial
NI Supported: Yes
Publish Date: Sep 06, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links -Products and Services

Using the Instrument I/O Assistant to Aid in Creating LabVIEW Instrument Drivers

6 Ratings | 3.17 out of 5
 Print |  PDF

Overview

LabVIEW 7.0 and later expands your options for communicating with and controlling your instrumentation systems with the Instrument I/O Assistant. You can use the assistant to perform simple instrument I/O tasks or use it as a building block to help create instrument drivers. This article describes how you can use the Instrument I/O Assistant as a debugging utility and a helpful tool to parse complex responses from an instrument.

Table of Contents

  1. How to Use the Instrument I/O Assistant
  2. The Instrument I/O Assistant and the VISA Interactive Control
  3. Incorporate I/O Assistant Parsing in Your Instrument Drivers
  4. Summary

How to Use the Instrument I/O Assistant

You can access the Instrument I/O Assistant from the Input and Output Express palettes in LabVIEW 7.0 or later. With the assistant, you quickly and easily can send commands to an instrument and view real-time responses. To use the assistant, place the Instrument I/O Assistant Express VI on the block diagram (Figure 1). The interactive Instrument I/O Assistant window appears.

Figure 1 - Instrument I/O Assistant Express VI


In the Instrument I/O Assistant window, select an instrument from the Select an instrument drop-down list. LabVIEW automatically generates the list of instruments by making a ‘find resource’ call and checking the Measurement and Automation Explorer (an I/O configuration utility) for any existing unique instrument names or aliases. Use Measurement and Automation Explorer (MAX) to search for instruments or assign unique names or aliases to instruments. Instruments you configure in MAX automatically show up in the Instrument I/O Assistant window's Select an instrument drop-down list. Click the Add Step button to add steps to communicate with the instrument you select.


Figure 2 - Interactive Instrument I/O Assistant dialog


You may want to configure specific parameters on your instrument, such as triggering or coupling, before you read back measurement data. You can write these specific commands using the Write step in the Instrument I/O Assistant. You also can perform Query and Parse steps to send commands to the instrument and display the response in the interactive window. After you receive a response from an instrument, the Instrument I/O Assistant can parse the response for you automatically. The assistant converts the data into a more usable format, such as waveform or numeric data types. Because parsing data is often the most tedious aspect of instrument programming, the Instrument I/O Assistant can save you significant development time when you create instrument control applications.

You also can parse data manually using the Instrument I/O Assistant. Use this method if you want to look at specific pieces of the returned data. You can assign tokens, or outputs, to each piece of data parsed. The outputs on the right-side of Figure 3 are the current tokens for this sequence of commands and responses. These tokens appear as outputs on the Instrument I/O Assistant Express VI and can pass data to an indicator, analysis VIs, or other VIs. You also can apply scaling for the tokens to convert the responses from an instrument into real-world data. Because parsing, formatting, and scaling data can be a difficult task with instrument communication, the Instrument I/O Assistant delivers automatic, interactive parsing and scaling so you can convert your instrument data correctly without extensive debugging.


Figure 3 - Easily wire the Instrument I/O Assistant outputs to user interface indicators.


Finally, you can convert Instrument I/O Assistant Express VIs to standard LabVIEW VIs to view the underlying code and further understand the parsing and formatting involved with sending these commands.

The Instrument I/O Assistant and the VISA Interactive Control


The Instrument I/O Assistant is not designed as a replacement for well-written, full-featured instrument drivers. For the majority of applications, the instrument driver code templates and other documentation available on ni.com/idnet should serve as the model for instrument drivers. However, the Instrument I/O Assistant delivers several benefits for both beginning and advanced instrument driver developers.

You can use the Instrument I/O Assistant as a tool for investigating instrument responses, similar to the VISA Interactive Control (VISAIC) utility. With the assistant, you can maintain a command history that makes remembering or retyping previous commands unnecessary. This ability can save significant time for experienced instrument driver developers trying to debug a piece of code or determine how an instrument responds under a certain set of parameters. The Instrument I/O Assistant also features a Query step, whereas VISAIC can only read and write commands. However, VISAIC is still a useful tool for performing register-based programming as opposed to standard message-based command sets.

As an additional benefit, you can use the Instrument I/O Assistant to view parsed code as real data types (e.g., graphed waveforms) instead of ASCII or binary data as in VISAIC. This feature can help you compare data real-time with what you see on an instrument's front panel.

Finally, you can check for instrument errors automatically in with the Instrument I/O Assistant. VISAIC requires you to manually check registers to determine instrument errors.

Incorporate I/O Assistant Parsing in Your Instrument Drivers


The Instrument I/O Assistant helps you quickly parse complex responses from an instrument for use in their native-code instrument drivers. Parse the responses in the Instrument I/O Assistant window, close the assistant, and right-click the Express VI and select Open Front Panel from the shortcut menu to convert the Express VI to a standard VI. You then can copy the complex parsing routine to use in an instrument driver (Figure 4). Because parsing can be tricky, using the assistant to parse a set of complex code can save you time in creating your instrument driver.

Figure 4 - Easily copy the parsing routines to use in your instrument driver.

Summary

The Instrument I/O Assistant is a great tool to for communicating with instruments when you do not have an instrument driver. You also can use the Instrument I/O Assistant as a replacement for the VISA Interactive Control or to create complex parsing routines.
Related Links:
LabVIEW Zone
LabVIEW Product Page
6 Ratings | 3.17 out of 5
 Print |  PDF

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).