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.
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.
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.
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.
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:
Tip��Right-click the Control Data array and select Visible Items�Label from the shortcut menu to view the labels for each array element. |
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.
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.