03-28-2013 07:07 AM
I've opened a vi using "Start Asynchronous Call" but the vi keeps running after the application is done and the only way to stop it is to exit Labview.
How can I stop it. Seems like it should be simple.
03-28-2013 07:11 AM - edited 03-28-2013 07:11 AM
You have your main start this asynchronous call, then keep the reference to that VI in the main. From there you can call the Abort VI Invoke Node, and close Front Panel Property Node using that VI reference.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-28-2013 10:06 AM
I had this problem recently too, and I was spawning a number a VIs via the start Asynchronous call, rather than then abort them all, as I wanted to run some code and exit them cleanly (for things like error capture, or in my case to stop processes they in turn had generated) I used a slightly different technique. My main VI stayed running and is used as a manager for all of the spawned VIs, it generates a user event based on it's stop button which was then included as an input to the subVIs. The subVIs then had an event structure in the while loop keeping them running that killed that loop based on the user event which was triggered by the main VI. That way everything exits gracefully on one stop button.
03-28-2013 10:20 AM
I pass a queue reference into the clones and then in my main VI when my shutdown code executes it closes the queue reference (destroys the queue). The clones then produce an error (e.g. from Get Queue Status) as the queue no longer exists and I use that to exit my VI and cause all of the clones to shutdown.