LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Owning VI" property in reentrant VI

Solved!
Go to solution
Hi,
   I've created a reentrant VI (prueba3.vi) with an indicator that shows the while loop iteration terminal count. It also passes the Stop button reference into an indicator (stop2).
   A second VI (prueba4.vi), opens by reference the prueba3 VI, runs it, and reads that counter.
   If the counter input reference in prueba4 comes from the "Open VI Reference" function, everything works. However, it won't work if the reference comes from the combination:  Control_Value_Get  (invoke node) +  OwningVI (property node) contained into the Diagram Disable Structure.
   I've seen that if the prueba3.vi is NOT reentrant, it works fine.
 
Why?
 
(find attached prueba3.vi and prueba4.vi files ; download them and copy them to the same directory ; VIs were built with LV 😎
 
Thanks,
   Guillermo
Download All
0 Kudos
Message 1 of 7
(3,150 Views)
can you send VI in 7.1 version
 
 
manisha
 
 
0 Kudos
Message 2 of 7
(3,133 Views)

Hm, I looked at this one and am not sure I have a good explanation for this.

As the previous poster requested, I'm attaching these VIs saved for previous to 7.1 (where the same behavior exists) to see if anyone else has any ideas.

Download All
0 Kudos
Message 3 of 7
(3,104 Views)
Hello,
 
I don't know why but it seems that owningVI property generates a new reference in each while loop iteration. I attach you an image with a modification that works ( workaround ). If you use probes, you will see the new references generated by owning property.
 
Regards
 
crisR
0 Kudos
Message 4 of 7
(3,088 Views)

Hi crisR,

You have passed the handler (VI reference) to the end of the code with your modification thus the Counter will work. This is not the pourpose of the open question. Thank you anyway.

What I'm looking for is to retrieve the reference to the Owning VI (a constant reference) so I can call more Invoke/Property nodes from there.

Any more ideas?

Thanks,

   Guillermo

0 Kudos
Message 5 of 7
(3,054 Views)
I have looked at this a couple of times since it was originally posted, and was hoping someone would post a more concrete answer, but since no one has, I'm going to assume for now that it is a bug.  I am not really sure that it is, but this was reported to R&D (41P7921W) for further investigation.
0 Kudos
Message 6 of 7
(2,934 Views)
Solution
Accepted by GuillermoP

I would not concider this a bug but an enhancement of the documentation may be warrented.

Here are my thoughts.

The help for the "owning VI" reads in part;

 "Returns a reference to the VI that owns this object. Close this reference when you are finished using it. " (emphesis added).

When ever I am told that I should close a reference, that implies that a new reference is created that needs destroyed.

Repeatedly opening a reference to a VI configured to be opened as re-entrant results in a new instance of that VI being created.

So the previously posted work-around that uses the refernce returned by the "Run VI" is the only way that I know of doing this.

BTW: THe boolean input "Autodispose..." to the "Run VI" is there precisely to allow access to the instaciated VI.

So....

I do not believe there is a way to locate a reference to one particular instance of a re-entrant VI given only a reference to a control on the FP of the re-entrant VI.

The above is my best explanation of what is happening. If I got something wrong please feel free to step and straighten me out!

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 7
(2,917 Views)