NI does not actively maintain this document.
This content provides support for older products and technology, so you may notice outdated links or obsolete information about operating systems or other relevant products.
Note: The Instrument I/O Assistant (IIOA) has been deprecated as of LabVIEW 2021. Instead, use the Instrument Driver that is supported by your device.
NI LabVIEW expands your options for communicating with and controlling your instrumentation systems with the Instrument I/O Assistant. Instrument I/O Assistant provides a user interface to interactively write commands to a device, read data that the device returns, and specify how to parse the response into a format relevant to your application. Instrument I/O Assistant simplifies the challenge of writing instrument control applications by automatically generating code from your configurations in your environment. Instrument I/O Assistant also helps you quickly parse complex responses from an instrument for use in native-code instrument drivers. Because string parsing can be complex, using the assistant’s interactive window to parse complicated responses can save you time in creating your instrument application. This article describes how you can use the Instrument I/O Assistant to communicate with your instrument, as well as a debugging utility and a helpful tool to parse complex responses from your instrument.
The Instrument I/O Express VI, found on the Functions>>Instrument I/O palette, launches the Instrument I/O Assistant, which you can use to communicate with message-based instruments and graphically parse the response. With the Instrument I/O Assistant, you can communicate with an instrument that uses a serial, Ethernet, or GPIB interface. To use the assistant, place the Instrument I/O Assistant Express VI on the block diagram (Figure 1). The interactive Instrument I/O Assistant dialog window appears (Figure 2).
Note: In LabVIEW 2019 and previous versions, the Instrument I/O Assistant (IIOA) is available in LabVIEW when NI-VISA is installed. To use the IIOA with LabVIEW 2020, after installing LabVIEW and NI-VISA, you must also install the IIOA tool.
Figure 1: Instrument I/O Assistant Express VI
Figure 2: Instrument I/O Assistant Dialog Window
Once the interactive Instrument I/O Assistant dialog appears, select your instrument from the Select an instrument drop-down list. LabVIEW automatically generates the list of instruments by making a ‘find resource’ call and checking Measurement and Automation Explorer (an I/O configuration utility) for any existing unique instrument names or aliases. Instruments you configure in MAX automatically show up in the Select an instrument drop-down list. You can search for instruments and assign unique names or aliases for your instruments through Measurement & Automation Explorer. These aliases will automatically show up in the Instrument I/O Assistant instrument pull-down menu.
The Instrument I/O Assistant organizes instrument communication into ordered steps. To use the Instrument I/O Assistant, you place steps into a sequence. Click the Add Step button to add steps to communicate with the instrument you select. As you add steps to the sequence, they appear in the step sequence window. Use the view associated with a step to configure instrument I/O. Four steps are available in the Instrument I/O Assistant.
For more information about configuring the steps, click Show Help to view the embedded help within the Instrument I/O Assistant.
Once you build a sequence of steps, you then execute the sequence to communicate with the instrument. When execution completes, use the response window in the Read and Parse view and Query and Parse view to interactively parse data into tokens and assign new data types to the tokens you create.
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 can also 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 a waveform or numeric data type. 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 have the option to parse data manually using the Instrument I/O Assistant. You should 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.
Once you have your steps added and configured, click Ok and LabVIEW automatically builds the VI in the background using the steps you configured in the dialog. From the block diagram you can easily wire the Instrument I/O Assistant outputs to user interface indicators (Figure 3). You can also convert Instrument I/O Assistant Express VIs to standard LabVIEW VIs in order to view the underlying code so you can further understand the parsing and formatting involved with sending these commands.
Figure 3 - Easily wire the Instrument I/O Assistant outputs to user interface indicators.
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.
The Instrument I/O Assistant helps to quickly parse complex responses from an instrument for use in their native-code instrument drivers. To parse the responses in the Instrument I/O Assistant window, close the assistant and right-click the Express VI. Select Open Front Panel from the shortcut menu to convert the Express VI to a standard VI. You can then 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 valuable time in creating your instrument driver.
Figure 4 - Easily copy the parsing routines to use in your instrument driver.
With the Instrument I/O Assistant, you can maintain a command history that makes remembering or retyping previous commands unnecessary. This feature 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. You can also check for instrument errors automatically instead of manually checking registers to determine errors. Finally, 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. This feature can help you compare data real-time with what you see on an instrument's front panel.
The Instrument I/O Assistant is a great tool for communicating with instruments quickly and easily. When used as a stand-alone express VI, it allows you to quickly establish communication with your instrument and begin taking measurements. You can then easily display those measurements on the LabVIEW front panel in multiple real data types. You can also use the Instrument I/O assistant to generate complex parsing routines to use in your instrument drivers. This flexibility and scalability is just one of the many benefits you get when you choose LabVIEW as your instrument control solution.