LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Storing data in a dynamic array and writing to the disk

Solved!
Go to solution

Hello,

 

I need to write the measurement outputs to the disk with a high sample rate. The current implementation (please see the figure below) appends the data to a file at every iteration but due to the latency of the HDD, the sample rate is too low. I think I need to store the data in an array and the then write it to the disk every "n" iterations to speed up the sampling rate. I'd appreciate it if you could tell me how to implement it or if you have a better solution for the problem, I'd be glad to know.

 

continuos_write.png

 

Thanks in advance

0 Kudos
Message 1 of 2
(1,990 Views)
Solution
Accepted by topic author Ryan-mo

You are also flat out using the wrong function for "high speed" logging as that VI constantly opens and closes the file (a VERY slow operation).  Look in the File I/O palette.  If you are logging to an ASCII file, what I recommend is to Open/Create the file before the loop.  Then use Build Array to put all of your measurements into an array and Array To Spreadsheet String to convert into a delimited value string.  You then use Write To Text File to write that string to the file.  When the loop is done, close the file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 2
(1,974 Views)