From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save Reentrant VI Reference for later use in call chain

Hello,

 

In a call sequence I lose access to the VI reference of the last VI called.

 

Sequence is: main_caller calls ta_int that will initialize and start a server for an equipement, t7_server_ta.vi.

Later I will call ta_SendCommand.vi that will act in the reference saved under an "alias".

 

I believe that is is related to the value "Auto Dispose Ref" in the Invoke Nodeof the two calls but I do not know how to correctly configure this.

I don't need the reference of the ta_init.vi neither ta_SendCommand.vi. I only require the reference of the t7_server_ta.vi that I will maintain running.

Code attached.

 

Thanks.

0 Kudos
Message 1 of 2
(2,163 Views)

I suspect you don't quite understand what you are doing (and I'm not trying to make a snide comment here).  Your Main Caller runs VIs using VI Server with Wait Until Done set to True -- this means that the Main Caller waits until the called VI exits.  Why not simply do away with VI Server and call the appropriate VI directly?  You can "choose" the VI to call by using the name of the VI in a Case Statement and calling the appropriate VI inside the case.

 

If you really want to have asynchronous calls, a much "more modern" (and much more robust) way to do this is via the Start Asynchronous Call function, rather than using VI Server.

 

Here's a suggestion -- write down what you really want to do, without worrying about how you want to do it.  If it is simply "run a series of VIs in sequence, waiting until each finishes before starting the next one", then my suggestion about a Case statement that takes the name of the VI as an argument and contains the VI itself inside the Case to be run will be the (very simple) solution.  If it is something more complicated, once you know what you want to do, you can then worry about how you want to do it.  In any case, VI Server is probably not the optimum (or more straight-forward) way to do it.

 

BS

0 Kudos
Message 2 of 2
(2,107 Views)