LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Progress bar in Structures

Yes but in my case, using loops are not so encouraged.

if it was possible, I wasn't be here for this old remaining question. Sometime (like in my case) loop timing can not replace those structures because it will continuously command the machine to reset doing task over and over again during that time period.

0 Kudos
Message 11 of 23
(1,389 Views)

@VD89410 wrote:

Yes but in my case, using loops are not so encouraged.

if it was possible, I wasn't be here for this old remaining question. Sometime (like in my case) loop timing can not replace those structures because it will continuously command the machine to reset doing task over and over again during that time period.


From this post and your first post, I surmise that you are not familiar with the cornerstone LabVIEW design pattern, the "state machine"?  At any rate, the proper thing to do is what I said - every time you make "progress", update the progress bar.

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 12 of 23
(1,385 Views)

Bill: 

Ah sorry, the "state machine" I mentioned is actually some "Instrument" that can be driven by Labview, just like my 89410A in the previous topic, it seem not have any performing feedback 

The busy cursor is actually a very good idea, thanks 

 

 

0 Kudos
Message 13 of 23
(1,378 Views)

@VD89410 wrote:

Yes but in my case, using loops are not so encouraged.

if it was possible, I wasn't be here for this old remaining question. Sometime (like in my case) loop timing can not replace those structures because it will continuously command the machine to reset doing task over and over again during that time period.


That's kind of a ridiculous statement since the vast majority of programs require loops.

 

Here is a quick mock up of how to add the loop to show progress in parallel.

 

 

 

Message 14 of 23
(1,372 Views)

Try this.

"If you weren't supposed to push it, it wouldn't be a button."
Message 15 of 23
(1,362 Views)

Wow Ravens, i'm not sure that i understand all what you just gave me.

Would you please give more detail explanation of how mock up work ? or maybe snippet that I can drag and drop to my Labview and see through what each of them does? 

Sorry I'm just rookie, I didn't know if it's possible.

Thank you.

0 Kudos
Message 16 of 23
(1,356 Views)

I did in in LV 2017, and I haven't installed the code capture tool in that yet.  I'll try uploading the built-in LV VI snippet maker (which isn't as good as the code capture tool.)  This will only work for you if you have LV 2017.

 

The inner flat sequence structure is just a place holder for your actual subVI that takes a long time to run.

 

It creates a notifier.  It passes that into a the case structure and into a while loop that will run until it gets a True notification.  Every 1000 milliseconds, it will timeout and update the progress bar indicator.  (If you set the progress bar to be from 1-50, then a full progress bar means 50 seconds have passed).

 

When your subVI is done running, it will allow the send notification to execute (it waits on the error wire coming out of the subVI).  It will send a True in the notification.  The Wait on Notification will immediately end, outputting the True which will stop the while loop.  The case structure will finish, and the Release Notifier will free up that reference.

 

 

 

 

Message 17 of 23
(1,348 Views)

Hey, I've just came up with this simple “no-brainer” code that actually serve my purpose quite well.

progress bar.png

We set the wait time to our structure and then make it to be the time to full the progress bar (in loop execution from 0 to 100 iteration). Say we want our structure to proceed in 10 second, then the input would be 10000ms. In order to progress bar to full in 10 sec after 100 loops iteration, each loop must take 100ms wait time, (this why there is 100 division in loop wait time) so 100 iteration gn take 10000ms = 10sec just exactly the same time we want our structure execution. 

Since the iteration terminal started from 0 so we need to set the scale range of progress bar from 0 to 99 maximum values for it to be full at the end of 100 iteration. In some specific cases, an implemented event structure should help to start the bar timed correctly.

Thank you all!

0 Kudos
Message 18 of 23
(1,302 Views)

@VD89410 wrote:

Hey, I've just came up with this simple “no-brainer” code that actually serve my purpose quite well.progress bar.png


Just a couple comments:

1. Replace the Divide with Quotient & Remainder.  That will fix some of your coercions.

2. Move the divide to before the FOR loop.  No need to recalculate 100 times.  Granted, I believe the compiler does this, but make it easier on LabVIEW.

 

The alternative is to have a fixed wait and then you calculate how many iterations is required.  You use that value to set the Range.Maximum on the progress bar.  Then you still leave the terminal directly wired to the iteration terminal.  I typically do this for processing an array that will take a long time.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 19 of 23
(1,298 Views)

Ah great, I forgot to put the divider outside. So it should be like:fixed.png

Brilliance advice, thank you!

 

0 Kudos
Message 20 of 23
(1,287 Views)