Example Code

Delete single TDMS Channel from an existing TDMS File

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

The example demonstrates how to delete a channel from a TDMS file.

 

Description

Since there is no possibility to directly delete a channel from a TDMS file with LabVIEW. This example therefore converts the TDMS file to a TDM file and performs the changes and converts the TDM file back to a TDMS file.

 

Requirements

 Software

  • LabVIEW 2012 Base Development System (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Open the attached file
  2. Select the path of the TDMS file (an example file can be found in the same directory as the VI)
  3. Specify the channel and group name
  4. Run the VI
  5. (if no error occurred) Close the TDMS File Viewer to finish the execution of the VI

 

Additional Information or References

Delete channel from TDMS file - Front Panel.png

 

Delete channel from TDMS file - Block Diagram.png

 

Can I Delete Channels or Properties from a TDMS File with LabVIEW?

http://digital.ni.com/public.nsf/allkb/9563ADB08D2CFCA18625753F0059E476?OpenDocument

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
EFRANZ5
Member
Member
on

The VI increased the amount of properties of the channel group.

There should be a way to just delete a TDMS channel without affecting the properties of the channel group.

Joe_Guo
Active Participant
Active Participant
on

the example creates extra properties, i.e. register 0, etc.  and it screw up files that have non-NI properties in the channels.  we have special properties in the channels to help convert data from raw to EU, after using this vi to delete a channel we were no longer able to display the data properly.  Good idea but it is properly better to write your own.