LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Executable Code Speed Vs. Development Environment Code Speed under windows 7

Hi,

 

I implemented a "closed loop" type controller in Labview 2012 running on windows 7 to control a motor speed. In my code, I have a main loop that first measures data using a PCI daq card, and then processes the data, and then output data to another PCI daq card. The main loop is set to run at 100Hz. So, 100 times a second I read data, then process the data, then output new data. I am using the Input daq card timing to sync the main loop to 100Hz. When I run this code in the Labview development environment, it seems to run just fine and is able to keep up with the 100hz loop time with no apparent lag. but when I create an executable and run it (on the same machine), it initially appears to run at 100Hz but soon after that it starts to slow down to about 10hz or less. This is causing issues with my motor control. I set the priority of the application under windows task manager to real time (which is the highest option available) to force Windows to let it run as fast as possible but it didn't seem to help much. I compared using a while loop and a timed while loop and found that the while loop ran faster when creating the executable. Any thoughts on what to do to make the executable run faster and why does this happen?

 

Thanks

0 Kudos
Message 1 of 2
(2,589 Views)

Can you post the code?

A wild guess is that there's some array growing wildly causing memory issues, and if you let the program run for a while longer it'll crash with out of memory error.

Is the program only supposed to feed data from one card to the other?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 2
(2,555 Views)