LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining References of Controls Inside of Tab Controls

Does anyone have a way to detemine the id/index number of a control on a tabbed front panel? If there is no front panel I can use the menus: Edit, Set tabbing order. Then I can use this index in the block diagram of a sub-vi to update the control on the main fornt panel with data from the sub-vi as it runs. Yet, if you do the same thing on a front panel with a tab display, only the tabbed pages are indexed, as opposed to the individiual controls and displays. 

 

Thanks.

 

Brian

0 Kudos
Message 1 of 14
(5,849 Views)

The index of the controls on a tab control page are related of the order in which they were dropped on the page. You can use this attached VI to get the control index.

 

Ben64

0 Kudos
Message 2 of 14
(5,833 Views)

I have a way of updating a control on the main vi by using an open vi reference to the main vi in my sub-vi (see code below). This is working fine for situtations where the main vi does not have a tab control. With this vi that you gave me, how can I reference a specific control in the table, such as the 3rd control on the 3rd page..and more generally the n-th control on the n-th page such that my "2" below is correct. Currently I just wire a numeric to an index array and the value is then sent to that control. the trouble that I am having is in the "get all controls" & "pick the control" part below. With the tab control on the front panel, I cannot simply wire a numeric like I did below with the "2".

 

0 Kudos
Message 3 of 14
(5,824 Views)

You can do something like this.

 

Ben64

0 Kudos
Message 4 of 14
(5,813 Views)

Ben, I appreciate all of your hepl. But is there no way to get the control # other than by searching? I don't need to do this progromatically and have it do go thru the search each time the application is run. I can see which control I want to update on the main vi front panel, and I can open a vi reference. All I need to do is tell it which control to link to. Seems like this info should be available with a 'right click or something' on the control. Just like it is in the edit-set tab order menu navigation. This seems way more than what I should be required.

 

Brian

0 Kudos
Message 5 of 14
(5,809 Views)

If you select the Tab control, do a right click and select "Reorder controls in page. You ca then set the index of the controls on this page, but you have to do it on each page (index restarting at 0 on each page). So you don't have the choice to use the page number and the index of the control on this page to get the control reference.

 

Ben64

0 Kudos
Message 6 of 14
(5,806 Views)

I just found this too. So, in the end does labview keep a sequential list of the controls for with the individiual id's can be obtained simply? If there are 75 controls pread on 3 tabs, can I get what the id is of the 10th control on page 3?

 

0 Kudos
Message 7 of 14
(5,802 Views)

What do you mean by ID? The control label?

 

GetRef.png

 

Ben64

0 Kudos
Message 8 of 14
(5,798 Views)

No the number of the control. The controls are all listed internally in LabView with a number. But if you right click on the page to get the numebr of the control it is only for that page. How do I know what it is in reference to all controls? Can I just find the number of controls on all previous pages then start counting on the current page?

 

But, if I add another control does it get added to the complete list at the end yet it is still listed on it's page as a number in reference to that page?

 

Seems that the pages are merely decorations and have little organizational value.

0 Kudos
Message 9 of 14
(5,777 Views)

No, tab controls aren't just decorations.  Each page is a container that contains the controls on it.  It doesn't matter how many controls are on other pages.

0 Kudos
Message 10 of 14
(5,763 Views)