07-03-2012 01:47 PM
You are also enqueing data in your daq loop and dequeing in your second loop, which is throttled by a waitmS. Wait and Dequeue should not usually be used together as you could be running the dequeue loop slower than the enqueue loop and fill up the queue causing a memory leak and youe applucation to see "old" data
07-09-2012 08:32 AM
Any inpuy on what I should do to stop the shift registers from growing, which ones are the problem?
07-09-2012 10:22 AM
The shift registers that can grow are your shift registers that contain arrays. Notice that each iteration of the worker while can add an element to those arrays (look at the brown array wire data types in your top while loop).
The code will need to be written in a way that array data is replaced rather than constantly appending to it.
Memory usage can be monitored in task manager, you should see a consistent allocation. Since the program is getting memory errors it is likely that its memory usage is slowly increasing.
07-09-2012 12:22 PM
Im not sure how to do that and still keep my data for the graph. The whole point of that array is to build the xy graph for a test long plot. If I reset the values in the array or dump the data in the array, I will loose the data that I am using for my xy graph.
07-11-2012 08:57 AM
If the problem is with the cluster size pressing the main reset each of the Rigs should bring the memory usage down.
Could you monitor the memory usage and see if you see this behaviour?
07-11-2012 09:06 AM
Yes, it does bring the memory down, but I cannot press that reset button while running a test because it will reset the cycle count defeating the purpose. The reason for the cluster is to make the xy graph of cycles vs displacement at whatever time interval specified. It will also reset my cycle count. I ran the program yesterday and initially it had 95k of memory and steadily increasing. I stopped te vi and restared it, because there were some values I didn't default, and when I restarted it, the usage was down to about 20k, andthe cycles per minute was working corectly again. So I monitored it all day and it ran for over 8 hours and the memory only got to just over 30k. When I came in this morning it was 1,980k and out of memory error again. I need a way to delete the data from those arrays without losing the last data points. I dont know how to do that. I think Im going to just eliminate it for now because I need to run a test
07-11-2012 12:52 PM
Well I completely eliminated the part of the code that had the array which I thought was the issue, and after only two hours, I got an out of memory issue again. Also my CPM count keeps resetting after a minute. The way that is supposed to work is to take a number of samples thn divide by the number of cycles a that point to get the cycles per minute. This code worked perfectly in the past, and also worked perfectly on this machine and program just yesterday, when I thought I fixed the problem. I am completly stumped here, and need this to run yesterday for a test. Any help would be greatly appreciated. Another thing I noticed was the memory allocation going from around 90k, down to 30k, simply by stopping and starting the executable.
07-11-2012 01:12 PM
Well, here are some quick tips to possibly get it working.
Make sure your Aquisition Loop Wait Time control is set to 0.
Set your sample rate to something lower than 1kHz.
As someone metioned before however it would be a really good idea to refactor this code. If you can define exactly what it needs to accomplish we can work through it here.
07-11-2012 01:23 PM
OK, I'll try to explain the vi. It is a test rig that needs to monitor load via load cell, displacement via LVDT, torque also via load cell on an oscillation arm, temperature via thermocoouple, and cycles via analog prox switch. I need to count the cycles and turn that into cycles per minute. Monitor all the inputs max and min values and reset them every minute. I also need to plot a graph of displacement vs cycles every 24 hours after the rig stops for a specified amount of time for cool down for correct measurement not ifluenced bythe temperature of the test specimen. Also need to contaminate the specimen every so often for a legnth of time, specified by user. All of which I had working , so I thought, fine until I made the changes of adding the torqu to the analog in, and moving the load to the analog in from the strain daq. And finally I need to write all the monitored values to file at user specified legnths and frequency. I hope this helps you better understand my vi.
07-12-2012 10:42 AM
I got rid of the array and also got rid of the queue, and I'm still getting a memory issue. Short of rewriting the whole program, I can't see what could be causing this, can anyone help me out here?