02-26-2010 10:51 AM
Hi all,
I am doing high speed data acquisition (max about 50kS/s, NI9239). I want to be able to create a min/max filter where in I can set or control the sample size for which min/max has to be found. My thinking is if I could create and control the array size and stream the data in, that would solve the problem. One of the other problem in doing it is, Say if I am recording data at 50kS/s but I wanna set the sample size to find min/max is 1000, I am not sure how to time and buffer that enormous (49000samples will be waiting plus another 50000 samples would start stacking up per second) data.
So primary question is how to stream the data to create desired number of sample set, manage the buffer and synchronize the acquired data. I am attaching my data acq vi with this post.
any ideas on how to approach this problem?
02-26-2010 12:18 PM
Hi,
In your DAQ loop, you can put the data in a queue (let's called it a process queue, PQue). Then, you can create another loop (Loop Q) that process the PQue. Loop Q would get the queue status from the PQue and see how many elements are on there. If the number of elements have exceeded the number of elements you want to use for calculating min/max, dequeue rapidly in the Loop Q for the number of elements you want and find your min/max.
Yik
03-01-2010 02:36 PM
Yik,
Thanks for the reply. I tried as you suggested but encountered a problem. when I enque the acquired data at say 50kSamples/s, the que gets 50000 samples at a time. Say if I am looking for the size of 5000 samples my case selector would be "Number of element in que = 5000". But the condition never turns true as at any instance the "number of element in que > 5000". So my que would not deque exact number of samples I want.
any other ideas?
-Nilesh
03-01-2010 04:16 PM
03-01-2010 05:16 PM
For your read operation, you can change the number of sample per channel to be the number of points that you need in order to calculate the min/max. Then, you know that you need to do a min/max for each queue element, which is a 2d array. Is that what you are getting at?
Yik