12-23-2014 10:04 AM
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
Solved! Go to Solution.
12-23-2014 10:22 AM
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.
12-23-2014 11:22 PM
12-23-2014 11:28 PM
12-24-2014 12:21 AM
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,
12-24-2014 03:04 PM
Go to File/ New ... in the LabVIEW menu. There is a template for it in there.
12-25-2014
07:53 AM
- last edited on
09-14-2025
09:52 PM
by
Content Cleaner
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