02-01-2010 03:51 AM
Hi all,
Has anybody ever tackled this problem and come up with a solution for a progress bar which displays elapsed and estimated time.
In order to do this the VI should realise:
- N iterations
- i iteration (current)
- what is the average time per iteration (as a running average)
Has anyone done this?
What about the .NET implementation of a progress bar. Does anyone know how to use it?
Thanks.
02-01-2010 04:05 AM - edited 02-01-2010 04:14 AM
i guess there is one somewhere in this forum created by Daren.
Try his nugget posts.. may be this
02-01-2010 07:44 AM
Hi.
Could this be something helpful?
It does not calculate the average time per iteration. In this example I use time delay variable instead.
Code for LV 9.0.
02-01-2010 08:25 AM
Sorry for two posts in a row.
I have modified my VI a bit for it to match your needs better while including this point also:
@battler. wrote:
In order to do this the VI should realise:
- what is the average time per iteration (as a running average)
I am very novice to LV, so if this won't be what you really need, maybe it will leastwise give you some ideas putting you in the right direction.
Giedrius
02-01-2010 05:18 PM
Hi there. Thanks for the effort.
I think it's a good start but needs refinement.
I have attached an image of the block diagram for others to look at:
Please post your suggestions.
02-01-2010 10:15 PM
02-02-2010 04:18 AM
I think that's the least of our worries with this VI.
What about the sequence structures with separate timers..
02-02-2010 04:19 AM
02-02-2010 06:34 AM
Guruthilak wrote:
could be better if you fix those coercion dots.... 🙂
That is true. I should also move the part of the code for the elapsed time measurement and the stop button outside of the sequence structure to the body of the loop. While I am a novice, I still need to learn to code more correctly.
But in this case all of that should not be a problem for the author of the question. The point is if the provided algorithm to implement the task given by the author is ok or is it not 🙂
The algorithm in each iteration measures the time used to implement the task and calculates the average of time used per iteration. If you will change the time delay (or if some iteration will require more or less time) the average and therefore the "expected time of execution" will converge to the appropriate direction. In parallel, the "execution time left" is also adjusted to correspond to the differencs occured. We also have the progress bar and elapsed time indicated too.
Excludind the "ugliness" of the code, maybe there is some lapse left. I'll leave this for you guys to find out.
02-02-2010 07:31 AM
I have made some minor changes.
The code works fine to me:
But maybe something more specific is required.