LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically close a vi that was opened via "Start Asynchronous Call".

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.

0 Kudos
Message 1 of 4
(4,935 Views)

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.

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

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.

Message 3 of 4
(4,907 Views)

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.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 4
(4,901 Views)