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.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
crelf

A native ms wait in every loop

Status: New
 NativeLoopWait.png
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).




Copyright © 2004-2023 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
14 Comments
G-Money
NI Employee (retired)

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? 

crelf
Trusted Enthusiast
by Active Participant G-Money on 03-28-2011 07:02 PM




Copyright © 2004-2023 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
G-Money
NI Employee (retired)

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).

crelf
Trusted Enthusiast
by Active Participant G-Money on 03-29-2011 09:37 AM

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.





Copyright © 2004-2023 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.