LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cloned VI aborts when caller VI closes

OK, I know this is a common problem... you want to create a VI that spawns a clone of some other VI, but when the caller's call chain execution completes, the clone(s) created automatically abort.

 

It seems like there must be a way around this.

 

 

Example of a use case: I want to create a LabVIEW Step in TestStand that launches a daemon or engine that will run continuously in the background. 

 

 

Anyone out there who knows how this can be done? Seems like I may have done it before, but I can't seem to figure it out now. Some way of creating an independent holding location for the reference?

Message Edited by 10Things Rob on 05-20-2010 01:58 PM
0 Kudos
Message 1 of 4
(2,535 Views)

That is the garbage collection doing its job since it thinks you forgot about the background VIs. Don't you hate it when LV cleans-up behind you? Smiley Tongue 

 

Have the spawned VI open a ref to itself when it starts so it can keep itself open.

 

Now if that does not do it, add the extra step of getting a ref to its FP.

 

I usually do both and don't remeber if it was the VI ref or the FP ref that keeps it alive.

 

Ben

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

I actually couldn't get it to work that way, but did find one solution:

 

I used a *.vit (non-reentrant) and had it open its front panel with the state set to Hidden. I don't know if that's the only way to do it (I would love to see more), but at least it seems to work. 

Message Edited by 10Things Rob on 05-20-2010 03:27 PM
0 Kudos
Message 3 of 4
(2,510 Views)

Hi!

Did you set AutodisposeReference to True?

Look at this BD I'm currently using:

 

BDDyn.PNG

0 Kudos
Message 4 of 4
(2,490 Views)