LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get references of all Object on the front panel

Is it possible to get the reference of all existing object on the front panel of a vi.

My goal is to dynamically assign signal to indicators that has been drop on a new VI. But I need to get at least a reference on each object.

Thanks!
0 Kudos
Message 1 of 5
(4,571 Views)
Open a reference to the VI and get the front panel reference...Wire that reference to a property node and select the Get Control refs....now you have the references. If you want to find the reference of a particular control, use the name property to generate a namle list you can search to find the index of the wanted reference...See attached illustration (remember to close references, that is not done in the example).
Message 2 of 5
(4,571 Views)
Yes, using Property Node you can get a reference to the Front Panel of the given vi and after you can use this reference with another property node to get an array of refences to all objects on the front panel.
Message 3 of 5
(4,571 Views)
However, you need to be sure to close all the references you open. This is a very common cause of memory leaks--and can be very unpleasent to track down. NI has a whole big thing for describing what references you need to explicitly close, however I have always found it easier to simply close everything that I open. According to NI if you try to close a reference that doesn't need closing the resulting operation is a NOOP, so there's no damage done.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 5
(4,571 Views)
Start with what Mads and defuflo said.

If you have tab controls you have another level of complexity to deal with.

THe tab control will return a list of pages. From that you can get a list of all the controls on each page.

If you have nested tab controls....

Before you get to far with this you are going to want to change the labels. You cannot change the labels at run time but you can change the captions. Make sure the option "make captions match label" is not set.

Check out Open G.

Jean-Pierre's save all controls may be a good place to look for hints.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 5
(4,571 Views)