07-11-2012 09:30 AM
So I'm pretty new to LabVIEW but I am attempting to create a continuous data aquistion VI that will record data average it to display and record a data point once every second.
The problem is that no matter what I change I cannot avoid getting a
Error -200279 occurred at DAQmx Read (Analog 1D Wfm NChan NSamp).vi
Possible reason(s):
Measurements: Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.
Odd thing is that on some occasions, the VI can run for over a day and not return any error and sometimes the VI will only run for 8 hours and then stop due to the 200279 error. This is incredibly frustraiting. I'll attach my code; if anyone would want to look at it I'd be forever in your debt.
07-11-2012 10:14 AM
Just some thoughts.
1. You do not need the seperate VI to configure the output buffer. When you setup the timing, the Samples per Channel determines the buffer size when using Continuous Acquisition. Set the Samples per Channel to the 30000. Maybe the extra VI's effort is ignored for some reason and the buffer is really only 1000 samples (1 second's worth)?
2. No need to use the property node to see how many samples are available. Set the number of samples to read to -1 and it will read all of the available points. Per the DAQmx Read VI help "If the task acquires samples continuously and you set this input to -1, this VI reads all the samples currently available in the buffer."
3. If you want to grab data once every second, simply hard code the 1000 into the wait.
4. Think about offloading the file write to another loop using a queue. Look into the Producer-Consumer architecture for more details. If the file write is taking a very long time, this could cause issues. But 1 second is a long time, so this is likely not your problem.