05-22-2006 03:15 PM
05-22-2006 03:52 PM
05-22-2006 04:15 PM
As Kenny said it is very difficult to say without seeing the block diagram. Just a guess though, I have seen cases where the stop button is read while the loop continues; you press the stop button and it is not read again until the next iteration. Check your data flow to see when the stop button is read.
Steve
05-23-2006 02:44 AM
Hi Jonusmc,
We all fall victim to this at least once. So you have some test for whether to loop or not - naturally this happens last, right? Well in text based languages it happens last if you put it last, but in LabVIEW it happens as soon as it possibly can - based on data-dependency. The "flat sequence" is specifically designed to force code segments to execute sequentially, but it's often enough just to put a single frame around some section of code, then attach a wire to it so it has to wait before executing.
Maybe I'm way-off with this answer, but it sounds so familier!
Cheers
05-23-2006 02:49 AM
05-23-2006 06:22 AM
10-06-2020 02:56 AM
I have found a great solution in this regard.
Put all of the codes in the while loop in a case structure.
If you press the stop button, the while loop will not continue 1 more time.
10-06-2020 03:06 AM
Hi Ashkan,
@Ashkan8203 wrote:
I have found a great solution in this regard.
Well, a "great solution" including a Rube-Goldberg!
Why do you need that NOT function? Simply switch TRUE/FALSE cases…
@Ashkan8203 wrote:
If you press the stop button, the while loop will not continue 1 more time.
This sentence is wrong: the loop will iterate as often as without this case structure!
10-06-2020 03:20 AM
**Why do you need that NOT function? Simply switch TRUE/FALSE cases…
Because the question is about using a stop button!
**This sentence is wrong: the loop will iterate as often as without this case structure!
You are right. But, I told that the whole code must be in the case structure.
10-06-2020 03:26 AM - edited 10-06-2020 03:30 AM
Hi Ashkan,
when you are answering all those very old threads then you should supply good solutions!
This would be a "great" solution IMHO:
The first sequence frame is just for illustration, the main point is to use THINK DATAFLOW to read the stop button just at the end of the code inside of the loop!
@Ashkan8203 wrote:
**Why do you need that NOT function? Simply switch TRUE/FALSE cases…
Because the question is about using a stop button!
But this NOT function still is Rube-Goldberg as you can switch cases as easily as the stop condition of the loop…
And the question is not "about using a stop button", but about "when to read the stop button"! (It's a kind of race condition…)