LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Progress Indicator for A Loop Iteration

Hello all,

 

Does anyone know any method of including a progress indicator for a loop iteration? The motivation is that I use a wait function to hold the VI while a spectrum is acquired from an oscilloscope, and I was trying to use the count from the wait function linked to a slide bar in a sub while loop but this doesn't seem to work at all.

 

Maybe someone already has a solution?

 

Thanks!

0 Kudos
Message 1 of 7
(4,506 Views)

Plenty of solutions available one such: https://decibel.ni.com/content/docs/DOC-2061

and this http://www.ni.com/example/26232/en/

Thanks
uday
0 Kudos
Message 2 of 7
(4,503 Views)

quantisedpenguin wrote:  I was trying to use the count from the wait function linked to a slide bar in a sub while loop but this doesn't seem to work at all.

Try using the iteration terminal of the loop.  If you know how long you are waiting, use a FOR loop to run 100 times (as an example).  So if you need to wait 1 second, you set your wait inside of the loop to 10ms.  Each iteration of the loop will increment the slider for you.


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
0 Kudos
Message 3 of 7
(4,494 Views)

Hi, thanks for the reply!

 

The decibel one I also found, this is where I got the inspiration for my first attempt. I'll have a look at the second one you posted and see if that works.

 

Thanks again

0 Kudos
Message 4 of 7
(4,474 Views)

I think there is some slight confussion, I don't need the progress of the whole loop, I need the progress of an induvidual interation of the loop!

0 Kudos
Message 5 of 7
(4,472 Views)

Do you want your indication to be something that progresses from 0 to 100%?  Or something that tells how long the loop has been running?

 

You can't know if you are at 100% unless you know how long the single loop iteration takes.  What you can do is set up a separate loop whose sole job is to update your time indicator, or your progress bar.  Have the loop send a notification when it starts to the other while loop to start the timer.  Have it send another to stop the timer.

0 Kudos
Message 6 of 7
(4,462 Views)

@quantisedpenguin wrote:

I think there is some slight confussion, I don't need the progress of the whole loop, I need the progress of an induvidual interation of the loop!


The progress indicator only gets update once per loop iteration, so of you need finer control, you need to create something that updates more often. What is the time limiting process inside the loop? If it is another loop, you could use that, place the indicator in the innermost loop, and use a combination of the inner and outer iteration terminal to compute the fractional progress.

 

Also note that if you use  parallelized FOR loop, the value from the iteration terminal may not be sequential but will jump all over the pace. (There is a progress bar solution for that scenario too, but it is slightly more complicated.).

0 Kudos
Message 7 of 7
(4,439 Views)