DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

DIAdem 8 and TDM(S)

Hello
We have a very mixed environment of different DIAdem versions. And sometimes we'd appreciate a method to read TDM data into a pre-9 version.
Is there any other way to achieve this than to read it into a version 9, save it as .dat and reopen in version 8?

Obviously, it should be possible - TDM(s) file structure is well documented, channel information could be parsed from the XML file and binary data should be as importable as it has been over the past many years. All that I'd think it takes is a program to generate a .dat from the XML, ignoring those properties that early .dat-headers would not have. But this seems a feasible task (to me - not necessarily for me).
Has anyone ventured to do this yet?

Thank you for your attention

Michael
0 Kudos
Message 1 of 6
(4,607 Views)

Hello nimic,

 

Any DIAdem version can store *.DAT files, so the easiest way to solve your task should be to just save *.DAT files in DIAdem version 9 and later.

 

You can load a TDM file in version >9 and save it as DAT, that should make it available for older versions.

Otmar D. Foehner
0 Kudos
Message 2 of 6
(4,601 Views)

Otmar,

Thank you for your reply. I see that I was not detailled enough. Our 'mixed environment' also includes data from 

LabVIEW VIs (Signal Express f.i.), that I' want to treat in DIAdem 8. So, while the path you suggested is quite helpful,

it does not entirely cover my needs. 

I understand that there is a limit to the scope of backward compatibility, Signal Express being post-2006 and DIAdem8 

pre-2002, so it may be only very few users who'd need such a data import. But then again, as I mentioned in my first

posting, as everything in TDM(S) is so well structured and defined, I just wondered, if somebody had already done it...

Best regards

Michael 

0 Kudos
Message 3 of 6
(4,578 Views)

Hi Michaal,

 

Reading the TDM header file with a standard XML function set would be pretty straightforward, though the structure in the TDM file is not drop-dead simple.  The good news is that you just need to focus on the "<usi:include>" block declarations in order to discover how to read the binary data.  The bad news is that not all TDX files can be read with a DAT header file.  The DAT header file uses a "number of values" integer to specify the start position of each channel inside the data file.  If the channel data type is an I8 or U8, then you you can specify the start position of these channel values at any byte they happen to start on.  If the channel data type is a DBL, though, then you have to specify the start position in multiples of 8 bytes.  If the channel data starts at a byte position that is a multiple of 8 you're golden, otherwise you're hosed and can't read that channel's data with the DAT header.  So it would be possible to programmatically create a DAT header for some TDX files, but there will be also be some TDX files where only some of the data channels can be read by creating a DAT header.  I have a VBScript function library for creating DAT header files, and I also have VBScript code that reads the block information from the TDM file, but I haven't ever combined the two, and that still would only work for some TDM files.  If you're lucky, though, it might work for all the TDM files you deal with.

 

But wait, it gets worse.  With TDM files you actually have an XML header file.  With TDMS files, which are what come out of SignalExpress, these are pure binary files that have a binaryy header at the top of each buffer written to the file.  It's theoretically possible to create a DAT header assuming the TDMS file had only 1 buffer per channel, but as soon as you have more than one buffer per channel the DAT header cannot describe all the data in a channel.  Dat headers not only have the limitation of specifying the start position in multiples of the channel data type byte width, but they also have the limitation that they can only describe channels with data in a single contiguous block.  It's fine for data values from multiple channels to be interleaved in that one block, but if channelX has half its values in block1, followed by a binary TDMS block header, and the other half of its data values in block2, then the DAT file has no way of describing both blocks.  Game over.

 

For years and years I created DAT header files on the fly to match the structure of data in ASCII and binary files, and I railed against these and other limitations in the DAT header property set, but there was nothing that could be done that enabled the DAT approach to transcend the limitations.  You could theoretically use the free downloadable TDM(S) C++ library to build a GPI-DLL that could be used in DIAdem versions earlier than 9.0 to load both TDM and TDMS files, but that would be a LOT of work, and I wouldn't be able to help you with that.  You might see if Matthias ["Twigeater"] from this forum or some other long-standing DIAdem user could help you build such a GPI-DLL, though it would probably be a billable project considering the effort.

 

Sorry for the bad news,

Brad Turpin
DIAdem Product Support Engineer

0 Kudos
Message 4 of 6
(4,559 Views)

Hi Brad,

Thank you for your excellent and elaborative answer. Guess that's what I'll stick with....

Michael 

 
0 Kudos
Message 5 of 6
(4,547 Views)

Michael,

 

Is there any reason why you cannot change to a newer version of DIAdem (11.0 being the current one). There are A LOT of nice features (in addition to being able to read TDM(S) files) in the newer versions that you might find helpful and useful. I would be happy to show you some of the new features and see how they might help you along with your application.

 

Otmar D. Foehner
0 Kudos
Message 6 of 6
(4,529 Views)