03-20-2013 08:03 AM
Consider two VIs viz.
My MainVI opens VI reference of SubVI through Static VI Reference node and runs it programatically.
I want to get MainVI reference in SubVI. i.e., VI reference of statically calling VI (here MainVI) in called VI (here SubVI).
Note: I can NOT use static reference of MainVI or open VI reference using path of MainVI in the SubVI to get MainVI reference. I'm looking for something like Call Chain function which gives chain of VI which calls the current VI.
Thanks,
Ajay.
03-20-2013 08:36 AM
If you have the OpenG, then their Application Control palette has a VI called Current VI's Parent Reference, which you can use. If you don't then use the Call Chain primitive, take the second element from the array and feed it into Open VI Reference.
03-20-2013 09:17 AM
03-20-2013 09:27 AM
@Ajay_MV wrote:
That doesn't work. The Call Chain itself doesn't work since I have opened SubVI using static node in MainVI.
You're right. I didn't notice that's how you run the VI and you actually explained that.
Once you run the VI dynamically, you no longer have a static link to the calling VI and you can't get it automatically. Instead, you need pass the reference explicitly (either by putting it on the connector pane and using one of the call by reference nodes or by passing it using another mechanism (ctrl val.set, queue, etc. take your pick)).