Loading Only Metadata When Opening a TDMS File

Updated Nov 12, 2018

Reported In

Software

  • Measurement Studio
  • LabVIEW

Programming Language

  • C++
  • C# .NET

Issue Details

I’m developing an interface application in C# to pull data from test files which are written in TDMS format. I have tried using both the diadem derived library (“TDM C DLL” pack using nilibddc.dll) and the measurement studio .NET plug in system which calls the NationalInstruments.Tdms.dll assembly. When opening a file, both methods only allow specification of the tdms rather than the much smaller tdms_index file. Is there a way to open only the index file?

Solution

There is no API to open the .tdms_index file only. However, when opening the TDMS file, no actual data is loaded. Instead, the metadata from the index file is loaded into memory, as well as a pointer to the data so that they can be accessed later. 

The memory is not taken up with data but with how the computer allocates the memory for each piece of metadata information. To disable set the "disable buffering" to false in your cs code, you will have add false to the line
TdmsFileOptions options = new TdmsFileOptions(fformat, TdmsFileAccess.Read); 
so it is: 
TdmsFileOptions options = new TdmsFileOptions(fformat, TdmsFileAccess.Read, false); 

Additional Information

In LabVIEW, you can achieve this by wiring a false constant to the disable buffering input of the TDMS Open function.

If you are using C DLL code, use the TDMS_OpenFileEx function where you can pass the TDMS_OpenFileDisableBuffering parameter which would be the equivalent property. 

WAS THIS ARTICLE HELPFUL?

Not Helpful