01-21-2020 10:14 AM
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 !
01-21-2020 10:23 AM - edited 01-21-2020 10:27 AM
Form the viewpoint of the toplevel VI, everything occurs inside the subVIs and it cannot tell how long it will take inside each subVI.
We really cannot tell much from a picture containing mostly home-made subVIs. Who wrote them? Can you attach the code?
01-21-2020 10:23 AM - edited 01-21-2020 10:25 AM
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.
01-22-2020 01:38 AM
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/
01-22-2020 02:53 AM
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.
01-22-2020 02:55 AM
Yes, there are alot of loops inside these subvis and i am unsure about the usage of notifiers. Is there another way around ?
01-22-2020 08:23 AM
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 ?
01-22-2020 08:36 AM
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.
01-22-2020 08:37 AM
It was only a few hours ago you made your last post. That thread has one new reply.
01-22-2020 09:02 AM - edited 01-22-2020 09:05 AM