12-28-2010 04:23 AM
Hello,
I have a PCI 6132 and i'm trying record continuos datas.
I'm using the example Cont Act&Graph Voltage - Write data to file(TDMS).vi, and without make any modification, a error -200279 occurs.
I need acquire this datas with at least 1MS/s continuously (rate), and record it about thirty minutes.
I've tried many configurations, for example, I put a rate: 1,2M and Samples to read: -1. And after a time, occurs the same error.
How I can record this acquisition with at least 1000000 S/s continuously using TDMS files?
Thanks,
Marcela
12-28-2010 05:39 AM
Hi Marcela,
error -200279 says: you read the samples too slow and so the buffer overwrites old values.
Hence you have to increase the DAQRead speed. Your best options are:
- read bigger blocks of samples per read access
- separate DAQ routine from TDMS save routine by using the consumer producer scheme
12-28-2010 07:02 AM
Hi,
I've tried read bigger blocks, but the same error occurs.
How I can use consumer producer scheme? I don't know this...
Thanks,
Marcela
12-28-2010 07:06 AM - edited 12-28-2010 07:06 AM
12-28-2010 07:50 AM
There are also several articles in the NI KnowledgeBase on the producer-consumer architecture:
including one that shows reading from a device and writing to TDMS at different rates.
12-28-2010 10:02 PM - edited 12-28-2010 10:05 PM
Actually, instead of using producer-consumer, I would recommend that you try using the built-in TDMS streaming in DAQmx. The example that you referenced does not use this feature.
If you have DAQmx 9.0 or higher installed, you should have some TDMS Steaming - ... Examples listed.
As an aside, please note that producer-consumer for DAQmx is roughly the equivalent of increasing the DAQmx buffer size. That is, there is already a producer-consumer in the DAQmx driver. If you increase the DAQmx internal buffer, that has a very similar effect to adding a queue. Furthermore, such an effort with increasing the buffer size or adding a queue does nothing more than delay the inevitable if your system cannot sustain the rates. It will help by reducing the impact of jitter, but ultimately if your hard drive can't keep up, your acquisition will fail eventually.
Finally, never read for -1 as the performance will not be ideal.
12-30-2010 04:49 AM
Hi,
sorry, but I could´t see the difference between the example that I used (Cont Acq&Graph Voltage - Write Data to File (TDMS)) and the example that used TDMS streamig. The same problems occurred.
I don't know how I can solve this problem (error -200279).
I will learn about producer-consumer.
I've tried increasing the DAQmx buffer size. To do this, I change same proprietys. I configurated the rate with 1.2MS/s, the samples to read with -1 (some times with 100k, or 1.2M too), and the sample per channel with 20M (some times with 1.2M, 1M). The proprietys rate and sample per channel were configurated in DAQmx Timing (Sample Clock).vi, and the propriety samples to read was configurated DAQmx Read (Analog 1D Wfm Nchan Nsamp).vi.
Is this configuration right? If not, how I can increase the DAQmx buffer size with at least 1MS/s (rate) and record this for a long time?
Thanks.
12-30-2010 12:56 PM
If the Log Only example still yields the error even after increasing the buffer size, your hard drive (or something about your system) cannot sustain this rate. Log Only will be the fastest way possible to stream to disk; if it can't do it, I don't think anything can.
01-06-2011 07:50 AM
Hello,
thanks for the solution. It's working now. I'm using TDMS Streaming - Cont Log Data Only.
But, now, I have one more problem. I need record using a conditional. Trigger. I need record this files when my level voltage is above 1 V and is below -1V. I used the DAQmx Start Trigger.vi with the propriety Start Analog Window. It's working, because the program build the file, but just begins record when the trigger happens.
I need record about 1 hour continuously after the trigger happens, independent of triggering occures within thin one hour, and stop the program when this time end. To do this, I think I need know when the trigger happens to start this timer.
I don't know how I can do this. I've tried read the proprietys to know this, but I din't have success.
Can you help me?
How I can limit the recording time after the trigger (window) happen?
Thanks,
Marcela
01-06-2011 05:39 PM
The best way to do this would be to configure the task for finite instead of continuous. I'd recommend that you set the buffer size to the same value as what is being used for the continuous acquisition; you can find this by using the "Buffer Property Node" (you should be able to search the palette for "buffer"). In this case, I would still recommend that you keep the loop where you query "Is Task Done".
There are other ways to do this, but this would be the easiest and most precise. The other ways would be to check every now and then for the "Current Read Position" in the DAQmx Read Property Node or "Total Samples Acquired". Alternatively, you could register for the "Every N Samples Acquired" Event.