03-07-2010 08:46 PM
Hi,
I'm new using LabView, but i have some problems with my .vi...
My vi is working, but after using some functions like FileDialog or time delay it goes very slow...
Can someone please tell me if there is a problem?
Thanks.
Solved! Go to Solution.
03-07-2010 09:02 PM
It would seem it would run as slowly as you have written it. With every iteration of the outer while loop, you will get a file dialog and nothing will run until that is done. You've also got quite a long delay in the outer for loop and there will be that delay between for loop iterations.
You've got some strange code as well. It's silly to bundle your scalars before writing to the charts. Don't wire a constant to your while loop's termination terminal. Just bad practice to use the abort button. It's also silly to use multiple Index Array functions. You can drag the bottom for multiple inputs. Don't even have to wire up the index inputs since you are getting the elements in order.
03-08-2010 12:29 PM
I just tried to delete a few parts, like you said, it became a little bit faster, but it still slow...
I think it's because i'm using a time delay to delay minutes, not seconds.
How can i make my loop wait for some minutes without this?
I need to acquire data at predefined intervals. Can you help me, please?
03-08-2010 12:41 PM
03-08-2010 01:01 PM
Yes, that's what I'm trying, but when the acquisition ends my .vi became so slow and because of that I can barely stop it, so I use the task manager to finish it.
But, about the timing, do you know anything about delaying loops? Because I'm lost here... Thank you, really.
03-08-2010 01:25 PM
That is expected with the Delay function since it not interuptable No button will be processed until the delay times out. Though since you have no stop button, I don't see what the difference is.
Instead of using a long delay, you could try using the Elapsed Time function and wiring the Time Has Elapsed output to a case statement. Place your acquisition code in the true case. You could also use the tick count function and do a comparison each loop iteration.
03-08-2010 01:53 PM
Thanks, Dennis.
I placed Elapsed Time function and worked pretty well.