LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need assistance with merging of TDMS Files

Hello,

 

I was reviewing this example code Programmatically merge all TDMS files contained in a folder using LabVIEW - NI Community from here. I wanted to test how it worked to come up with a solution that would meet my requirements. However, after the merging completion using this Vi example, my TDMS log files are setup accurately, however, on the second tab of my tdms sheet there's no visible data, the file sizes had increased also. I am just curious if this Vi example converts TDMS files into some form of binary?

 

I have uploaded the document as an excel spreadsheet as an example of what the Vi is translating my TMDS files as. I am relatively new to Labview but have a general understanding of Vi programming, I had revised the Vi within that link to TDMS files, where the files did merge correctly, but only a single line of data had transferred rather than the hundreds of thousands of lines of data that was collected. Just looking for some general guidance with TDMS file merging I suppose.

 

-Brandon

0 Kudos
Message 1 of 3
(248 Views)

Hi XZ,

 


@XZBrandonYZ wrote:

However, after the merging completion using this Vi example, my TDMS log files are setup accurately, however, on the second tab of my tdms sheet there's no visible data, the file sizes had increased also. I am just curious if this Vi example converts TDMS files into some form of binary?


That example simply appends the file contents of all files to a large string and then saves that string into a new file. (This could crash very fast when trying to "merge" large TDMS files because "out of memory"…)

 

There is no conversion involved, it simply appends the file content.

 

TDMS files don't have "tabs", they have groups and channels (and properties). Only the Excel-Import-Plugin creates those tabs and so is irrelevant to your problem…

 


@XZBrandonYZ wrote:

I wanted to test how it worked to come up with a solution that would meet my requirements.


You don't specify your requirements: what do you want to achieve???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(210 Views)

TDMS files can be appended to like a text file and have it be valid.  I made a TDMS toolkit here over on VIPM.IO.  If you are new to LabVIEW learning about VIPM and packages might be a bit advanced.  But there is a Merge TDMS function there. It works in a similar way to what you linked to but has more options like appending to an existing file, or creating a new one. It also handles it in chunks to hopefully no memory issues, and can know what to do with the index files.

 

Oh maybe that is your issue. After your merge delete the index file then reopen the TDMS file. It is recreated on open if the file doesn't exist in most situations.  My merge should handle this automatically and merge index files if they exist, and delete the index file if one is missing forcing it to recreate it.

0 Kudos
Message 3 of 3
(147 Views)