05-20-2010 01:57 PM - edited 05-20-2010 01:58 PM
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?
05-20-2010 02:10 PM
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?
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
05-20-2010 03:27 PM - edited 05-20-2010 03:27 PM
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.
05-21-2010 02:42 AM
Hi!
Did you set AutodisposeReference to True?
Look at this BD I'm currently using: