LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data recording problems

Hi, guys, I am using DAQ assistant to acquire data at the moment. As required by the test, the frequency is set very high, 5000Hz, and it captures 1000 samples per hz. I tried to use the Write to File.vi to keep the recorded data, but as it is so frequently recorded, the files are really huge. I was wondering if there are some ways to keep the data acquiring frequency such as 5000Hz but record the data to a file in another frequency such as 1Hz? That would make the files compact and more readable.
 
Besides, if I set the frequency to 5000Hz, but the samples to less than 1000 per Hz, it always shows that the required data was unable to be captured becauser of overwriting or sth. Could you tell me why?
 
Thank you very much
0 Kudos
Message 1 of 5
(3,704 Views)

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

 

 

 

 

0 Kudos
Message 2 of 5
(3,665 Views)
Hi, Kostas, thank you so so so much!!
0 Kudos
Message 3 of 5
(3,645 Views)

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.

0 Kudos
Message 4 of 5
(3,628 Views)
Hi Soundofwind,

Please try the attached code modifications.

Regards
JamesC
NIUK and Ireland

0 Kudos
Message 5 of 5
(3,603 Views)