02-12-2015 04:37 AM
Solved! Go to Solution.
02-12-2015 06:31 AM
I've had a look at your VI and found a few things:
Reference leaks - if you have 'Launch EXE' set to true, you are launching an executable every 100ms and creating a .NET Process object every 100ms. You need to close those references otherwise your application will grow in memory.
In your Leitor VI, you are constantly reading/writing an entire file from disk - just open the file outside of the loop, write the rows of data inside the loop and then close the file outside of the loop. If you need to start a new file you can close/open a new file when you need to inside the loop. Generally it is better to do file IO outside of your data acquisition loop - you should look at the producer/consumer architecture for how to do this.
You are also keeping the whole data array in memory which means the longer your application runs, the more memory it will use and this will cause the slowdown.
You are using lots of property nodes for reading/writing booleans and updating your charts - this is generally considered bad practice and you should look at proper methods for communicating between VIs (e.g. events, queues and notifiers).
02-12-2015 07:26 AM
Sam_Sharp wrote:
You are also keeping the whole data array in memory which means the longer your application runs, the more memory it will use and this will cause the slowdown.
If you are trying to run a program for a long time (I'd even say over an hour), you just cannot do this. Read a bunch and send the data to disk. I highly recommend using the Producer/Consumer for this. If you want to show data, use charts with keep a history, but only for X many samples.