07-06-2017 10:57 AM
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.
07-06-2017 11:06 AM
@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.
07-06-2017 11:26 AM
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
07-06-2017 12:18 PM - edited 07-06-2017 12:19 PM
@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.
07-06-2017 01:29 PM
Try this.
07-06-2017 01:42 PM
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.
07-06-2017 01:56 PM - edited 07-06-2017 01:57 PM
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.
07-14-2017 06:54 AM
Hey, I've just came up with this simple “no-brainer” code that actually serve my purpose quite well.
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!
07-14-2017 07:14 AM
@VD89410 wrote:
Hey, I've just came up with this simple “no-brainer” code that actually serve my purpose quite well.
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.
07-14-2017 07:57 AM
Ah great, I forgot to put the divider outside. So it should be like:
Brilliance advice, thank you!