Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Designing Configuration Dialog Box VIs

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

The configuration dialog box VI of an Express VI allows users to configure settings for the run-time behavior of the Express VI. The configuration dialog box VI also contains the user interface for the Express VI. After you create a new Express VI with the Express VI Creator wizard and design the source VI, you can design the front panel of the configuration dialog box VI and then modify the provided block diagram template to configure the run-time behavior of the Express VI.

Designing the Configuration Dialog Box VI Front Panel

Open the front panel of a configuration dialog box VI to complete the user interface. By default, LabVIEW defines only the basic OK, Cancel, and Help buttons. The Main Selection frame contains the user interface objects for the configuration dialog box. Place any user interface objects for the Express VI configuration dialog box in the Main Selection frame.

The following list describes some recommendations to consider when building the user interface.

  • Use controls and indicators from the System palette as much as possible or copy and paste objects from other configuration dialog boxes. System controls use platform-specific drawing functions, so they are useful in making dialog boxes look and behave like standard dialog boxes for each platform.
  • Use system colors and fonts.
  • Minimize the number of hidden selections, such as hidden controls, tab controls, or multiple pages. If you cannot create a configuration dialog box without hidden objects, use a second page or a tab control.
  • Keep the user interface style consistent. For example, the OK, Cancel, and Help buttons should appear in the lower right corner of a configuration dialog box.

Also use the LabVIEW style checklist and other development guidelines when building the user interface.

After creating the user interface, resize the front panel to show only the necessary items for the configuration of the Express VI. In general, resize the front panel to display only the Main Selection frame and the OK, Cancel, and Help buttons.

Designing the Configuration Dialog Box VI Block Diagram

After creating the user interface for the configuration dialog box, modify the provided block diagram template. The block diagram of the configuration dialog box VI is divided into three sections: Initialize, Main While Loop, and Reconfigure.

Initialize Section

The Initialize section of the block diagram includes the Control Data array and an empty Stacked Sequence structure. The Control Data array lists the configurable parameters for the source VI. The Stacked Sequence structure allows you to set default values for configurable controls.

The control names in the Control Data array match the control names in the source VI. The array must include all controls that transfer values between the configuration dialog box and the Express VI. The Express VI reads the control values, generates context help information for them, and writes them back to the Express VI.

Each element in the Control Data array is a cluster that contains the following objects:

  • Ctl Type—Specifies the type of control in the source VI, such as a front panel control, a constant, the Express VI title, or a dynamic data type control.
  • SourceVI Ctl Label—Specifies the item label as it appears on the front panel of the source VI.
  • ConfigDiag Ctl Label—Specifies the item label as it appears on the front panel of the configuration dialog box VI. An empty string indicates the label is the same as the source VI label.
Tip  Right-click the Control Data array and select Visible Items»Label from the shortcut menu to view the labels for each array element.

Main While Loop Section

The Main While Loop section of the block diagram handles user interface events. This section corresponds to the area of the front panel that displays default values and values from the most recent iteration of the Express VI.

Because the configuration dialog box VI waits for user events, the main object in the While Loop is an Event structure. The Event structure waits for the user to click one of the three buttons that all dialog boxes include: OK, Cancel, and Help. Clicking either the OK or Cancel button ends the loop. Clicking the OK button causes the configuration dialog box VI to save the new configuration. Clicking the Cancel button closes the configuration dialog box without saving any changes. Clicking the Help button keeps the configuration dialog box open but also opens a referenced help file.

The Main While Loop section of the configuration dialog box VI allows users to enter data that the VI writes in the Reconfigure section. When users select the settings they want from the Express VI configuration dialog box, the Main While Loop section processes the selections. The Main While Loop section disables controls if necessary, updates radio buttons, and updates feedback indicators, such as graphs of sample or preview data.

Reconfigure Section

The Reconfigure section of the block diagram includes the Terminals to Grow array and the genHelp VI. The Terminals to Grow array lists the terminals of the Express VI that appear expanded by default. Edits to the array cannot cause expanded terminals to disappear or change order. As a result, terminals that users expand and wire override values that users select in the configuration dialog box. The genHelp VI updates the Context Help window with the current configuration of the Express VI.

You also can use the Reconfigure section to rename inputs and outputs and to wire controls and indicators to the terminal pane.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit