LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the control panel reference names from a cluster, from within another vi?

I have a GUI.vi with front panel controls, and a Main.vi from which I am trying to manipulate the FP controls of GUI.vi. I can access the references to them from main.vi using 'open reference to vi', then property nodes to get to the frontpanel.control property. From this I can get the control references and change the GUI controls ok, but the references are not named. I am really after a cleaner method than looping the 'names' property creating an array of names and I understand that the class for the controls is not specific therefore the name cannot be retrieved. Does anyone know if it is possible to typecast the control references to a different class (more specific) so as to get to the reference names using unbundle by name? If this is possible please could you post an example?
 
Thanks
    
Certified LabVIEW Architect
0 Kudos
Message 1 of 3
(2,672 Views)
Do you need to acquire the names of all of the controls on the GUI VI? Getting the names and storing them would only have to be performed once during startup, so should not be a big performance loss to your program.

If you know what the name of the control is already you can get data from and set the data of a front panel control by name.

I have included a VI that I created that has two parts.

Just to be sure, I have included a loop to get the names of all controls on a VI's front panel. Is this the method that you use?

I've found no easier way to get the names of controls on a front panel.

The lower section of the block diagram shows getting data from a control using the name of the control - you do not need a reference to the control. You can use the method to set the control to put data on a front panel as well. The downside? You have to know that name and the data type of the control before you work with it.

     Rob
0 Kudos
Message 2 of 3
(2,657 Views)

Many thanks for the example Rob, it was the same method I had used previously to get the FP control names, though you have definitely helped me out with the reading and writing of new values to the controls bit. 

Thanks again.

John

Certified LabVIEW Architect
0 Kudos
Message 3 of 3
(2,636 Views)