05-17-2013 01:52 PM
Attempting to use NI_MinimumBufferSize but it is not behaving the way I expect. The attached VI will never stop iterating. I would expect it to stop iterating immediately, because setting NI_MinimumBufferSize to 1 should cause the tdms file to grow with every write, shouldn't it?
Also, does TDMS have automatic compression built into it? Seems like the filesizes being created for simple tests like this are much smaller than I would expect.
Solved! Go to Solution.
05-19-2013 10:46 PM
NI_MinimumBufferSize is not designed for when to flush data into disk, it is for optimizing the writing performance. If you want to flush the data into disk for every writing operation, you can call the 'TDMS Flush" explicitly that is what it is designed for. If you have some reasons to avoid using this node, you can use the 'NI_DiskCacheSize' property. It works as you expect with your attached VI.
Thanks,
zaizhou.ma
05-20-2013 12:29 PM
I'm trying to get TDMS to write to the file automatically after every call to TDMS Write without calling flush, but don't know how to make it do that. This serves the purpose of reducing memory use and guarenteeing no data loss (for extremely low sampling rates), without inserting a blocking call to Flush. Help on DiskCacheSize is also lacking. Is this bytes, elements, per file, per channel? Is there an optimal number? Does it depend on the datatype?
05-20-2013 08:19 PM
NI_DiskCacheSize works on file. In your case, you don't intend TDMS to do any caching, thus you can set it to 0. Please see the attached file.
05-21-2013 09:03 AM
05-21-2013 09:12 PM
NI_MinimumBufferSize
This property works on channel and the unit is "sample", TDMS will try to write the data only when the number of samples of the specified channel reaches the number you set.
NI_DiskCacheSize
This property works on file and the unit is "byte", TDMS has an internal cache beyond the OS cache, by default, it is 2MB. You can use this property to alter the size of the TDMS cache.
05-22-2013 10:20 AM
05-23-2013 03:59 PM
Hi Nate_Moehring,
NI_MinimumBufferSize is meant to improve performance by writing to a file less often, not meant to force a write. Essentially, NI_MinimumBufferSize is only a minimum, not a limit. If the minimum is less than the NI_DiskCacheSize (or the default cache settings if this property isn't used) then the buffer will still keep filling past the minimum until it reaches that buffer level.
What the NI_MinimumBufferSize if meant for is if you set NI_MinimumBufferSize to a setting greater than the default buffer size, your TDMS Write will wait beyond the default buffer size until the minimum buffer size has been met.
I hope this helps!