LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW 2012 while event structure cannot stop

Solved!
Go to solution

I am trying LabVIEW 2012.

 

An example of while-loop with Event structure inside cannot be stopped with the boolean stop button.  Any thing wrong?

Please see the attached VI.

 

Thanks.

0 Kudos
Message 1 of 3
(2,254 Views)
Solution
Accepted by topic author weitong

Yep, something is wrong. You need to add a event case to detect a value change on the stop button.

 

The thing is now your event structure keeps waiting for one of the event that it handles, and ight now it only handles the "panel close" event, the "timeout" event is handled too but since you haven't connected anything to the timeout terminal (top left corner of the event structure) the timeout is -1. So when you run the VI the while loop is stuck in the first iteration and waits for a panel close, the stop button will only be taken into account after the even structure catches an event ; I think this is because LabVIEW will execute code linked to the stop terminal of the while loop only after all the rest of the code in it has finished executing.

 

Hope this helps


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 2 of 3
(2,245 Views)

I see. Thanks.

Instead, I could put a limited time to the "timeout" case.

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