From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rename Group in TDMS File

Or maybe you could do the rename in two processes. For example, first rename group 5 to group 10005, then rename 10005  to 209, and at last use TDMS defragement to get a clean file.
0 Kudos
Message 11 of 16
(1,234 Views)

Since group names are used to address your data in TDMS, they are supposed to be unique. The APIs in LabVIEW and other NI apps enforce that.

 

I take it that, if group 209 exists and you rename another group to 209, you do NOT want to merge the contents of the groups. If that's what you want to do, you would need to set NI_UpdateGroupName on all channels in the group that you're renaming. That would move these channels into the existing group 209.

 

If you instead want to replace group 209 with a group that initially has a different name, you would have to temporarily rename it somehow. For example, your acquisition application could write all group names with a prefix or suffix (e.g. _209), so you don't end up with duplicates when you set it to 209. Or maybe you can come up with a way of sorting the group names so that they are renamed in an order that avoids duplicates.

 

Herbert 

0 Kudos
Message 12 of 16
(1,219 Views)

Hi Herbert,

 

First let me start by again thanking you for the responcibilty you have taken for TDMS. This behaviour by a vendor always rates very high in my bokk (You can quote me to your suppervisor if you would like).

 

The requests mentioned in this thread for the ability to manage (delete, rename, replace) the data inside the TDMS file is badly needed and I would like to urge you to concider these enhancements in future releases of TDMS.

 

Thank you!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 13 of 16
(1,215 Views)

Sorry to "revive" this thread. 

 

I have recently ran into a hurdle trying to accomplish what was mentioned earlier in this thread.

 

I am trying to replace "old, bad" data with new data. This data is in a TDMS group. I am currently using LV 2009. Is there now an implemented function? (That is a VI or function that will allow someone to perform this without having to extract all the information of the old file, filter out the bad info, write in the new info, and finally write a new TDMS file.)

 

I'd appreciate any help with this.

 

Thanks.

0 Kudos
Message 14 of 16
(918 Views)

Hi Rocko2k7,

 

I looked at all of the TDMS functions in LabVIEW 2010 SP1.  It does not seem like there is not a single function to accomplish this task.  However, it does seem like there are functions available to accomplish this task.  Look at the function "TDMS Set Next Write Position"

 

It will take some experimenting to get it to do exactly what you want.  But it does seem possible to overwrite the data now.

 

 

Regards,

Che T.
Applications Engineer
National Instruments
0 Kudos
Message 15 of 16
(903 Views)

Thank you for your response Che T.

 

Sadly, in the lab I work in, we only have LV 2009. The work around I have found so far to accomplishing the task of over writing data is  to convert the TDMS file to a TDM, delete the group from the TDM file, convert the TDM back to a TDMS, and finally append the new data to the modified TDMS file. I am still looking into the TDMS to TDM VI just to make sure that it won't corrupt any of the data in the TDMS file. The TDMS files this is supposed to work with might containg about 500 MB of information, so I am still looking for a better way for overwriting data that has a lower risk of corrupting my data.

 

Any other ideas are greatly appreciated.

 

0 Kudos
Message 16 of 16
(893 Views)