LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop an event structure in a while loop


@X. wrote:

That or you could generate a notification from the Event Case where you detect a stop action (and of course have your processing VI monitor this notifier).

Personally, when things may take a long time and I expect the user to change his mind, I pop up a progress bar from within the "Computing VI" with a "Cancel" and "Abort" button.

"Cancel", well cancels the whole thing, While "Abort" returns the results achieved so far (if that aplies).


THis is good advice. Regardless though, The processing code will have to be organized in such a manner that it can detect the Stop event during processing. State machines offer a nice way to transition between tasks and allow the check to occur during processing (check between each state for instance).



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
0 Kudos
Message 21 of 26
(1,697 Views)

Responding to the progress bar inputs also requires some kind of state machine architecture. The simplest of which is when the processing involves a For or a While loop, which updates the progress bar either at each iteration or a subset thereof (the Loop is the "State Machine"). The main disadvantage of the progress bar is that it is obnoxious (even if you make it a non-floating window).

0 Kudos
Message 22 of 26
(1,689 Views)

the solution is to include a timeout event, no matter who is empty

0 Kudos
Message 23 of 26
(1,264 Views)

Canzaca,

 

Please don't revive 5 year old threads. If there's something you have a question about, feel free to post a new thread.

0 Kudos
Message 24 of 26
(1,256 Views)

@Canzaca wrote:

the solution is to include a timeout event, no matter who is empty


This is a long thread last active five years ago.

 

You probably should be significantly more specific this which post your "solution" applies. Thanks!

0 Kudos
Message 25 of 26
(1,219 Views)

Good advice.  In this way I can press other butons while a process trigged by an the event structure is running.

0 Kudos
Message 26 of 26
(979 Views)