I'm writing to find out why a certain piece of code doesn't work the way I think it should. I've attached an image of some proof of concept code. I have two while loops. Both display how many iterations they've been through. One runs constantly checking an abort button and when it's triggered it sets another button (stop 2) to the state of the first. This is essentially supposed to be an abort button (I'm using this practice in another piece of code). The other loop has a numeric input, then displays its iteration while waiting for a local variable to say that boolean "stop 2" has been triggered. This code yields inconsistent results. Most often, pressing play from the front panel yields the result shown in the screenshot. "Numeric 2's" while loop runs the way I expect it to, but "Numeric 1's" loop _never_ runs. If I'm in "highlight execution" mode, both while loops run the way I expect them to. Here's where it get's really strange though. If I'm on the front panel and I click play (without highlight execution turned on), then I press the "Abort Execution" stopsign button, the next time I press play both loops run the way I expect. Then, pressing the stop button, and pressing the play button one more time, the loops go back to the normal screwy behavior (numeric 2 runs but numeric 1 doesn't).
I get this behavior on both 8.5 and 8.2. Is my understanding of how this should work screwed up? Why is there inconsistent behavior? If numeric 3 is removed, both loops run at the same time (like I'd expect). Why does numeric 3 adversely affect the way its loop runs? From the basics class, I learned that nothing guarantees that both those while loops get run. They're both being nice with the CPU though, it seems like they should. When I wire numeric 3 to both loops, both run normally. My understanding is that there is nothing guaranteeing that both those loops should run.
What's up? (I won't get to check up on this for about 17 hours...) Thanks...