Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

data acquisition rate slow down

My data acquisition system is configurated with a PCI-6110 ADC card for simultaneously sampling of 4 input signals once an external hardware trigger. The sample rate is 5MS/s. The buffer size is 50 samples for each event. Everything looks fine with LabView except that the data acquisition rate slows down as the time goes on. For example, if the acquisition rate is 100 event/second at the beginning, after 1 hour, the rate goes down to about 50. Then 5 or 6 hour later, the rate could even go down to nearly 1 event/second. I checked the acquired data still OK. Is anyone could tell me what this feature might come from? Your helps are greatly appreciated. Thanks

-Yujin
0 Kudos
Message 1 of 8
(4,943 Views)
Could you please post your code?
We may be able to help if we could take a look at what you are trying to do. I suspect a memory leak but do not have enough info to suggest where to start looking.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 8
(4,941 Views)
Basically, my test code was modified from the example VI of "acquire N-multi-analog hardware trig.vi". Attached is my code. I highly appreciate your helps. Thank you very much.

-Yujin
0 Kudos
Message 4 of 8
(4,941 Views)
Hello;

The best troubleshooting now is to run one of the Labview shipping examples and investigate if the same behavior shows. Don't make any change at the example, run it with the same default parameters. If the same problem shows, the board is probably defective. If not, you have something in your code that is causing that, then I would suggest you to use the example as the start point for your development.
Hope this helps.
Filipe
0 Kudos
Message 3 of 8
(4,942 Views)
I am much better with visual aides.

If I read your code correctly, you are collecting data and piling it all up in memory. After you app has used up all the available memory, it will start using virtual memory. This will continue (slowing down as it goes) until you have exausted even the virtual memory. If the operating system is nice it may tell you this, otherwise the app will crash, probably with a memory violation.

If you really want to collect data at 5MS/s, then you you are going to need alot of memory to buffer all of your data.

Next, on every pass of your loop, you are proccessing more and more data. The more work that needs done, the longer it will take.

One more thing, using the build array function inside a loop will cause LV and the operat
ing system to allocate more memory everytime you try to add more data to a buffer than is already allocated. When these allocations take place LV tries to double the size of the buffer (my opinion only based on observations). This situation is generally avoided by initializing a buffer before entering the loop that is more than big enough to store what you will be collecting. Then inside the loop, use a replace array element(subset) to stick the data in the right place.

Let me know if I can be of further assistance.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 8
(4,941 Views)
Hello Ben,

Your analysis on my problem is absolutely right. The way which I used to generate the histogram plots was not right in term of the memory allocation and array manipulation. I have resolved the problem. Now everything looks OK. Thank you very much for great helps!

-Yujin
0 Kudos
Message 6 of 8
(4,941 Views)
You are welcome!

P.S. By rating the various answer to your question, you will make it easier for others with similar problems to quickly locate the solution.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 8
(4,942 Views)
I have a similar problem. I am using a while loop that stops after a certain period of time or when you push a button on the front panel. The problem is that during this period of time I am aquiring data, and also simultaneously outputing 5.0V. When I change the number of samples to a much large number (say 7200 over 60 min, with 2 samples/sec) -- when safety time is 10 sec, lamp on is 60 min, and lamp off is 5 min -- with this, however, the loop that should stop after 1 hour does not finish for 3 hours.

Any help you can give would be greatly apreciated.

Travis
Download All
0 Kudos
Message 8 of 8
(4,941 Views)