LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

breaking while loop

hi all
Can anybody show me how can I stop a while loop if a button is clicked by the user?
My problem is that I have an Event Struc which I am using to start previewing some Vedio data. the code which preview the vedio uses a While loop.
I tried controlling the loop from a button.
The thing is that when the LV enters this loop, it doesn't listen to the events generated by the button and the value of these button remains as before(true or false) and I can't change anything such as clicking buttons or editing number values, however I can stop or pause the VI(it is not crashing).

I've read some of the post, I've tried them but nothin new.
Any help would be apprtiated
0 Kudos
Message 1 of 4
(2,830 Views)
Make sure the loop stop button terminal is inside the while loop. It does not need any events.

If this does not solve your problem, please post a simplified version of your code.

If the loop is inside the event structure, no other events of the same event structure can be serviced until the current event finishes. You might need parallel loops.
0 Kudos
Message 2 of 4
(2,830 Views)
Hi Ahmed,

Make sure you uncheck the Lock front panel objects option when configuring the event, this is checked by default and is the cause of a lot of problems when using events. See the attached picture.

Jon Bowers
Applications Engineer
NIUK
0 Kudos
Message 3 of 4
(2,830 Views)
Thank you all very much for your help
0 Kudos
Message 4 of 4
(2,830 Views)