02-19-2014 09:57 AM - edited 02-19-2014 09:57 AM
02-19-2014 10:01 AM
Jaseon,
I think you forgot to attach your VI. There is some documentation on the issue in this knowledgebase but the general issue is that you need to read samples faster than you currently are. If you post your VI we can look at it and make suggestions.
You might also consider using an example program (Help » Find Examples) in LabVIEW. There are good example programs there of continuous acquisition.
02-19-2014 10:02 AM
It is attached.
02-19-2014 10:21 AM
Basically what is happening is that the loop rate can't keep up with your acquisition rate. I'm guessing the program runs for a short duration and then will eventually throw the error. The problem is that you can't write samples to disk at the same rate that you are acquiring samples. This eventually overflows the buffer that DAQmx is writing samples to.
There are ways around this. You should look at implementing a producer / consumer architecture in your code such that you acquire data continuously in one loop and then feed that data into a queue and then in anther loop you pull data out of the queue and write it to disk.
There is an example of streaming to disk that you can also reference.
I think a large part of the issue is that you are writing to two separate files and this takes time.
02-19-2014 10:21 AM
Your problem is the writing to disk is slowing down your loop. Look into the Producer/Consumer. What this will do is put your DAQ and File I/O into two different loops. You use a queue to pass the DAQ data from the DAQ loop (producer) to the File I/O loop (consumer).
02-25-2014 09:06 PM
Thank you.
But the queue only works for 1-dimentional array. How could it works for n-dimentional array?
02-26-2014 08:10 AM
Your queue is whatever data type you wire into the Obtain Queue VI as the Element Data Type.
02-26-2014 08:55 AM
I used your method, but it did not work. The data I collected is not the input data.
My Vi is attached.
02-26-2014 09:07 AM - edited 02-26-2014 09:08 AM
You have 2D array going into your Obtain Queue, but it was the wrong data type, it was I32 instead of Double, I changed it, but you could do the same by clicking on the 2D array constand and selecting Representation and then selecting Double.
For some reason I can't attach the VI right now, but just make the change as I described and you should have a 2D array of Double values as your queue elements.
02-26-2014 09:57 AM
Thank you. Your method works good. But the sampling rate is fixed at 10Hz, while I set a 20kHz sampling rate in the DAQmx.
What's wrong with that?