LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting a group in a TDMS file increases the size of the file

Solved!
Go to solution

Hello Everyone,

 

I have been searching information about how to delete a group in a TDMS file. Apparently this is not a simple task as I thought  since first it is necessary to convert the TDMS file into a TDM file, delete the group in the TDM file  and finally convert the TDM file into a TDMS file. There is a really nice example project here (I attached it in the post anyway!).

 

This project works nicely. Indeed I am able to delete the group of the TDMS file. Nevertheless I have realized that performing the deletion process increases the size of the file (approx. 4 times). If you visualize the TDMS file with the TDMS - File Viewer.vi you realize that several strange properties were added to each channel of all remaining groups. I supposed this is partially  the cause of the size increment. 

 

Does anyone know why this is happening?

 

I am using LabVIEW 2014 and I downloaded the project for LabVIEW 2014.

 

 

Any help is higlhy appreciated.

 

Best Regards,

 

Diego Ballen

Download All
0 Kudos
Message 1 of 7
(4,685 Views)

I think it came out with LabVIEW 2015, but there is now a TDMS Delete Data Function.  This might do what you want.  You also might want to try to perform a TMDS Defrag on your file to see if that shrinks it down some.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(4,679 Views)

 

 

 

 

0 Kudos
Message 3 of 7
(4,647 Views)
Solution
Accepted by topic author DiegoBallen
The old way of doing it was to read out each group you want to save and write it to a new file. The basic problem is that the TDMS format was optimized for speed, and not memory efficiency, which can cause a lot of complications when doing seemingly simple stuff - like deleting data, or reading data out of the file.

This is why NI came up with these new functions. If you're stuck with an older version you can still write your own function to do the same thing.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 4 of 7
(4,640 Views)

You could try an approach similar to the one I'm taking in a LV2013 project:

 

-Open the original tdms and read the data

-Said data becomes an array (string, double, boolean, etc.)

-Manipulate the data in whatever way you want (delete channel, data, etc.)

-Replace the original tdms with a blank one (create or replace)

-Write the manipulated data to the new blank tdms

Message 5 of 7
(4,637 Views)

Thank you mikeporter and Daikataro!

 

I will take this approach and will generete simply a new file only with the data Im interseted in.

 

 

Greetings and thanks again!

 

Diego Ballen

0 Kudos
Message 6 of 7
(4,629 Views)
The files will get smaller and accessing the data in them will be faster because each group is not fragmented through out the file.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 7
(4,621 Views)