LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get VI reference of statically calling VI in called VI?

Consider two VIs viz.

  1. MainVI and
  2. SubVI.

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.

--
Ajay MV


0 Kudos
Message 1 of 4
(3,549 Views)

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.


___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(3,540 Views)

tst,

 

That doesn't work.  The Call Chain itself doesn't work since I have opened SubVI using static node in MainVI.

 

--Ajay

--
Ajay MV


0 Kudos
Message 3 of 4
(3,531 Views)

@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)).


___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(3,527 Views)