LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW running very slow over time

Solved!
Go to solution

I have been working on a project at work for a device to measure the torque capacity of a damper. For this I have two torque transducers one small one large. And a linear actuator to help measure an angle using the law of cosines. My problem is within the first 30 seconds the program runs great after a minute or so it starts slowing down. Since this is a testing device safety is a top priorty and I would like to keep the delay to a mininum. The digital out in the while loop creates an output that shuts the linear actuator if the torque gets too high. Any ideas would be helpful to speed this up.

 

Thanks for your time 

 

Carl 

0 Kudos
Message 1 of 7
(5,414 Views)
Solution
Accepted by topic author carlgober90

Why are you creating a new DAQ task for the digital output within the loop itself on every iteration?  That Create task belongs before the loop.

 

 

You have 3 arrays that you are building continuously in shift registers.  As they grow, the computer needs to find ever larger pieces of contiguous memory to store those arrays.  I'm surprised you are having problems after only 30 seconds, but not surprised you are having the problems ultimately.  I bet the reason I listed above is the reason it is happening so fast.

 

Try using the producer consumer archtitecture to pass the values off to a parallel loop and write the data to file condinuously there.

 

I see in your instructions you are telling someone to hit the Abort button to stop execution of the code.  That is always a bad idea.  You should design your program as a state machine where you have different states for running and setting up different parameters.  A user should never hit the Abort button  (you will fail to clean up tasks properly.)  And they really should never need to hit the run button either once the application is compiled into an executable.

Message 2 of 7
(5,405 Views)
Who was it on the forums who described the abort button as stopping your car with a tree... it stops, but there may be consequences...

I'm lazy, it's late, I could look for it and give proper attribution. Still one of my favorite LabVIEW sayings.

Dave
David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
0 Kudos
Message 3 of 7
(5,348 Views)
Can't edit posts on the iPhone/Mobile Safari interface...

Found it easily enough. It was Ed Dickens.

http://forums.ni.com/t5/LabVIEW/While-Loop-and-For-Loop-dont-stop-executing/m-p/557419

Dave
David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
0 Kudos
Message 4 of 7
(5,341 Views)

hie RavensFan..

can you provede links/examples regarding state machine programing in labview. i know it for controllers but here i don't have clue.

 

 

thanks & regards,

0 Kudos
Message 5 of 7
(5,332 Views)

Go to File/ New ... in the LabVIEW menu.  There is a template for it in there.

0 Kudos
Message 6 of 7
(5,283 Views)

A fast google search, and you will by your self be able to find design patterns for LabVIEW.

 

But I will help you: State Machine

0 Kudos
Message 7 of 7
(5,244 Views)