LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stopping 2 While Loops

I have two while loops running in parallel. One is a state machine and the other loop has an events structure inside. The state machine handles most of the events in the program. Once this finishes executing, is writes false to it�s own loop condition and a local variable inside the events loop, to stop the events loop.

While executing the program, everything works great. While exiting, however, Labview seems to �hang� for a while. Before it can exit the program.

So why does it �lag�? Is there any way to resolve this problem?

Thanks,

FightonSCTrojan
0 Kudos
Message 1 of 4
(2,946 Views)
It depends upon where you execute the stop and how your event handler is configured. The event structure will not "see" the change to the local variable and could be still waiting for an event to front panel event to occur before continuing.

The "hang" could be due to the timeout in the event handler - what is the timeout set to?

If this doesn't help, post an example.

Tim
0 Kudos
Message 2 of 4
(2,946 Views)
The timeout is set to 10 ms right now, and the loop has a delay of 100 ms. I am not sure if this set out will have problem
0 Kudos
Message 3 of 4
(2,946 Views)
See the attached, do you have something like this. Modify and re-post if what you've got is different.

Tim
0 Kudos
Message 4 of 4
(2,946 Views)