07-30-2024 02:39 PM
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
07-31-2024 12:44 AM
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???
07-31-2024 10:23 AM - edited 07-31-2024 10:23 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord