10-11-2007 11:37 AM
10-12-2007 06:15 AM
Hi soundofwind,
At the moment you are acquiring data at 5000 samples per second and you are writing to a buffer ( allocated memory ) of a 1000 samples. This means that the LabVIEW program
has 0.2 seconds to read all the data before it is overwritten by the new samples. If you further reduce the buffer size ( 1000 samples), then the LabVIEW program doesn't
have enough time to read all the data on time and therefore you get the message that ' that the required data was unable to be captured because of overwriting of the buffer'.
Don't forget that on Windows OS, the CPU will interrupt the data transfer to perform other operations, e.g. check whether you connected anything to the USB ports.
You can avoid this problem by either increasing the buffer size, reducing the sampling rate or by using the DMA ( Direct Memory Access) method to transfer data from the the DAQ to the computer.
http://zone.ni.com/devzone/cda/tut/p/id/1087
Note that DMA is not supported on all our hardware devices.
With regard to recording the data in a lower rate than you are acquiring , there is a solution. I've attached a sample VI that samples at 5KHz and writes 1000 samples to the buffer but
only updates the text file once every one second (1 Hz).
I hope that helps,
KostasB
Applications Engineer
National Instruments UK& IE
10-13-2007 08:23 AM
10-15-2007 01:23 PM
Hi, KostasB. I have some problems again. The sample vi you made works, but it can only record one channel in the DAQ assistant.The DAQ assistant I've got has 32 channels, all in use. How can I keep a record of all of them instead of one only. Besides, the records kept were only digits, no format as the one kept with Write to file.vi. The latter has a very good format, telling you the data recording time, the time gap between each recording, the name of each channel and other information. How can I achieve that? Thanks a lot.
10-17-2007 06:37 AM