Tag Archive for: Subpanel

LabVIEW Subpanel

 

Figure 1 – Radio Button control of VI insertion into subpanel.

 

One control combination that our LabVIEW development team uses to build modular adaptive user interfaces is the radio button, subpanel pairing.  Using the radio button to switch between vis displayed in a subpanel essentially allows you to  make a tab control that scales with the front panel during resizing events.

I built the vi shown in Figures 1 & 2 (linked here) to demonstrate how to insert dynamically called vi’s front panels into a subpanel.  In this example each radio button inserts a different 3D graph example vi into the subpanel by its reference.

Since the vis used in the subpanel are called dynamically, some extra steps may be required to build the exe.  The link below shows how to build an exe that uses dynamically called vis using the application builder.  I have also included some path tips that are useful when building LabVIEW executables (exe).

Related Link: Integration of Sub-Panel in the Front Panel of LabVIEW Executable – National Instruments (ni.com)

Figure 2 – Inserting a VI into a subpanel block diagram.Steps for Inserting a VI into a Subpanel

  1. Assign VI Name to a Button or Tree Item.
  2. Insert File Name into the Relative Path containing VIs to show in the Sub Panel.  See Notes
  3. Open a reference to the VI.
  4. If the VI is in the Idle state then run the VI.
  5. Insert VI into the Subpanel via a reference.

Notes

  • “..” will cause the Build Path VI to strip path once.
  • \ One extra \ is required per folder because the format into string function interprets backslashes as escape characters.

You can also use a tree control instead of a radio button to control which vi is inserted into the control panel.  An example of this method is illustrated in a previous blog titled “Building a Modern User Interface in LabVIEW“.   The vi shown in that blog uses a similar technique for building and selecting the which vi will be inserted into the subpanel.

Figure 3 – Insert VI into subpanel snippet.

Figure 3 above is a vi snippet of the Insert VI invoke node for a Subpanel. If you already have a subpanel, right click on the subpanel, create a reference and wire it to the subpanel invoke node.

To learn more about subpanels, other LabVIEW programming techniques, iTestSystem or our LabVIEW programming services contact Mark Yeager  @(844) 837-8797.

Building a Modern User Interface in LabVIEW

When we develop LabVIEW™ applications for our customers, a common request is for a simple, resizable and intuitive user interface (UI) for data visualization.  In these cases, we use a tree control and a subpanel.  This type of UI functions like a tab control that automatically resizes.  The main benefit of using a subpanel is to make your code more modular.

Figure 1: Modern User Interface with a Tree and Sub Panel.

To illustrate the modularity that this type of UI creates, I made an example LabVIEW™ project.  The main VI shown above uses a tree control to switch between a VI containing a graph and a VI containing a table.  I used our multi-queue event architecture for VI information communication messaging.  The image below shows the main VI’s significant functions.

Figure 2: Main VI’s Block Diagram – Significant Functions

The main VI’s functions are listed below.

Functions

  1. Initialize queues and events and then generate initialize event.
  2. Initialize tree and add tree items.
  3. When a user selects an item in the tree, generate data and then send it to the subpanel VI.
  4. Receive SubPanel Ready event from a subpanel VI and then insert the VI into the subpanel.
  5. Destroy queues and unregister for events.

In this example the subpanel VIs are very simple.  They populate an indicator (table or graph) and then generate a SubPanel Ready Event.  The two (2) subpanel VIs and block diagrams are shown below.

Figure 3: SubPanel VIs: Graph.vi and Table.vi

Contact Information: For more information on this example or our LabVIEW development service contact:

Mark Yeager – Integrated Test & Measurement (ITM), LLC.  Email: mark.yeager@itestsystem.com or Phone: 1.844.TestSys