Overview
This document explains how to add data preview graphs to Express VIs that you create using the LabVIEW Express VI Development Toolkit.
Table of Contents
Introduction
The LabVIEW Express VI Development Toolkit enables you to create interactive Express VIs that simplify user development of test, measurement, and control applications. Express VIs significantly reduce the learning curve and development time associated with software tools by encapsulating the functionality of multiple VIs into interactive VIs that require little or no programming to configure.
You can use data previews, such as graphs, to provide users who are configuring an Express VI with a visual depiction of the behavior of that VI. For example, the Simulate Signal Express VI provides a preview of the generated signal in the Result Preview graph, as shown in the following configuration dialog box. The graph helps users visualize results and adjust configuration settings.

Note: This document contains concepts and procedures that assume you have previous experience in creating Express VIs. Refer to the LabVIEW Express VI Development Toolkit User Guide (linked below) for more information about creating custom Express VIs.
Adding Data Previews
You can add data previews to existing custom Express VIs. The following configuration dialog box for the Open Wave File Express VI, which opens an audio file and plays it through a sound card, does not include a data preview. A visual depiction of the waveform improves the usability of the configuration dialog box.

Complete the following steps to add a graph for previewing data to a configuration dialog box.
1. From the Create or Edit Express VI dialog box, open the configuration dialog box VI for the Express VI you want to edit.
2. On the front panel, expand the window to create space for a graph.
3. From the Controls palette, place a graph on the front panel.
4. Add a label to the graph, such as Result Preview. The graph should resemble the graph in the following example of the Configure Open Wave File VI front panel.

Tip: If you want to use a graph that does not have a 3D effect, copy a graph from an Express VI that ships with LabVIEW.
5. From the block diagram, find the Main While Loop section, which handles user interface events for the Express VI. The Main While Loop section should resemble the following block diagram.

Add an event case to the existing Event structure so the graph updates when a user changes configuration settings. Refer to the LabVIEW Help for more information about adding cases to Event structures.
6. Right-click the event structure and select Add Event Case from the shortcut menu. The Edit Events dialog box appears.
7. Specify an event source in the Event Source section. For example, if you added a graph to the Open Wave File Express VI, you would select Location of Wave File.
8. Select the event you want to configure for the event source, such as Key Down, Mouse Down, or Value Change. Click the OK button to save settings and close the dialog box.
In the following example, the Open Wave File Express VI includes a Value Change event that uses the Location of Wave File control. This causes the data preview graph to update when a user selects a new wave file.

9. Place the graph indicator in the new event case and add any other code that causes the graph to change.
In the following example, the Sound Read Wave File VI reads the wave file that the user selects. Based on the outputs the user selects, such as sound quality, rate, and bits per sample, the graph of the wave file appears on the front panel and changes each time the user selects a new wave file. The Waveform Data indicator corresponds to the data preview graph.

10. Save and close the configuration dialog box VI.
After you edit the configuration dialog box VI, the data preview graph updates whenever a user selects a new value.
You also can add text that appears on top of the graph, for example, if you want to label the graph as sample data. Place a text box on top of the graph, type the text you want to display, and select the appropriate font and color. The Sample Result text in the following example is 24-point red Application Font in bold on a transparent background.

Generating Context Help
The final step in creating a custom Express VI is to configure context help to display information about specific configurations of the Express VI. To create and edit context help, edit the genHelp VI, a subVI located in the configuration dialog box VI. Refer to the tutorial-style Webcast on Demand Creating User-Defined Express VIs: Advanced Topics (linked below) or to the Developer Zone document Using the genHelp VI to Create Context Help for Custom Express VIs (linked below), for more information on generating context help.
Related Links:
LabVIEW Express VI Development Toolkit User Guide
DeveloperZone: Using the genHelp VI to Create Context Help for Custom Express VIs
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/).
