02-18-2009 04:44 PM
I have an application where the .tdms file will grow very quickly, because of the amount of data being stored - 7 channels of DAQ at 50,000 samples a sec.
I wish to determine when the file has reached around 2GB and want to close the .tdms file and create a new one with a different name/timestamp. I want to break these files up due to portability issues.
Question is, how do I determine .tdms file size? When I try to give the "get file size" subvi the path to the .tdms file, an GPIB controller needs to be in charge error occurs. Also, the refnum of the tdms file is not the same as file refnums, so the "get file pointer" subvi will not accept the tdms refnums.
I probably could somehow calculate what is going into the tdms file, but that seems like a workaround and will not be accurate because of the header information.
Solved! Go to Solution.
02-18-2009 05:59 PM
Try doing the size check from the subVI that is writing the data.
Mike...
02-18-2009 10:22 PM
You can't get the size directly from the file refnum, but you can probably still get the size another way. Use the function File/Directory Info from the Advanced File I/O palette. This takes a path as an input, not a refnum. This should give a semi-accurate file size value, although it will be possible that there is some cached data that hasn't been flushed to the file yet. Still, when you're talking about file sizes in the range of 2GB, this should be close.
This is pretty much the same thing as watching in Windows Explorer as the TDMS file size gets bigger while it's written.
02-18-2009 11:21 PM
When I have a TDMS file that is only build of direct DAQmx data I use the 'Samples Acquired Per Channel' and 'Number of Channels' properties to calculate the total number of channels, by multiplying this with 8 (byte size for Doubles) you get the file size (missing a few bytes).
Ton