LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting control and indicator names of a VI

Hi. I intend to get the names of controls and indicators of a VI in a program. How do I get? Please help!

0 Kudos
Message 1 of 7
(5,030 Views)

You can get most control names using attached snippet. You need to expand this further if you have clusters or tab controls.

 

Deceased.

Message 2 of 7
(5,025 Views)

Hi deceased. Thanks !

 

How do i differentiate between controls and indicators now?

0 Kudos
Message 3 of 7
(5,003 Views)

Expand out the CTL property node in the loop and add the "Indicator" property.

If you wire that out of the loop you will have an array of booleans that corresponds to the array of control names. 

Those set T are indicators, those set F are controls.

 

Deceased

 

Message 4 of 7
(4,994 Views)

Question: how does LabVIEW determine the order for those controls?

 

It's definitely not alphabetical

0 Kudos
Message 5 of 7
(3,892 Views)

I don't remember if it is Z-order, the order of their creation, or perhaps some underlying reference number.

 

Does it matter?

 

You can test Z-order by running it once, then try reordering the controls by picking 1 or 2 and selecting Send to Front or Send to Back.  Run the code again and see if the order changed.

0 Kudos
Message 6 of 7
(3,883 Views)

If you read the help for the Controls[] property it states that the array contains the references in tabbing order. I believe that the tabbing order will default to order of creation but you can change tabbing order if you want.

Matt J | National Instruments | CLA
Message 7 of 7
(3,878 Views)