02-26-2009 03:59 AM
Hi,
I have a file of 10MB want to write in to file continuously overwriting the oldest data, my file size should be maintained 10MB and program may run for quite long time. since i am new to labview used file operations, shiftregisters and little queues but i am not getting any satisfactory results, hopping my problem is simple and someone could help me on this.
Thanks,
ranjan.
02-26-2009 06:16 AM
Well, we earlier solved it for the 20MB case, so the 10MB case should be trivial to solve. 🙂
What is the structure of the file, are all records of equal lenght?
Yes, most likely the solution is simple! Maybe you can show us your code that produces unsatisfactory results and tell us what kind of results would be satisfactory. 😮
02-27-2009 04:03 AM
Hi,
Please find the VI in the attachment. I am trying to get contentious data in the file when save is selected instead of array in between.
Thanks,
ranjan
02-27-2009 01:06 PM
None of this makes a lot of sense. Why are you building your data in a queue? Why are you using a 2D array of strings for numerics? Why is your format specifier an empty string? Why are you getting the queue via a value refnum? Your terminal for the 2D array is outside the loop, so you're writing the same data over and over. Seems redundant.
Since your records are freely formatted, each will have a different lenght, so it will be difficult to overwite the oldest data, because each write will have a different size. In addition, it seems difficult to tell where the the old data starts and the new data ends.
I would recommend a binary file format with defined (and fixed) record lenght, possibly including a record number to keep track of things. Now you can just calculate the insert point and roll it back to zero once 1MB has been written.