Coder Social home page Coder Social logo

converttdms's Introduction

ConvertTDMS

Repo of submissions to MATLAB File Exchange (http://www.mathworks.com/matlabcentral/fileexchange/44206-converttdms--v10-)

Import or convert a LabView TDMS file (version 1.0 through 2.0). Interleaved and Non-Interleaved tdms files are supported.

These functions also work with tdms files that contain channels using the DAQmxRaw data type (raw ADC data written by LV), if the files are translated first using the information found at: https://decibel.ni.com/content/docs/DOC-32817

Files

ConvertTDMS - Function to load LabView TDMS data file(s) into variables in the MATLAB workspace. An *.MAT file can also be created.

simpleConvertTDMS - Function to convert .tdms files to .mat files. the .mat files can then be easily loaded into MATLAB when needed.

Test Files

The exampleFiles directory contains some simple files to test and troubleshoot with. Please update the testFileInventoryList.txt to describe your file and any issues with it. (Note that GitHub limits file uploads to 100MB).

TDMS Best Practices

Most issues with converting TDMS files comes from how the were orginally written. This is much more true with older (v1.0) files which wrote a meta data header each time the write vi was executed in LabView. With that said, please note the following about LV programming best practices:

  1. We have used these functions to translate files up to 3GB. In general it's not a good practice to write TDMS files over a ~1GB. Typically in Labview, we code for a new tdms file to be "auto-started" every ~500MB. This has saved me several times when a file becomes corrupted (by file handling or LV itself) and we don't loose the whole large data set.

  2. When writing data in LV, use a que/FIFO to build up numerous samples of data and then write the data. Don't use the TDMS write VI at every sample.

Working with Files Containg a Large Number of Channels

What to do if you have a large file with a lot of channels and you don't want to read in all of the chhanels into MATLAB:

  1. Convert the .tdms file to a .mat file using simpleConvertTDMS.
  2. If you want to work with just a particular channel, use the "load" command to only load the channel from the .mat file: load('FileName.mat','NameOfYourChannel');
  3. You can then access the data using: yourData=NameOfYourChannel.Data;

If you need a way to see what channels are in the file without loading whole file, use the "whos" function.

History

It was written in MATLAB 2010b. The original function was based on the work by Brad Humphreys of ZIN Technologies and Grant Lohsen & Jeff Sitterle of GTRI (versions 1 through 4 of this function). The Version 9 function (written by Philip Top), in addition to incorporating the various updates that were added to previous versions, can process files that have been "optimized" by LabView. Robert Seltzer of Borg Warner has provided a great deal of support and input. This version is the first using FileEx's new GitHub interface (thanks Mathworks!).

This function has been tested with a limited number of diverse TDMS files.

converttdms's People

Contributors

humphreysb avatar haench avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.