ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

while loop

hi ,

please help me . i want to stop the execution of the while loop when i press the " close button ". 

0 Kudos
Message 1 of 3
(2,587 Views)

Use an event handler in the while loop?

stop_while_loop.pngstop_while_loop.png

0 Kudos
Message 2 of 3
(2,577 Views)

If you mean the Windows' close button, you need to catch the VI's Close? event. Set disgard? to true, so the VI get a chance to finish normally.

 

You could put the normal execution stuff in the Time Out event of the event structure. This isn't a very durable solution, but it works in simple situations.

 

 

0 Kudos
Message 3 of 3
(2,573 Views)