10-20-2011 05:11 PM
In your example you have your DAQ running at 51200 samples/s and you ask to collect 163840 samples - that will take approx 3 secs. Your loop will only run at this 3s rate. When your DAQ is running continuously the loop rate is determined by your scan rate and the number of samples you collect each time, you don't need the miliseconds to wait inside the loop. If your processing takes longer then this will determine the loop rate and the DAQ buffer will slowly fill and you will get a DAQ error.
10-21-2011 02:17 AM
I understand why I have this DAQ error. The question to find another solution.
10-21-2011 08:31 AM - edited 10-21-2011 08:32 AM
If your data collection and processing times aren't going to change, you at least need to do the processing in parallel with the data collection. You can use a producer/consumer architecture to do this. However if your processing takes 3-4 times as long as the data collection, you're queue will fill up. You could have multiple consumers and distribute the processing between them.
10-21-2011 08:40 AM
So, I need transfer data to the parallel loop. If I use queue, then I will have another problem - more and more "unprocessed data" in the queue, and overflow at the end.
10-21-2011 08:41 AM
Or I can use file to store data, but then it will be not real-time system
10-21-2011 08:41 AM
I agree with the others. As long as your processing time is larger than than your data collection time you are in trouble. As asked before. Is your processing VIs made so efficient as possible. Wrong array handling may in many cases hog CPU time, then using large arrays. .
10-21-2011 09:16 AM
If you use one queue your data will pile up. If you use multiple queues, it might not. I attached a vi with my idea. I'm not sure if it will work in your situation and I'm sure that there are better ways to do it, so feel free to comment on it.