LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve the caller of a dynamically called vi?

Solved!
Go to solution

Hi,

 

following situation: 

 

A vi is loaded dynamically into a subpanel on the panel of the calling vi using the "run vi" property node. The called vi needs to know by what vi it was called. As we can learn from some contributions in the discussion forum or from own experiments, the name of the calling vi is only contained in the array given by the "Callers' Names" property node if the vi is called "by reference". If it is called by the "run vi" property node, then there seems to be no way to find out the identity of the caller from inside the vi that is being called. Is there at least any solution that makes use of the fact that the called vi is running in a subpanel on the panel of the caller? Is there a property to read from inside the called vi the identity of the subpanel the called vi is running in?

 

Because my explanation has probably already become rather confusing, I am attaching a simple example.

 

Peter

Download All
Message 1 of 2
(2,780 Views)
Solution
Accepted by topic author stoeckel
I don't think there is a way to do that because as far as the VI in the panel is concerned, it's running as a top-level VI. One workardound is to use a control. When calling the VI use the VI Server to set the value of the control (with the Control Value -> Set method) to the name of the VI that's calling the VI. True, it requires you to use a control, but it's not that bad of a workaround.
Message 2 of 2
(2,772 Views)