10-12-2009 08:50 PM
In the data acquisition, I use one loop to poll data from hardware, another loop to receive the data from polling loop sent by queue.
But everytime the size of the transferred data array may not be the same, so the system may assign different array size and recycle very frequently.
Will it cost memory leak. Or will it slow down the performance, since the array size is not fixed, so every time need to create a new sized array.
Any suggestion or better method.
Solved! Go to Solution.
10-13-2009 02:13 AM
As i understand your description, your DAQ-loop acquires data with the setting '-1' for samples to read at the DAQmx read function. This results in the different array sizes.
Passing those arrays directly to a queue is valid and it does not have significant drawback in performance (at least as far as i know) and it definetly does not leak memory.
So the question is more or less:
Is it valid that your consumer receives different array sizes for analysis? How does your consumer handle those arrays?
hope this helps,
Norbert
10-14-2009 03:33 AM