02-17-2014 01:53 PM
I've created an application that needs to write 28 channels of data at 50kHz to a tdms file. I"ve been told that it's a good idea to keep the size of the files to under ~500MB to improve data integrety as well as making it easier to read the files into MATLAB.
Is there a simple method of segmenting the data into 500MB size files as I am streaming it? It would be best if the data were continuous (not interupted and restarted) when the files change.
I'd like the files to be named something like
Run001A.tdms
Run001B.tdms
Run001C.tdms
etc.
Thanks, Dave
02-17-2014 02:27 PM
The way that I do this is to have a loop for the measurement data go from card acquisition into a queue, and then another loop for the measurement data to go from the queue to the TDMS reference. This way, you can close your TDMS reference based on some metric, such as file size or number of hours, and then open a new TDMS reference with a new file name. I use filenames based on the current time/date, which makes data management easier. While the first TDMS file is being closed and the second TDMS file is being opened, your queue will be accumulating data, so just make sure that your queue is big enough to hold the data during that time period. Having a queue is also generally a good idea to avoid losing data during continuous data writing. Be sure that the queue-reading loop occurs faster than the queue-writing loop during regular operation.