LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Progress bar

Hello everyone,

I have been stuck in something from long and do not have an idea about what should be an elegant solution. I am writing a report to word template which i successfully did but now I have to make a progress bar and to show in the front panel about the progress of writing the report to word.

I have attached a picture to this query. I want a solution that if i click the Execute button and if the case structure becomes true than the progress bar should start and ends when the report is being written completely.

Thank you !

0 Kudos
Message 1 of 21
(3,763 Views)

Form the viewpoint of the toplevel VI, everything occurs inside the subVIs and it cannot tell  how long it will take inside each subVI.

 

  • First of all, anything that takes longer than the blink of an eye should not be inside an event case.
  • How long does it typically take to complete the task? (does it depend on task size, computer and disk speed, etc.)
  • Which subVI is the slow part? Is there a FOR loop in it?
  • Do you want the progress bar as part of the toplevel VI (would need a reference connector to the indicator going into the slow subVI) or in a popup (subVI could show its front panel with only a progress bar visible).?
  • Do you really need to show progress from 0..100% or do you just want to show open-ended activity (e.g. busy cursor).

 

We really cannot tell much from a picture containing mostly home-made subVIs. Who wrote them? Can you attach the code?

0 Kudos
Message 2 of 21
(3,749 Views)

If you download the VIPM package "Hidden Gems" you'll find a sub-palette labelled "Progress Bar" that should do exactly what you want.

 

Otherwise, you can find the VIs in C:\Program Files (x86)\National Instruments\LabVIEW 2019\vi.lib\ProgressBar or your equivalent directory, or you could use a slider and a notifier or similar to update the value.

 

Note that in either case, you'll have to find a place in your code (typically inside For loops, etc) that can increment the value of the bar. In the image you attached, it seems like that would be inside one or more of the subVIs.


GCentral
0 Kudos
Message 3 of 21
(3,745 Views)

Creating a progress bar that actually gives useful information of how long time is left is often very hard since it can depend on many things. There is lots to read about just calculating time left on the internet.

 

Consider just using a loading/wait/busy gif instead, which you display when the process is ongoing. Just using a busy cursor for more than a few seconds may lead to the user thinking something went wrong, but for shorter stuff, do use "set busy.vi" and "unset busy.vi".

 

Some loading gifs to start with: https://icons8.com/preloaders/

Certified LabVIEW Architect
0 Kudos
Message 4 of 21
(3,551 Views)

The time of the task to be completed depends on the user. There are a set number of bookmarks in the word template and whichever the user wants he can input the bookmark name and the table of that bookmark will appear in the word file. So the task can be as long as 50 minutes and it can be 5 minutes. In the subvis alot of things are happening and there are subvis within each subvi. 

I would prefer a 0 - 100% progress bar. A busy cursor would be okay as well but i think for that i need to know that when does all the tables are written to the table and the word file is filled with the required data.

 

0 Kudos
Message 5 of 21
(3,514 Views)

Yes, there are alot of loops inside these subvis and i am unsure about the usage of notifiers. Is there another way around ?

0 Kudos
Message 6 of 21
(3,510 Views)

I have asked this question before but I have not been answered properly.

So I have a bunch of Subvis in which there are many other subvis having many for loops. I want to know the method for a progress bar other than by using notifiers or global variables. Is there a way to do it ?

0 Kudos
Message 7 of 21
(3,403 Views)

There are many ways of creating a progress bar that does not use notifiers or globals. But instead of being scared of them I suggest you learn them.

 

A search produced some other examples. Google "labview progress bar", or read this thread.

 

 

Certified LabVIEW Architect
0 Kudos
Message 8 of 21
(3,393 Views)

It was only a few hours ago you made your last post. That thread has one new reply. 

Certified LabVIEW Architect
0 Kudos
Message 9 of 21
(3,391 Views)

Just for fun, I made a progress bar using channel wires. It is really neat and nearly no code, and fully asynchronous.

 

See attached file.

Certified LabVIEW Architect
0 Kudos
Message 10 of 21
(3,375 Views)