LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

interruption of my VI at any instant

Hi, I hope you can help me.

 

I have a loop and inside this loop I have all my program. When I want to stop the loop I have to wait at the end of one execution of the loop. My question is, how I can stop my loop at any instant using a button like control?

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

You can't cleanly stop a loop iteration in the middle of an iteration. I would suggest that you use a producer/consumer architecture with the producer controling the UI portion of your application. At a minimum you can at least inform the user that you are processing their stop command. The consumer would be a state machine and hopefuly no single state of your state machine would require a very long time to execute. Using this type of architecture you should be able to repond to the shut down in a reasonable time.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 3
(2,316 Views)

What Mark said. Also, if your program uses timers in the form of hard Wait(ms) functions, you can switch to to an interruptible timer of your own design, or use the Elapsed Timer Express VI.

Richard






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