LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Caller as Clone Reference

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?

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Download All
0 Kudos
Message 1 of 22
(2,341 Views)

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.

Message 2 of 22
(2,334 Views)

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:

 

 

CallChain.png

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 22
(2,330 Views)

Once you opened the reference, get a reference to it's front panel. From that reference, get all controls.

Get Controls.png

 

 

Use Get Clone Name property to get the name of the clone...

Message 4 of 22
(2,318 Views)

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.  

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 22
(2,312 Views)

@~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:

Get Clone Name.png

 

Then you'll get:

Clone Names.PNG

Message 6 of 22
(2,279 Views)

ignore

0 Kudos
Message 7 of 22
(2,271 Views)

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:

Get Clone Name.png

 

Then you'll get:

Clone Names.PNG


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.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 8 of 22
(2,261 Views)

@~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:

Get Clone Name.png

 

Then you'll get:

Clone Names.PNG


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)

 

Download All
Message 9 of 22
(2,208 Views)

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?

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 10 of 22
(2,186 Views)