03-29-2006 02:45 PM
03-30-2006
05:21 PM
- last edited on
04-26-2024
11:32 AM
by
Content Cleaner
Hey psp guy!
I am not sure if it is possible to write a MATLAB function that could translate a TDM file. What post processing do you need to do in MATLAB? LabVIEW 8 added a ton of new analysis functions that you could probably use to process your data set. Also added is MathScript which you may find useful. LabVIEW does have a toolkit called the Math Interface Toolkit that does allow interfacing with MATLAB. Since the TDM file has built in support in LabVIEW, it will probably be easier to program in just LabVIEW.
Please repost if you have any other questions!
Andy F.
03-31-2006
07:07 AM
- last edited on
04-26-2024
11:33 AM
by
Content Cleaner
Hi Andy,
Thanks for the reply. I realize that most post-processing can be done easily with LabVIEW but there are many here who use Matlab and don't know LabVIEW. I'm anticipating a lot of resistance when I propose a file format that can be read exclusively by LabVIEW. I will check out MathScipt and the Math Interface Toolkit ; hopefully it will help me convince them TDM is the way to go!
PSP Guy
04-03-2006 03:49 PM
05-25-2007
03:14 AM
- last edited on
04-26-2024
11:33 AM
by
Content Cleaner
09-10-2007 02:29 PM
Ok, so *theoretically*, one can read TDMS file information into Matlab. But I'll be darned if I can figure out what I need from the linked knowledgebase example, which is far too rudimentary. It only reads the channel's data values, but it does *not* identify any of the channels by name. It also doesn't demonstrate how one would extract any of of the file, group, or channel property info, without which a bunch of unidentified and unlabeled data is fairly useless.
Hasn't anyone at NI worked up a more illustrative and universal example? Under LabVIEW, the TDMS file viewer gives us a quick way to inspect the entire contents of any TDMS output files. It was a great point of reference when I developed custom vi's for reading my own particular files.
Does anyone have a comparable example in Matlab, capable of reading all the info from a TDMS file and saving it to appropriate variables? At the moment, I can't even figure out how to use the Matlab pointer datatypes to read channel names and create named variables for the TDMS channel data I read in.
Gripe: TDMS has gotten quite a bit of promotion as a preferred file format for LabVIEW data storage. I really like it for writing, but am on the verge of abandoning it because it's been too cumbersome to work with after the fact. There's a woeful shortage of useful tools available for manipulating TDMS files, especially outside of LabVIEW or (presumably) Diadem. I suppose the Excel plugin might be kinda useful IF we had the right version of Excel AND we had IT privileges for installing plugins AND Excel weren't so dog-slow with 10's of MB of data.
What I *want* to do is create test apps that produce lots of data that our analysts can play around with to their hearts' content. That means they need to be able to handle the data format. Realistically, this means converting data into Matlab. That's where they play -- it's the tool they're proficient with and have a group license for. Diadem ain't gonna happen. I can't make a LabVIEW executable or dll b/c we don't have install privileges (for the needed LV run-time) on our networked workstations. So unless I can come up with a Matlab script that brings in all the relevant info from my TDMS files, I'll be the bottleneck on all the analysis work, since I'll be the only one able to convert them into a more useful format.
NI, if you want to make a file format standard and ubiquitous, give us the tools that make it stop hurting so much!
-Kevin P.
09-11-2007 11:30 AM
Hi Kevin,
in the attached m-file you can find example code to read the file (root) name property as well as the group and the channel name property.
Please let me know if you need additional infromation.
Greetings from cloudy Aachen
Stefan
09-12-2007 09:59 AM
Thanks for the example -- it does read in group and channel names for me and I'm digging through Matlab help to better understand their pointers and handles so I can actually understand what to modify.
The kind of additional information I mainly need is Matlab orientation. For example, when I want to retrieve a channel's 'Name' property, the dll help file refers to the argument as a "void *". Your example successfully uses the datatype "uint8Ptr" instead of "voidPtr". I had previously tried passing in a voidPtr without success (though I may have had something else wrong too).
It also isn't clear when declaring a Matlab libpointer whether I should give a scalar length like 32 or a range value like 1:32. Does the latter create an array of pointers, i.e., does it effectively become a pointer to a pointer?
I realize it isn't NI's job to give Matlab help, but a more thorough example and a small doc that gave a *little* explanation for the syntax would be a big help.
Please feel free to pass this along to someone who may be in a position to upgrade the example. Meanwhile, thanks for shedding some light on it!
-Kevin P.
12-25-2007 12:38 PM
01-02-2008 01:23 AM
With the current version of the TDM-C-DLL it is not possible to extract date/time information from a TDM(S) file.
Happy New Years from winterly Aachen
Stefan