Use the subpanel control to display the front panel of another VI on the front panel of the current VI. For example, you can use a subpanel control to design a user interface that behaves like a wizard. Place the Back and Next buttons on the front panel of the top-level VI and use a subpanel control to load different front panels for each step of the wizard.
 |
Note You can create and edit subpanel controls only in the LabVIEW Full and Professional
Development Systems. If a VI contains a subpanel control, you can run the VI in all LabVIEW packages, but you cannot configure the control in the Base Package. |
Complete the following steps to load a front panel in a subpanel control.
- Place a subpanel control on the front panel. LabVIEW creates an Invoke Node on the block diagram with the Insert VI method selected.
- Place the Open VI Reference function to the left of the Invoke Node on the block diagram.
- Wire the path of the VI whose front panel you want to load to the vi path input of the Open VI Reference function.
- Right-click the vi reference output of the Open VI Reference function and select Create»Method for VI Class»Run VI from the shortcut menu and place the Invoke Node that appears on the cursor to the right of the Open VI Reference function.
- Wire the vi reference output of the Open VI Reference function to the reference input of the Invoke Node with the Run VI method selected.
- Right-click the Wait until done input of the Run VI method and select Create»Constant from the shortcut menu to create a Boolean constant with a value of FALSE.
- Wire the reference out output of the Invoke Node with the Run VI method selected to the VI Ref input of the Invoke Node with the Insert VI method selected.
- Place a While Loop to the right of the Invoke Node with the Insert VI method selected and wire a stop button to the conditional terminal.
- Place the Wait Until Next ms Multiple function inside the While Loop and wire a numeric constant to the millisecond multiple input.
- Place the Close Reference function to the right of the While Loop.
- Wire the reference out output of the Invoke Node with the Run VI method selected through the While Loop and to the reference input of the Close Reference function.
- Wire all error in and error out terminals on the block diagram.
You also can use the SubPanel properties and methods to modify subpanel controls programmatically.
Refer to the labview\examples\general\controls\subpanel.llb for examples of using subpanel controls.