LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Progress bar in Structures

Hello, 
This might be a bit old topic,

I have some structures (case structure or sequence structure) execute in a period of time, 
So now I would like to have a progress bar to indicate the executing process (time) on that structure.

(The bar would be filled at the end of structure execution)

Progress bar.png

I've seen many related topic but somehow I can not find the proper answer up to now. 

Any ideas would be appreciated.

Thanks!

0 Kudos
Message 1 of 23
(4,151 Views)

The easiest way to implement a progress bar is by iterating over a loop and updating every time through the loop.  With state machines, this is a no-brainer.  However, if you need to complete it within a single structure, you have no choice but to update it explicitly every time you "make progress".  Updating the value every time you need to would do the trick.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 23
(4,144 Views)

You mean that we can implement loop inside structure and make it count as the same time as Structure execution time ? Yea, that kinda waste of computer resources.
But, isn't the timer updating some value on itself when proceeding ? Can we just take out some advantage of that?

 

0 Kudos
Message 3 of 23
(4,125 Views)

I worked for a company who just made a "timer" progress bar in java.  The developers and techs knew it meant nothing, but the users did not.  Do some testing and find out how long it takes and then make a generic timer progress bar.  The user will not care.  As far as they're concerned, it's legit.

 

Otherwise, figure out how many bytes of data you need to hash through, make your progress bar that size via property node, and then occasionally check to see how much you've processed and update your progress bar.

0 Kudos
Message 4 of 23
(4,120 Views)

Well, that sound complicated.

Can you give me some examples of that ? 
Say, I have a case structure like this:
Untitled.png

what it does is just send command to the machine to perform some task, the machine then take some time to do that task, however does not have any feedback to tell labview that when the task is done. So the timer value is just the time estimated for performing task. 

This situation seems to be off-topic, but is there any way to know that when the task is done? As by progress bar ? 

0 Kudos
Message 5 of 23
(4,105 Views)

Instead of a 50 second wait.  Put a 1 second wait in a For Loop that is set to run 50 iterations.   Let the iteration number update the progress bar.

 

Unfortunately you have no direct connection between the progress bar and what is the actual status of what is going on inside that subVI.  If that subVI ends in 2 seconds, the loop is still going to take 50 seconds.  If the subVI takes 70 seconds, the progress bar will stop updating after 50 seconds, and you still have to wait another dead 20 seconds.

 

You could set up a while loop, and use a notifier to tell the while loop when to stop iterating.  When the subVI exits have it send the notification to the while loop to tell it to stop iterating and stop updating the progress bar.

0 Kudos
Message 6 of 23
(4,101 Views)

@VD89410 wrote:

You mean that we can implement loop inside structure and make it count as the same time as Structure execution time ? Yea, that kinda waste of computer resources.
But, isn't the timer updating some value on itself when proceeding ? Can we just take out some advantage of that?

 


In LabVIEW a "progress bar" consists of a slider where you update the value to increment the slider every time you have some progress.  What constitutes "progress" is up to you.

 

What "timer" are you referring to?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 23
(4,095 Views)

If you know how many iterations, but not how long they take, I would base my "progress" the iteration and not elapsed time.  If all you want is to notify the user that the computer is doing something, you can also set the busy cursor when you start and unset it when you are done.  This has the optional protection of disabling front panel access while the busy cursor is active.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 23
(4,092 Views)

@VD89410 wrote:

Well, that sound complicated.

Can you give me some examples of that ? 
Say, I have a case structure like this:
Untitled.png

what it does is just send command to the machine to perform some task, the machine then take some time to do that task, however does not have any feedback to tell labview that when the task is done. So the timer value is just the time estimated for performing task. 

This situation seems to be off-topic, but is there any way to know that when the task is done? As by progress bar ? 


Probably should note that that wait time is simply that... a wait time.  You're telling the code to wait 50 seconds.  Whether or not that task is done before, during, or after the wait is strictly up to LabVIEW, but you will be waiting 50 seconds no matter what.  For a "timer progress bar" you need to have the timer in a separate loop that just sits there and counts when you enter a certain state (which in this case looks like Recall Save).  Although, technically... they could be in the same loop as long as you program it correctly where the action is not included in that timer loop.

0 Kudos
Message 9 of 23
(4,092 Views)

If you're asking if there's a generic progress bar that labview offers that diagnoses whatever it is you're doing and displays a progress bar... the answer is no.  You have to figure out how to diagnose whatever it is you're doing and display progress.  What does progress represent in your case?

0 Kudos
Message 10 of 23
(4,090 Views)