LabVIEW Idea Exchange

About LabVIEW Idea Exchange

Have a LabVIEW Idea?

  1. Browse by label or search in the LabVIEW Idea Exchange to see if your idea has previously been submitted. If your idea exists be sure to vote for the idea by giving it kudos to indicate your approval!
  2. If your idea has not been submitted click Post New Idea to submit a product idea to the LabVIEW Idea Exchange. Be sure to submit a separate post for each idea.
  3. Watch as the community gives your idea kudos and adds their input.
  4. As NI R&D considers the idea, they will change the idea status.
  5. Give kudos to other ideas that you would like to see in a future version of LabVIEW!
Top Kudoed Authors
Showing results for 
Search instead for 
Did you mean: 

Built In Delay into While Loops

Many times a while loop needs a delay for one reason or another, even if its just to add a small delay so the program doesn't peg the processor.  Having this would clean up BDs, and it would also act as a reminder to make sure your code doesn't peg the processor.  (with nothing wired to it, it would default to zero)

Built In Delay into While Loops.png

  • UI & Usability
16 Comments
Knight of NI Knight of NI
Knight of NI
I know that few of my loops in the last few years need a wait. I have a lot of while loops with an event structure and a lot of while loops with hardware I/O. No need for waits at all. I don't see the need to modify LabVIEW either.
Knight of NI Knight of NI
Knight of NI

How about adding another while loop with a wait to the structures palette?

 

I haven't looked at AQ's code, but I've had a merge VI in my structures palette for years which drops a while loop with a wait (defaulting to 100 ms) and a stop button and another one which drops a loop with an event structure and a stop button.

 

These merge VIs are very useful for me when I want to write a quick VI to test something and don't want to use the run continuously button. This will also be similar to the while loop from the express palette which, if memory serves, is dropped with a stop button. It will also make the structures palette more crowded, which is a valid argument against it. 

Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast

One usage I would like to highlight is the apparent target audience of NI, the vast majority of which won't be posting here.

 

N00bs.  How many times do people answer problems from users who simply don't understand the ideas behind task-sharing.  These less-experienced "programmers" (I use the term with reluctance) are probably the ones who would benefit from this most as they will have less heavy items to drop on their feet while "programming".

 

I would probable almost always use the version without, but I can see a use for it.

 

OTOH, what percentage of code uses User Events?  Or Semaphores? Or Occurrences?  Should we get rid of them because the're not mainstream (With the possible exception of feedback loops)?

 

PS I would prefer the default state to be with a red line through it indicating no wait and only becoming active if something is wired to it.  This is a slight difference to the "zero when unwired" which I think would make it more usable.

Message Edited by Intaris on 03-22-2010 07:45 AM
Active Participant Brian_K.
Active Participant
I believe this is already addressed with the timed loop.  Also most of my loops don't needs waits.  If you did add it you would need an option to choose wait until versus just wait, which once again seems like a lot of work for a feature not often to be valuable.
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast

Don't timed loops add sone not inconsiderable overhead though?

 

I don't see the two as being equivalent.

Active Participant G-Money
Active Participant