LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I stop the execution of a sub vi by using the close 'x' button on the top right corner

I have a vi calling another subvi, and I need the subvi to stop its execution when I close it by pressing the close button 'x' on the top right corner of the window.  Since vi's have a while loop, I can already close and stop the subvi by ending its loop but I also want to be able to stop the subvi by pressing the close button 'x' on the top right corner of the window.
 
I have attached to simple vi's to illustrate my point
 
Any help is appreciated
Download All
0 Kudos
Message 1 of 4
(3,676 Views)
Hello,

Add an event structure to the while loop and catch the Panel close filter event, set the discard property to true. And exit the while loop via the condition node.


Regards,

André
Regards,
André (CLA, CLED)
Message 2 of 4
(3,673 Views)
Thanks alot, that worked great
0 Kudos
Message 3 of 4
(3,666 Views)

Thanks! It worked for me!

0 Kudos
Message 4 of 4
(3,019 Views)