03-16-2009 11:07 AM
Hi Everyone, I'm relatively new to LabView, using 8.5.
I want to display a message while a for loop executes, requiring no user input to clear the dialog box (ie, the box disappears after the For Loop ends).
Any ideas?
Thanks
Darren
Solved! Go to Solution.
03-16-2009 11:15 AM
03-16-2009 11:21 AM
Hi Darren,
Take a look at this Nugget by Darren* where he posted code for a progress bar to monitor the state of a For loop.
Ben
* sorry but I could not resist the tempation to use a post by Darren to answer Darren.
03-16-2009 11:25 AM
THanks for the response.
I am doing a simple logging task; I have a "for loop" that takes reasdings off a transducer (a displacement device) to get a baseline number, taking these numbers and subtracting them from another displacement reading. I just want the slight delay in the program while the initial readings are gathered, to have a visual indicator that the system is doing something during the 3-4 seconds that the computer seems to "hang". Once the readings are over, the dialog box is gone.
Basically the dialog would not prevent the VI from running, it's just a message.
THanks
03-16-2009 11:27 AM
That might just do the trick. I'll have a look after lunch, and post back if it's a good match.
Thanks
Darren
03-16-2009 11:33 AM
Ben wrote:Hi Darren,
Take a look at this Nugget by Darren* where he posted code for a progress bar to monitor the state of a For loop.
Ben
* sorry but I could not resist the tempation to use a post by Darren to answer Darren.
Cool nugget! I was going to launch a parallel process using a notifier but this is much simpler.
03-16-2009 04:39 PM
03-17-2009 10:58 AM
I must be going about this the wrong way. I've got the "for loop", with a Daq assistant inside taking data from my transducer. I've got 10 "samples to read" at a rate of 2 hz, so that should take 5 seconds. I've got 1 loop iteration, so it should only perform this data gather just once (so a total of 10 samples).
I've changed the parameter in the "nugget" progress bar so that it ldoes nothing for the first 1 ms (something very small, so that it works immediately), which follows that the loop should be still running after 1 ms, it then looks to see if it is more than 0.99 (I changed from the default 0.5) done with the loop iterations, and if so, does nothing - but to read for 5 seconds, this should always be showing......I'm doing something incorrect....
It will work if I put in more than 1 loop (I tried 5 and it works nicely, but I don't need that many samples).
Ideas??
from the original nugget explanation:
"In its default configuration, this VI does nothing during one second's worth of iterations of the For Loop. If after one second, the For Loop is still running, the subVI checks to see if the loop is over halfway done with its iterations. If it is, then the subVI continues to do nothing for the remainder of the iterations. If, however, the loop is less than halfway done, the subVI shows its front panel, which is simply a progress bar indicating what percentage of iterations the For Loop has gone through. I find this VI is a great way to indicate to users that my main VI is actually doing something. The subVI also has a Wait Time input that lets you change the default wait time if you think one second is too long to wait (or too short)."
Ben wrote:Hi Darren,
Take a look at this Nugget by Darren* where he posted code for a progress bar to monitor the state of a For loop.
Ben
* sorry but I could not resist the tempation to use a post by Darren to answer Darren.
03-17-2009 05:39 PM
03-18-2009 08:42 AM