DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a TDM-File within a .NET-Application?

Hi, I'm developing an application that collects different values and stores it internally into arrays. Now I want to create a TDM-File within my .NET-Application. Is there a way to do that (e.g. a library that I can use)? Is there I format-description for TDM? Greetings, dragonos
0 Kudos
Message 1 of 9
(6,844 Views)
Hello Dragonos!
 
There is a NI TDM Header Writer DLL. The C API is described here: http://zone.ni.com/devzone/cda/tut/p/id/2824. Look in this thread to get informations about the DLL.
 
If you use it you have to be familar with using umnanaged code in .NET (C++ or C#) and you have to adapt the header file (C#, perhaps C++ too).
 
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 2 of 9
(6,842 Views)
The Header Writer DLL only seems to produce the XML-File.
I have to create the binary file as well which include all measurement-data.

Is there a DLL which creates all (xml AND binary-file)?
0 Kudos
Message 3 of 9
(6,838 Views)
Hello Dragonos!
 
IMHO it should be easy to create the binary file with a .NET application.
 
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 4 of 9
(6,835 Views)
Hello Twigeater, yes, it should be easy. But I've to know the format of the binary file. How is the file organized (e.g. all values from channel 1 oder only one value from each channel, ...)?
0 Kudos
Message 5 of 9
(6,832 Views)
Hell Dragonos!
 
All these information should be provided in the DLL documentation.
 
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 6 of 9
(6,828 Views)

Hi dragonos,

There are 2 separate TDM C DLLs, one which writes only the TDM header file for an existing binary file, and a completely different DLL that reads and writes either TDM or TDMS files.  It sounds like you have downloaded the former DLL and you really want to latter.  Go to the www.ni.com/support web site, then type in "tdm C file DLL" in the search field, you will be taken to a web site with the two DLLs in question listed in order.  The link to the second DLL is called "Reading and Writing TDM/TDMS Files".

Let us know if you have further questions on the second DLL,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 7 of 9
(6,806 Views)
Hi Brad,

I only need to create the XML-file now. The data were stored in binary format directly in my application now.

In the first DLL (only for headerfile) I'm missing the definition of the struct tdwmState. In the headerfile nothing is shown an I think its a very important structure which stores filehandle, ... .

Where can I find the missing information?


dragonos
0 Kudos
Message 8 of 9
(6,761 Views)
Hello Dragonos,

the content of the tdwmState structure isn't important for your application.
The Content of this structure is handled by the dll itself. Yu do not have
to refere to any of its members. So in terms of C its a void* for your application.

The binary format could contain a lot of different forms.
Lets assume channel a,b and c they may be ordered in the binary file like
this.

tdmwSetupChannel:
  aaaaaaaabbbbbbbbcccccccc

tdmwSetupBlockChannel:
  abcabcabcabcabcabcabcabc

tdmwSetupMultirateBlockChannel:
  aabcccaabcccaabcccaabccc

A single binary file can contain a mixture of these binary modes.
  aaaaaaaaaaaaaaaaabcbcbcbcbcbcbc
dddddddddddddddddddd
needs tdmwSetupChannel & tdmwSetupBlockChannel to describe
the binary file.

If it only contains one set of Block/
MultirateBlock and your measuring
and do not know how long the channel will be you can use
  tdmwSetupMultirateBlockChannelNoLength
because it will be possible to calculate the channel length by using the
file size.

Andreas




0 Kudos
Message 9 of 9
(6,721 Views)