Example Code

Acquire Number of Channels in TDMS Group using LabVIEW

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

This example VI returns the number of channels in a group from a TDMS file reference.

 
Description
Currently in the TDM Streaming API in LabVIEW, there is no function that simply returns the number of Channels in a specified Group.  Using the following SubVI will accomplish this without cluttering your code with Listing the Contents of the TDMS File and then using the Array Size function.

Note that the TDMS file reference must already be opened before using this function, and should then be closed afterward. 


Requirements

  • LabVIEW Base Development System 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download VI "Get Number of Channels 2012 NIVerified.vi"
  2. Use the VI as a SubVI, place it on the block diagram and pass the file reference and group name string.

 

Additional Information or References
VI Block Diagram

block.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Ryan C.
Applications Engineer
National Instruments

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