LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

percentage completed bar

I have a program which need to take a long time to run. I want to make a bar and it will tell me how much analysis does the program complete and how long do I still need to wait. Does anyone have any idea how to make it
0 Kudos
Message 1 of 6
(4,033 Views)
There are two parts to your problem:

(1) The numeric palette has a "horizontal progress bar indicator" Use this on the front panel (..or the one from the dialog controls).

(2) You need to write to it at regular intervals in your code. For example, if your main computing loop does 1000 iterations, just place the terminal in the loop and wire N to it. Make the scale go from 0...1000.
There are many other ways to do this and you can get arbitrarily complex if the code is complicated. You might need to write to it from different parts of the code using e.g. locals.
Message 2 of 6
(4,033 Views)
Hi Sai Kit,

If you know your VI exe time exectly, you might want to use parallel looping. And place the progress bar inside your parallel loop. Or else use the above way.
0 Kudos
Message 3 of 6
(4,033 Views)
I would not rely on any absolute time or it will break once you change computers.
0 Kudos
Message 4 of 6
(4,033 Views)
Hi Sai kit,

Happy New Year!!!

Same problem i also had where i was generating reports which were taking lot of time..without any message or pop up, my program seemed to be hang/ inactive.

Here i was doing some sorting process in many For & While loops. What you need to know is how many times your loop will be rotating ?

I have attached a vi which is independent of time your programs takes.

Hope it works. Your feedbacks are welcome.

Best Regards,
Nirmal
Message 5 of 6
(4,033 Views)
Hello,

If your program is taking a long time to execute in a For Loop, you can use the attached For Loop Progress Bar VI. I wrote this VI because I have a UI application that processes large arrays of files depending on user selections, and all those processes occur in For Loops. Anyway, all you have to do is wire the "N" terminal of the For Loop to the "Total Iter" input of this VI, and the "i" iteration terminal to the "Current Iter" input of this VI. You can also wire a message to display above the progress bar. The VI does not do anything for its first second of operation, but after one second, if it determines that you are less than halfway through the total iterations of the loop, it displays its front panel (which is the progress bar). You can w
ire in a different value if you want it to wait more or less time than one second.

Let me know if you have any questions on its operation. It is saved in LabVIEW version 7.0.

-D
0 Kudos
Message 6 of 6
(4,033 Views)