01-02-2013 08:36 AM
Hello.
Here my question:
I need to change programmatically the period of a timed loop. This is not a problem but:
I have to wait up to the next loop to submit the new period value. For example if my previous period was 20 minutes, now I have to wait 20 minutes in order to submit a new period.
This beacause the code to change the period must be inside the timed loop itself. You can see what I mean in the attached image.
The subVI gets the new period from a operator console. It will be executed only at the end of the period previously configured.
My question is: Is it possible to force the timed loop to get the new value without to wait the execution of the previous period?
Thank you
fpia
Solved! Go to Solution.
01-02-2013 08:43 AM - edited 01-02-2013 08:49 AM
Hi fpia,
sometimes it might be more useful to wait for 1200 seconds instead of 20 mins 😉
It has been suggested a lot of times before: instead of waiting for a long time with just a single call of a Wait function you should split that amount of time into several smaller pieces!
- Why don't you use a timing period of e.g. 5s and just count the iterations to know when 20 mins are over?
- Why don't you use the "Elapsed time" function to know when 20 mins are over?
01-02-2013 08:45 AM
Gerd beat me to it. You really should make your loop iteration much smaller and then use a count of number of cycles before performing your next operation. Then you can easily change how long to wait for each operation.
01-02-2013 09:30 AM
Thank you Gerd.
My labview experience is not very good. I believed that one iteration over 1200 seconds was less CPU consuming. This beacause I've several loops like that, not just one. So in my head I thougth to execute each loop in 1200 seconds and to "wake up" them (if necessary) with some function or someting that I don't know!
Anyway, because you wrote "it has been suggested a lot of times", I think your solution is better than what I tried to do. I'm going to write it.
Thank you for you suggestion.
fpia
01-02-2013 09:38 AM
@fpia wrote:
My labview experience is not very good. I believed that one iteration over 1200 seconds was less CPU consuming.
To the computer, anything more than a few milliseconds is an eternity. So having 1 second loop vs 1200 second loop will do next to nothing to the CPU consumption.