12-08-2020 10:20 AM
I want to get the controls and indicators of a calling VI. The calling VI is a clone. I do not want to pass a reference of the calling VI into the SubVI (don't worry about why. I just don't want to. I have my reasons. It will require updating hundreds of VIs).
I've put together 3 VIs that demonstrate this example. I've tried numerous combinations of flags for the Open VI Reference. I've searched Lava and here and cannot see a solution.
Open and run the MainVI. I would expect the output to have 2 equal values in the string array. However, one is the clone and one is the original.
Any thoughts?
12-08-2020 10:31 AM
Get the call chain (Call Chain function).
It contains all caller's decorated names (including clone nr.). Get the one you like, use the name to open a reference to it, get it's controls.
12-08-2020 10:37 AM - edited 12-08-2020 10:40 AM
Thanks for the quick response. However, I am using the call chain function. Maybe I should have posted an image of the code for those who don't want to waste time downloading and looking at my code:
12-08-2020 10:45 AM - edited 12-08-2020 10:50 AM
Once you opened the reference, get a reference to it's front panel. From that reference, get all controls.
Use Get Clone Name property to get the name of the clone...
12-08-2020 10:57 AM
I know how to get controls from a VI. That is not the issue here..... The issue is that the Open VI Reference is NOT opening the clone reference... even though I'm passing it the clone name. I already have the clone name.
In the image I posted the wires going into the build array are not equal. One is the clone the other is not.
12-08-2020 11:47 AM - edited 12-08-2020 11:48 AM
@~jiggawax~ wrote:
I know how to get controls from a VI. That is not the issue here..... The issue is that the Open VI Reference is NOT opening the clone reference... even though I'm passing it the clone name. I already have the clone name.
In the image I posted the wires going into the build array are not equal. One is the clone the other is not.
But you do get a reference to the clone.
Get Name returns the VI name, even for a clone. Use Get Clone Name:
Then you'll get:
12-08-2020 11:54 AM - edited 12-08-2020 11:55 AM
ignore
12-08-2020 12:10 PM
wiebe@CARYA wrote:But you do get a reference to the clone.
Get Name returns the VI name, even for a clone. Use Get Clone Name:
Then you'll get:
Ahh I see what you meant. Thank you. However, when I get the controls and grab the value it seems to give me the value of the original VI and not what's in the clone. So it seems that the VI reference is not the clone reference. Any thoughts on that?
Thank you much.
12-09-2020 02:34 AM - edited 12-09-2020 02:36 AM
@~jiggawax~ wrote:
wiebe@CARYA wrote:But you do get a reference to the clone.
Get Name returns the VI name, even for a clone. Use Get Clone Name:
Then you'll get:
Ahh I see what you meant. Thank you. However, when I get the controls and grab the value it seems to give me the value of the original VI and not what's in the clone. So it seems that the VI reference is not the clone reference. Any thoughts on that?
Thank you much.
It should.
But a quick test gave me wrong results too. Both FP.Controls[] and Controls.Get Value failed. Until I saved everything?
After the save, I couldn't get it to fail again. See attachments.
Definitely something fishy going on here.
(BTW I hope LV18 is OK, all I did is change the Get Clone Name for a FP.Controls[], Get Value, and a Get Control Value method)
12-09-2020 10:42 AM
Thank you for looking into this for me. I really appreciate it. I can't get it to display the proper thing. I tried saving your VIs as well but same result. It just displays the default values of the original VI and not the clones. I really can't be the only one who has encountered this right?
wiebe@CARYA wrote:
After the save, I couldn't get it to fail again. See attachments.
But you say you got it to work? Maybe it's a LabVIEW setting somewhere?