From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
If unwired it would default to 0, and at least let thread switching occur. You could maybe right click on the loop and remove the wait node to make it run as fast as possible (like it is now), but it should be there by default... Maybe also right-click on it and get to choose between "Wait (ms)" and "Wait until Next ma Multiple"?
(PS: I know that you can do this using timed loops, but I'd like to see it in all of them - I've seen too many "programmers" complain that their CPU is at 100% because their loops are going nuts).
It might be hard to add a Wait function into every while loop because it could have implications for customers upgrading (e.g. adding wait to a loop that already has one). I agree that it is along the good programming practices though. What about adding the Wait/Wait Until Next Multiple to the While Loop in the Express>>Exec Control palette? This feels more like a template (you should do this) type of thing. Do you think that this would capture what you were looking for with your idea?
It might be hard to add a Wait function into every while loop because it could have implications for customers upgrading (e.g. adding wait to a loop that already has one).
Simple answer: don't change the behavior of loops that already exist. That's pretty standard when updating code.
What about adding the Wait/Wait Until Next Multiple to the While Loop in the Express>>Exec Control palette? This feels more like a template (you should do this) type of thing. Do you think that this would capture what you were looking for with your idea?
No - that's an architecture template (albeit a simple one), I'm talking about a fundamental change to the loop primative.
Got it! So something added to the while loop itself that will add and compile an actual 0 wait by default thereby not changing any existing code if upgraded. We'll see what happens but you have my vote (I use Timed Loops most of the time anyway to get this functionality).
Got it! So something added to the while loop itself that will add and compile an actual 0 wait by default thereby not changing any existing code if upgraded. We'll see what happens but you have my vote (I use Timed Loops...)
Thanks man 🙂 Yeah, timed loops are one of the most underused functions IMHO. Partially due to the screen real estate, and the implication that there's *important* timing going on. THe wee wait in most loops is enough to remind folks that it's not hogging the processor.