Read TDMS file in MATLAB on x64 Windows

I have read many posts on this forum regarding reading TDMS files in MATLAB, but the DLL available only works on 32-bit windows. Has anyone come up with a 64-bit DLL? I know there is some MATLAB code available to read the file as binary but it would make everything faster for me if there was already a DLL similar to the 32-bit version. Plus, using C code would be better since I want to read the file continously (perhaps every 2 seconds) in MATLAB for real-time analysis.

As of now, there is no support for 64 bit but it is a possible feature for future releases. Keep an eye on the DLL download page for new versions.
Sappster

Similar Messages

  • How to Read TDMS Files in Matlab in OSX

    Using the example found on the NI website (http://digital.ni.com/public.nsf/allkb/0EEADA99DC​7D00A4862572E30037C3A2), I am able to read my TDMS files into Matlab when using a PC.  However, when I try to read them on my Mac, I receive an error:
    ??? There was an error loading the library "/Applications/MATLAB75/work/TDMS_files/dev/bin/ni​libddc.so"
    Error using ==> loaddefinedlibrary
    dlopen(/Applications/MATLAB75/work/TDMS_files/dev/​bin/nilibddc.so, 1): image not found
    Error in ==> read_tdms at 21
    loadlibrary(DLL_Path, H_Path);
     My best guess for this error is the fact that Matlab operates through a Linux interface on Mac, which I found will open the file type .so and not .dll for this type of library.  Is there some way to get around this in OSX and get it to read the .dll files?  Or is there some way to get the libraries as .so files instead of .dll files?
    Thanks for any help!
    -Shelby

    Shelby,
    You may wish to look at a Matlab script another user wrote since they were having issues with NI's matlab support:
    http://forums.ni.com/ni/board/message?board.id=170​&view=by_date_ascending&message.id=318487#M318487
    The script supposedly converts TDMS files directly in Matlab with no use of NI generated external DLLs.  He was having issues because the NI tools hadn't been updated for the new version of Matlab.

  • Reading TDMS files in Matlab

    I am trying to read TDMS files directly into Matlab using the NI  nilibddc.dll. I have read most of the posts on here but still have a problem...
    Within Matlab I can open and read a file and get the data but I cant find anything that tells me what the sample interval (between samples) is for a particular file. I guess its in the header somewhere but how do I access it?
    I cant find anything that tells what function to use to get it from the header.
    In fact i cant find anyhting that tells me what the functions are in the DLL.
    I tried opening the CHM help file, this has a list of all the functions but when you click on one in the contents it reports 'the address is not valid'. It seems the link is borken somehow in the help file (this is on XP)!
    any help gratefully receieved!
    mike

    hi mike,
    if your data is stored in form of waveforms, this information can be retrieved from the channel:
    Entity
    Property
    Data type
    Description
    tdm_channel
    wf_xname
    string
    Name of the x-channel of the waveform
    tdm_channel
    wf_xunit_string
    string
    Unit text of the x-channel
    tdm_channel
    wf_start_time
    time
    Time stamp for the waveform
    tdm_channel
    wf_start_offset
    double
    Starting offset (to be added to the time stamp)
    tdm_channel
    wf_increment
    double
    Increment
    tdm_channel
    wf_samples
    long
    Number of samples in one shot (needed by LabVIEW when concatenating
    more consecutive shots). This property is used by DIAdem and DataFinder to decide whether the tdm_channel is a waveform (wf_samples > 0) or not (wf_samples = 0, or not existing).
    tdm_channel
    wf_time_pref
    string
    (enum: "absolute" or "relative") Additional information for LabVIEW to
    determine if the x-channel is treated as time (absolute) or as index
    (relative). (not available in LVM)

  • Reading TDMS files in Matlab - problems with the example code

    I want to use the TDMS files to store data and do offline analysis in Matlab, version 2009b (either on Mac OS10.6 or Windows XP).
    To test the data import in Matlab I tried the example from http://digital.ni.com/public.nsf/allkb/0EEADA99DC7D00A4862572E30037C3A2 , but without success.
    I tried either with and without the path definition (as explained on the page I referred to before) at the start, and got back the following errors:
    with:
    ??? Error using ==> loadlibrary>deltempfiles at 559
    nilibddc_m.i.
    Error in ==> loadlibrary at 452
        deltempfiles(delfiles);
    Error in ==> Read_TDMData at 7loadlibrary([examplePath '\nilibddc'], hfile);
    without: 
    ??? Error using ==> loadlibrary>deltempfiles at 559
    nilibddc_m.i.
    Error in ==> loadlibrary at 452
        deltempfiles(delfiles);
    Error in ==> Read_TDMData at 36loadlibrary(NI_TDM_DLL_Path,NI_TDM_H_Path); 
    I found a few messages on the issue, dating from 2006 and 2007, that didn't lead to a satisfying solution and was hoping that, by now, there would be a solution to my problem.
    Thanks a lot
    Remco   
    Solved!
    Go to Solution.

    Hi Musk,
    Thanks for your answer. 
    Unfortunately it didn't help as my problem is not discussed there. I have a problem with this line:
    loadlibrary(NI_TDM_DLL_Path,NI_TDM_H_Path);
    I said before that I was using 2009b, but I was mistaken, I have R2008a, but the 'loadlibrary' is opened in a 2008b editor (no idea why). On the Mac I have 2009b installed.
    Thanks
    Remco 

  • Does anyone know how to read in a TDMS file into Matlab?

    I am trying to read a TDMS file into Matlab. Are the two compatible? How can I import this file into matlab?

    A search can turn up wonderful things, such as:
    Reading TDM/TDMS Files with The MathWorks, Inc. MATLAB® Software

  • How to read binary file in Matlab

    "Hello all!
    Labview 7.0 has an example "Cont Acq to File (binary).vi" log the PCI 6014 card and writes the data to a binary file. How can I read that
    file in Matlab(6.5.0... R13)? Does anyone have a solution for this?

    Hello,
    Basically you can do it by saving the data in a file in MATLAB and reading it directly from LabVIEW, or vice versa. In MATLAB , the command "save" allows you to save the data in binary format (*.mat) or ASCII format. You also have an option of saving it in ASCII format using a tab delimiter between data points.
    There is a knowledge base which talks in detail about how to share data in between labview and matlab Import data from labview to Matlab and vice versa.
    Hope this helps. If not, please feel free to ask more questions.
    Good luck and have a great day!
    Koninika
    National Instruments

  • Import tdms file into matlab

    Hello,
    I would like to import tdms file (Labview version 2009) into Matlab (R2012a). I tried to follow a few solution given in this forum, however I couldn't find any that could help me.
    I hope anyone can give guidance on how to import these file.
    Many thanks
    Best regards
    Hafisoh

    fie wrote:
    Thanks to all for the advice.. 
    If you really want to thank them, give them kudos, and mark the answer to the question.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • How to import .tdms file to Matlab running in Unix system?

    I was using DAQmx to acquire 16 channels of sampled data to .tdms format and later on will need to import the data to a Matlab programme. My question is, the Matlab we have is installed in a Unix system. But the tdms to Matlab example given in NI website, as in the link below, has problem when i run it in Unix system.
    http://digital.ni.com/public.nsf/websearch/0EEADA9​9DC7D00A4862572E30037C3A2?opendocument&Submitted&&​...
    Errors occurred in the "loadlibrary" function. I was told that in Unix system, a different file instead of .dll file shall be used?
    Can anyone make an example to read tdms data,  that will work in a Matlab installed in Unix system?

    I have plenty of experience working in LabVIEW and with TDMS however very little in using it in other software. I have downloaded the example code on this end but since I don't have your software installed on my machine, there is not a ton I can do in walking you through it. However, I understand this is a very helpful newsgroup for that environment.
    Since you said you modified the header, to make sure everything is in line prior to entering other program, this is a good resource on the TDMS file structure.
    Logan H
    National Instruments
    Applications Engineer

  • Error reading TDMS file with inconsiste​nd dt

    Hello all,
    I would like to ask your help to understand how to read a TDMS file which I am opening and closing based on a user input.  As a result the data in the TDMS file does not have a consistent time step, which may be causing my problem, but I really don't know.  I keep getting the error 2501, that I have an invalid reference. 
    Or, if I continue and bypass the error, the extract portion VI gives me an error stating that I need to define an integer multiple of dt.
    I am not sure how to solve the first point as I have the reference wired directly to the read TDMS vi.
    I have attached a screen shot of the error and the portion of the VI with the offending error (it is the code connected to the read TDMS read vi).
    My goad is to extract a portion of the data to do calculations on and display a result to the user.
    thanks for any comments.
    A. Lopez
    Attachments:
    error-2501.JPG ‏198 KB

    I think you open multiple times the same TDMS file, you should open it before the while loop. And I don't see a close tdms function...
    Also check for errors on the open TDMS function.
    Ton
    Message Edited by TonP on 02-14-2007 07:45 AM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Timing problems reading tdm files

    Hello NI community,
    my first post because of a very annoying problem with the Storage VIs from the File I/O VIs and Functions palette. I spent a long time to create a program for analyzing tdm files and I spent almost the same time trying to fix this problem now
    My program opens a single tdm file, reads in the data and analysis it, displays the result (e. g. 10 DBL values) and closes the tdm file afterwards, then it opens the next tdm file... . 
    The Problem is, that the execution time increases permanently e. g. starting at 50 ms after 4000 tdm files read it takes about 1 s! So it takes days to read in more than 10000 tdm files. Also it takes many minutes to close the program after reading many (e. g. 4000) files!
    Maybe the Storage VIs store the data in the background on a server or something else and do not release this data after closing the tdm file.
    Has anyone an idea how to fix this problem? How to release all resources after closing the tdm file. Is there an alternative method to read in tdm files without using the buggy Storage VIs.
    Converting tdm to tdms does not help, converting time increases the same way.
    Wait time (0,5 s) after closing the tdm file does not help.
    Settings for tdm VIs: open (read only)
    LabView2011 SP1
    Thanks in advance
    Daniel

    Hello Norbert,
    thank you for your reply!
    Attached you´ll find a simplified example for testing.
    It reads the same .tdm file multiple times. The behavior is the same than in my application.
    Copy the files on your computer, select the correct folder for the .tdm file in the VI and press start. You´ll see the execution time for opening the .tdm file, for reading the data and also for closing the .tdm file rising.
    For example "Read data" duration on my computer:
    Loop #:     Duration 2:   Factor to duration at start:     Stopping program:
    1              19 ms                                                ​    < 5 s
    1000         42 ms         2
    2000         63 ms         3
    4000         101 ms       5
    8000         185 ms       10
    10000       222 ms       12                                        > 3 min
    The tdm-files I need to read in are with .bin data files and bigger. Reading lasts about 100 ms for the first tdm-file. The factor is almost the same like in this example. So it takes about 1 s after reading 6000 tdm-files.
    Best Regards
    Daniel
    Attachments:
    Read_tdmFileMultipleTimesTest.vi ‏876 KB
    Read_tdmFileMultibleTimesTest.zip ‏1265 KB

  • Request for TDMS files (testing Matlab importing code)

    Dear all,
    I'm currently working on modifying the example 'ReadFile.m' that comes with the .dll from NI. I have got to a stage that I'm reasonably happy with, imports multiple groups with multiple channels of different sizes. Can import timestamp data, extra file properties.
    I will post up the completed code eventually but I wanted your help by sending me random formats of TDMS files, I have tested a few different formats, but mostly of my own concoctions so they may not cause errors that I need to make the code more robust.
    Any help appreciated sending TDMS file. Obviously don't send any data that you don't want the world to see.
    Many thanks in advance
    Pete
    Pete
    Systems engineer (CLAD LV2013)

    Hi Pete,
    Not sure if there's anything in particular which you were looking for, but please see attached for a quick TDMS file I put together. It's a pretty basic file with random numbers, but hope it helps.
    Attachments:
    TDMS File.zip ‏442 KB

  • How to read TDMS file use DDC_GetDat​aValuesStr​ing in C language.

    1. Below code is correct, because the numDataValues is one, machine=sibot
    char ss[10]={0};
        char *strMachine=new char[1];
        *strMachine=ss[10];
        nullChk (strMachine = (char *) malloc (sizeof (char) * (unsigned int)numDataValues));
        ddcChk (DDC_GetDataValuesString (channels[i], 0, (unsigned int)numDataValues, &strMachine));
        printf ("Channel value for Machine : %s\n", strMachine);
    ---then show "nel value for Machine : sibot"
    2. But when the numDataValues is more one, I can't get all the data in the TDMS file, only can get the first one.
    eg:
    data one is FI,
    data two is O
    but I only can get FI....
    what's wrong?? How to solve it?? The data format as attachment.
    Attachments:
    20131110151804.jpg ‏11 KB

    Hi KittyDeng,
    I guess the problem is from here:
    char *strMachine=new char[1];
    You allocated a char array of only 1 element which will not hold as many chars.
    The best way to solve the problem is to allocate more memory than that of the data, where in your case, you can write:
    char *strMachine=new char[20];//or set more than 20
    Hope this helps.
    Zhiqiang Tu
    NISH AE

  • Problems reading waveform files in MATLAB

    Deal all,
    I acquired signals on 2 A/D channel (using DAQ board M USB-6215) and save them into waveform file using WriteWaveformsFile.vi. But for processing (FFT, elippse fitting, sinewave fitting) I want to use these data in MATLAB. I tried some options like conwert waveform to bin file but I cannot get these data in MATLAB correctly. I also convert waveform data (or data from one waveform) using WriteToSpreadsheetFile.vi, but still I can get correctly data in MATLAB. I am not sure what I'm doing wrong. Thank you for you help on any tip. I use matlab R2009a andLabview 8.5.
    Tomaz.
    Solved!
    Go to Solution.

    Hello, I have waveform file saved and I want use these data to be read in MATLAB. I have problems to correctly save these data to file (e.g. .bin or .xls) to be available in MATLAB. I will try save data from waveform file to measurement file as you suggested. I hope this wil help. Thank you for the tip, srikrishaN.

  • Read time of tdm file increases

    Hello,
    I recently recorded a lot of data in tdm format. I originally saved it in an excessively organised and complex way which resulted in large header files and was very slow. I changed it and most of the data is fine, except 6 files in the old format. Just trying to read them to get the data out and then convert it into an easier format is taking far too long. Each file has ~15000 channel groups, each with 3 channels (I won't do this again...). I have witten a small vi to test the reading speed. Excluding opening and closing of the file, if I just find a channel group by name, reading one channel from that group takes about 1 second. This would still take days to read it all but would be acceptable. The strange thing is, is that if I do this in a loop for successive channel groups which is clearly necessary, it takes longer and longer each iteration. This is behaviour that I have always seen when reading tdm files, but it hasn't caused a serious problem before. I can't find any information about why though, so I hope I'm just doing something stupid. I have attached the speed testing vi (Labview 2010). Running it for 5 iterations, the time taken to read the channels is
    0.82304 s
    1.58809 s
    2.42514 s
    3.56820 s
    5.60632 s
    The channels it is reading all have the same number of values, and it makes no difference if I start at a different channel group (by adding a number to i in the loop).
    Does anyone have any explanation for this behaviour?
    Thank you very much for your help, and I'm sorry if it's something tht has been asked before,
    James 
    Solved!
    Go to Solution.
    Attachments:
    ReadBadTDMSpeedTest.vi ‏44 KB

    TDMS is an all binary format whereas TDM posses an XML header, otherwise they are very similar. Being a binary format you would expect it to read faster especially as you mentioned that the header was complex.
    There are a number of un-closed references in your code and I wonder if this was partly the issue, although this wouldn't explain why converting to TDMS fixed the problem?
    Beyond that, it would be nice to try this without using the express VIs to see if the problem still occurs. 
    Also, where you able to see if this was a memory issue? And if the read time continued to increase beyond what you posted?
    Anyway, I am glad we found a solution to your problem.
    Nick C.
    Cardiff University

  • How can I read in a TDMS file into Sound and Vibration Assistant

    I have recorded a signal from 2 channels from a PXI 4496 DAQ card. I recorded this signal with the TDMS file format from a VI in Labview. I would like to import these signals into the Sound and Vibration Assistant for freq. analysis. In sound and vibration assistant there is an import logged tdms from signal express but I can not seem to import my original signal?  How can I import this data? 

    Hello All,
    I am trying to read TDMS file using LABVIEW. The TDMS file is created by me for reading data from one wire devices.
    I have created simple vi. attached below which read data from TDMS file. I am able to read other tdms files, I have with this program but not which one created by me. I am not able to attach file with .tdms exentiont. So I have attached it with .xlsx extention. Can anyone please guide me where is the problem in TDMS file? Am I missing anything while creating it?
    Thanks
    Attachments:
    EditTDMS (1).vi ‏14 KB
    data.xlsx ‏17 KB

Maybe you are looking for