LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get All Controls References

Hi all
If somebody know how can i get all controls references of VI (including controls that founds in Tabs and Clusters). I need generic method, because i haven't information about VI (reference to VI i get only at run-time).
Thanks, Nadav
0 Kudos
Message 1 of 11
(5,769 Views)
Use the Application Control Pallete.
 
Open a VI reference (could be to your current vi) use a property node to return a Front Panel reference, then use a property node to return an array of Controls[ ]. You can pass this Controls [ ] array into a loop and then read the control name, caption, visability, value, etc...
 
Be sure to close your control references if they are not for your current vi (it's actually better to close any reference when in doubt).
 
 
0 Kudos
Message 2 of 11
(5,762 Views)
I think you will have to do this recursively, by casting each control to a tab and a cluster and if you don't get an error use the Controls property again until you go through all the controls. I seem to remember seeing something along these lines in OpenG somewhere, but I can't find it now. You can probably still adapt some of their recursive VIs.

___________________
Try to take over the world!
0 Kudos
Message 3 of 11
(5,756 Views)
There is GetAllControls Value VI into OpenG Application Control Tools package (oglib_appcontrol).
 

Jack
Win XP
LabVIEW 6.1, 7.0, 7.1, LabWindows/ CVI 7.1
Let us speek Russian 🙂
0 Kudos
Message 4 of 11
(5,746 Views)
To include the controls on Tabs, pass the array from my previous answer into a for loop, use auto-indexing. Place a Class Specifier Constant in the loop, right click on it and set it's type to a Tab Control. Place a "To More Specific Class" function below the constant, and wire the constant into the top.
 
If the control from the array that you pass in is a Tab Control, "To More Specific Class" will NOT return an error. Use a case statement and use the No Error case to expose the Tab Control properties. Return the "Pages" property (an array) and pass this into a for loop. Connect a property node to the indexed pages, then select Controls On Page to return an array of controls ON EACH PAGE. You need to set up a shift register and use build array to return all of the controls from all of the pages. Make sure you close the Page Reference.  You can concatenate the array of Tab Control Page items with your original FP Controls.
0 Kudos
Message 5 of 11
(5,716 Views)

Hi EVS,

this "OpenG Application Control Tools " you have specified looks like something I realy need right now!

where can I get these VIs?

Mel

0 Kudos
Message 6 of 11
(5,696 Views)
http://openg.org
 
Download the OpenG Commander, and use it to install whatever packages you like.

___________________
Try to take over the world!
0 Kudos
Message 7 of 11
(5,683 Views)
This method return only references to controls that found on VI panel. But if you have Tab or Cluster with controls you get only ref to Tab/Cluster
0 Kudos
Message 8 of 11
(5,672 Views)
Here's my quick version (7.0). I haven't done any real testing, but I think it should work.

___________________
Try to take over the world!
0 Kudos
Message 9 of 11
(5,667 Views)
I do see one potential bug already - using the reshape array will almost certainly create some empty references. here is using a shift register with a Build Array instead.

___________________
Try to take over the world!
0 Kudos
Message 10 of 11
(5,666 Views)