Programmatically Accessing Tab Controls Properties

Updated Mar 15, 2018

Reported In

Software

  • LabVIEW

Issue Details

How can I programmatically access the controls in my tab control?

Solution

Property nodes can be used to access front panel controls in a tab control programmatically. The two methods below show two different ways to do so.

Method 1: Using a tab control property node

  1. Create a property node off of the tab control icon by right clicking and selecting Create » Property Node. Then, select Pages from the drop down to access each page on the tab control.
  2. Use the Index Array VI to access the specific page that you want on the tab control. The index input indicates the page you want to access on the tab control (0 corresponds to the first page, 1 to the second page, and so on).
  3. Use a property node to access the controls on the page of the tab control by selecting CtlsOnPage from the drop down menu.
  4. Use another property node inside of a for loop to index through the controls and access the property that you wish to access. In the provided example, the control label is accessed.
  5. Use a string indicator to display these values in an array of strings.
Method 2: Using application property nodes
  1. Place a property node and right click on the property node to select Select class » VI Server » VI. This accesses the VI. Select Panel from the drop down menu.
  2. Place another property node and select Controls [ ] from the drop down menu.
  3. Use the Index Array VI to access the specific tab control that you want on the front panel. The index input indicates which control you want to access on the front panel (0 corresponds to the first control placed on the front panel, 1 refers to the second control, and so on. If you are unsure which order the tab control is, go to the toolbar at the top of the window and select Edit » Set Tabbing Order... ; The number displayed for the tab control is its order number. Click the X on the toolbar to cancel out of Set Tab Order.)
  4. Use the To More Specific VI to access the next level within the tab control. Use a reference from the tab control as the type input to the VI.
  5. Place another property node and select Pages from the drop down menu.
  6. Use the Index Array VI to access the specific page that you want on the tab control. The index input indicates the page you want to access on the tab control.
  7. Use a property node to access the controls on the page of the tab control by selecting CtlsOnPage from the drop down menu.
  8. Use another property node inside of a for loop to index through the controls and access the property that you wish to access. In the provided example, the control label is accessed.
  9. Use a string indicator to display these values in an array of strings.

Additional Information

There a variety of methods to controlling front panel objects. Additionally steps are required in this case because the front panel controls are placed in a tab control. For more information on accessing front panel objects, take a look at the Controlling Front Panel Objects - LabVIEW 2016 Help.

WAS THIS ARTICLE HELPFUL?

Not Helpful