LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Process data in a circular buffer file

Hello, I've created a 5 min circular buffer, which writes to a binary file whose format is simply a 2D array of DBLs. When a fault occurs, I'd like to restructure the post-mortem data so that if the buffer has circled over, the data between the current file position marker and EOF is placed at the beginning of the file, before the data that was last written. Please see attached art piece.
 
I'm trying to do it without reading in the data because the files are usually large (if they were logged at 1000 Hz, the file is greater than 80MB). I was wondering if there was a way to do it by copying to another file, perhaps playing around with the EOF markers. Is there a way to "merge" two files without necessarily reading and writing?
 
Thanks,
Sima
0 Kudos
Message 1 of 3
(3,024 Views)

I can't think of any way to move data around in a file like that without explicitly rewriting it. The only thing I can think of is to write a specially formatted header to the file when a fault occurs that can tell the data reader where to start in the data. This could create the same operation without actually moving the data.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 3
(3,008 Views)
What about keeping the data in memory instead? 80MB's is peanuts. You write your data to the file only once the fault has occurred. Save yourself the read time.
0 Kudos
Message 3 of 3
(3,005 Views)