From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Convert TDMS File with DAQmx Raw data 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

Description

Overview

Very simple utility to read in a TDMS file and the write out data to a new TDMS file (which does not use the DAQmxRaw Data type). This will convert DAQmxRaw data which is problematic for reading with other tools.(http://www.mathworks.com/matlabcentral/fileexchange/44206-converttdms-v10).

 

Description

Open a TDMS file with DaqMxRaw data in it, write all of the data to a new file.  The DaqMxRaw datatype is used for high throughput data file writing.  Raw ADC Data is stored with scaling factors in the DAQmxRaw datatype.  The decoding information for this datatype is not provided by NI in the tdms documentation at: http://zone.ni.com/devzone/cda/tut/p/id/5696.  This VI demonstrates how a simple VI can be used to open a TDMS file which contains data in the DAQmxRaw data type and write it to another file (this operation converts the data in the file to the supported data types available to users in the TDMS documentation).

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Execute Code

  1. Run VI.
  2. Select File to be converted.
  3. Copy File name from above and change or append to name.
  4. Press OK to convert button.
  5. Close the VI window to stop the VI.

 

Additional Information or References VI Block Diagram

VI Snippet

 

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

**Updated to use an Event Structure instead of polling a control.

 

 

 

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

Comments
joe2017
Member
Member
on

Would it be possible for National Instruments to update their documentation for the special daqmx tdms format so it would be in the public domain like the normal tdms format?

likewise
Member
Member
on

I wonder what the conversion utility does. I have tried to convert a 1 GB file and got 1.3 kB out.

crossrulz
Knight of NI Knight of NI
Knight of NI
on

I just updated the VI to use an Event Structure instead of polling.

 

Due note that this is geared to TDMS files that were made with the DAQmx Logging.  Any additional groups will likely be removed.


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
leo_krupps
Member
Member
on

I tried to run this using an input file that was written from a DAQmx express vi with TDMS logging turned on. I get the error code 2: Memory is Full in the Write TDMS primitive. Any idea what is going on here? The file size is around 3-400Mb and the index file is 5Kb.

 

This is a simple 2 channel voltage capture task with continuously sampled analog input with sample rate of 100kHz and samples to be collected sitting at 10k. 

alphaNOVA
Member
Member
on

I can run the VI but it doesnt seem to write any file (i also activated highlighting, it seems to run fine, no errors and data is passed, but i dont get a file)

murse
Member
Member
on

Hi! I am getting the error code 2: Memory is Full in the Write TDMS. My TDMS files are really large. Is there any solution available ?

Best,

 

 

leenjabban
Member
Member
on

to get over the memory full issue you can modify this VI to loop through the data (by setting the offset and count in read TDMS) and exiting the while loop when the read TDMS "end of file?" is True. One thing I had to do is open and close the TDMS file being read in every loop over else I get errors*. I am assuming there is a more efficient way to do this but this is what worked for me. 

 

*note that this is only for the read TDMS not write TDMS too. 

Contributors