Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Some functions make my vi slow

Solved!
Go to solution

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.

0 Kudos
Message 1 of 7
(3,516 Views)

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.

0 Kudos
Message 2 of 7
(3,515 Views)

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?

0 Kudos
Message 3 of 7
(3,488 Views)
I don't really know what you mean by slow. Do you or don't you want minutes between reads? If you do, that is what you have programmed. It is acquiring at predefined intervals. The way you've done is the acquire 'number of samples' as quickly as possible, wait, repeat.
0 Kudos
Message 4 of 7
(3,484 Views)

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.

0 Kudos
Message 5 of 7
(3,478 Views)
Solution
Accepted by topic author T._Borges

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.

Message 6 of 7
(3,475 Views)

Thanks, Dennis.

I placed  Elapsed Time function and worked pretty well.

0 Kudos
Message 7 of 7
(3,465 Views)