LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to increase rate at which data is written to file?

I have a program that reads data at 200kHz and I would like the program to write the data at the same rate. However, the fastest I seem to be able to get my program to write is about 5kHz. I have been using the DAQmx Read and the Format into File functions to read and write the data.
I have tried moving the write function into a separate loop, so that the data would write to a file after the data collection was complete. However, this did not change the rate at which data was written to a file. Any suggestions for increasing the rate at which data is being to a file? Thanks for looking over my problem!
0 Kudos
Message 1 of 6
(3,481 Views)
Instead of writing one value at a time, save up 100 in an array or long string and write the whole block at a time.

Les Hammer
0 Kudos
Message 2 of 6
(3,481 Views)
Well, writing to a file is always slower since it takes some time to access the hard drive. I noticed in your program that you are writing into an ASCII file. That is also slower than if you write to a binary file. There are several examples that ship with LabVIEW that allow you to do High-Speed Datalogging (I actually believe that is the name of the examples). Those examples actually come in pairs, one does the datalogging, and another helps you read the file. I will recommend taking a look at them.
The previous suggestions by Les Hammer is a great idea. Instead of acquiring 1-sample at a time, try acquiring 100 or 1000 samples and write them to the file.
I hope that helps!

GValdes
0 Kudos
Message 3 of 6
(3,481 Views)
Thanks - your suggestions have been very helpful!!
0 Kudos
Message 4 of 6
(3,481 Views)

I am trying to collect in-cylinder pressure data using the program i have. this program is only collecting 130 data/sec in excel file.

Now how do i ncrease this rate as i want to collect 3000data/sec in excel file.

 

Any help would be highly appreciated.

 

Amit 

0 Kudos
Message 5 of 6
(3,121 Views)
But you will only be able to record just over one minute of data using Excel at that sample rate before you hit the 65K line limit, I would look at using something other than Excel - Mike
Message 6 of 6
(3,092 Views)