12-01-2003 11:18 AM
12-01-2003 11:38 AM
02-21-2014 09:42 AM
Thanks Ed Dickens, It also helped me.
03-06-2015 10:20 AM
Instead of having loops inside loops, you can do everything with a single loop and a proper state machine architecture. Instead of stopping the loop, you simply go to the idle state while staying inside the loop.
Don't overcomplicate things.
08-11-2015 06:40 AM
Hi Folks,
does it make sense to make a while in case in while structure if the inner loop is a timed loop?
aiming to free up some ressource?
best regards
Sergio
08-11-2015 10:58 AM
08-12-2015 01:16 AM
Because a Timed Loop is (normally & in my case) way faster than a simple while. So LabView would have more time to do some other things than running a time critical loop with idle state, or am i wrong?
08-12-2015 01:34 AM - edited 03-13-2019 11:44 AM
A time loop is more precise, but that has nothing to do with efficiency. Typically the loop timing is determined by a wait statement or by the timed loop configuration. Only if the loop contains more code than an be executed in the allocated time, the loop timing will depend on the exection time of the code inside the loop. Since this is highly dependent on the computer hardware, it should typically be avoided.
@LeonardoD wrote:
Because a Timed Loop is (normally & in my case) way faster than a simple while.
What you are describing makes absolutely no sense.
Can you attach an example of the two types of loops, what they are doing in your code, and how you are measuring the "speed" (whatever that means).
03-12-2019 05:46 PM
I am using a while loop to gather data from a spectrum analyzer and I would like for it to go quiet after getting the last sample. However simply stopping the loop leaves me with a dead loop that I can't restart. Using your state machine example sounds good but as I have only recently started using Lab View I am a little flummoxed on how to proceed. Would I place a SM inside the main while loop and then route signals through it? Can you point me to some suggested study material that may help?
03-12-2019 06:00 PM
Look at the design templates that ship with LabVIEW. There are also example programs.