LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I display a progress bar which obtains its value from the loop of a sub-vi?

I know how to use the progress bars using LV7.

The main vi calls a sub vi which has a loop. Within this loop, calculations on progress is made. I want to display the progress on the front panel of the main vi.

How do I pass the values from within the loop of the sub-vi to the main vi in order to show progress on the progress bar?
Message 1 of 14
(11,300 Views)
You can use a horizontal fill-bar to do this. You set the Max. value to the amount of times your loop should execute, and then simply wire your Loop increment (i) to it. Simple.

However, getting the sub-vi to update on the main VI front panel can be tricky. I would recommend simply hiding everything on your sub-VI panel except the horizontal fill-bar. By making the sub-VI window just large enough to show this, and making the window pop-up when called and then close again when finished will simply create a pop-up showing the progress. This will also leave more space on the main VI front panel, as the sliding bar will disappear when it's not used.

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 2 of 14
(11,299 Views)
next question (maybe I should post a new thread?)

How do you make the sub-vi pop-up?
0 Kudos
Message 3 of 14
(11,299 Views)
>How do I pass the values from within the loop of the
>sub-vi to the main vi in order to show progress on
>the progress bar?"

My opinion, that the best way for to do this is notification. See in attachment.
Message 4 of 14
(11,299 Views)
Why not just pass a reference to the subvi? With a reference you can update indicators on the front panel of the main vi from the subvi.
Message 5 of 14
(11,300 Views)
You're right. For situation above realization with reference have less code for implementation.
0 Kudos
Message 6 of 14
(11,300 Views)
> How do you make the sub-vi pop-up?"

There are two different examples. One with notification and one reference.
Download All
Message 7 of 14
(11,300 Views)
Here only one small disadvantage for passing reference to the SubVI. The problem, that Property Node executed in UI Thread, and if UI will be blocked (with DLL call for example), then Progress Bar (and SubVI completely) will be stopped. May be critial for data acquisition loops or something like that.
See my last example. (that was enough "Progress Bars" for today :).
Message 8 of 14
(11,300 Views)
The example by reference did not work..
0 Kudos
Message 9 of 14
(11,300 Views)
Appologies.

The example for the pop-up window by reference did not work.
0 Kudos
Message 10 of 14
(10,945 Views)