09-11-2011 05:27 PM
09-12-2011 02:05 AM
Hello,
First question: does the array in the queue element have a fixe size or can your program put array of different sizes into two different element of the same queue?
As far as I know, the memory is not allocated when you set the max queue size, but only when you fill up the queue and I assume that is because LabVIEW has no way to guess the amount of memory it will need for each queue element (specially if the element contains an array).
What I think you could do (wathever is the answer to my first question) is set a limit in terms of total array size contained in the queue and not in terms of max queue number of element. Every time the acquisition routine adds # elements to the queue update a "queue size" variable and same when the save routine extracts data from the queue.
and whatever the user sets in terms of points to acquire you have a max size that you can't go over.
Hope this helps
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
09-12-2011 06:22 AM
when creating the queue using "obtain queue" you may set the maximum number of elements.
how do you want to achieve to not loose data as your aquisition loop probably tries to produces events for the saving queue? Do you have the possibility to wait in the experiment?
09-12-2011 09:15 AM
@Questionmarker wrote:
when creating the queue using "obtain queue" you may set the maximum number of elements.
how do you want to achieve to not loose data as your aquisition loop probably tries to produces events for the saving queue? Do you have the possibility to wait in the experiment?
They could use a lossy queue which would simply push the older data out of the queue. Even prior to native lossy queues you could achieve this behavior with a bit of extra code when you enqueue the data. NI just made it easier now.
Either way, as mentioned earlier the memory allocation is much more dynamic when your queue data contains arrays. It has to be since arrays are dynamically sized and memry allocation is handled by LabVIEW. Even if you preallocate an array you can grow it if you put more data in it. Without your code to control things there is no way to force the size of an array to a fixed size.
09-12-2011 09:48 AM
09-12-2011 10:03 AM
But this also slows your ability to capture the data. HOw are you saving the data to file? Are you passing the entire array to something like the save to spreadsheet VI? File operations on very large buffers are slow. You can speed this up thouhg by writing smaller chunks of data to the file at one time and using a loop to iterate over all of the data.
09-12-2011 10:14 AM
or buy a SSD The smaller ones are not too expensive and they are really fast.
The low budget solution is a RAID 0, almost doubling the speed.
09-12-2011 11:07 AM
09-12-2011 03:29 PM
Hey mcduff,
I haven't heard anyone mention data compression, were you aware you can compress data in daqmx? A discussion like this may help.
09-12-2011 04:11 PM
How offen are you writing to the file ?
You are talking about 3 mill. data points, 1 mill for each signal. Are you only save to file every 1 sec ?
Try to take fever point but say more offen, so you keep the same samplerate.
Besides a loop for saving to file and one for data collection, what is else runing ?
Is there some data process going on, or is there any loop with no wait in it ?
How are you collection the data, with DAQmx ?