DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How does DIADEM import TDMS files? How gets every channel his number and groupindex? How can I determine which channel has which groupindex and number?

I store different channels in a TDMS file.
I like to have a time channel at the first position with group index 1 and number 1.
When I read the TDMS file with DIADEM the time channel (Float64) is on a differernt position, and the channels are not sorted alphabetically.
 
Here are my questions:
 
How does DIADEM import TDMS files?
How gets every channel his number and groupindex?
How can I determine which channel has which groupindex and number?
 
Best regards
 
Joerg
0 Kudos
Message 1 of 11
(5,156 Views)
Joerg,
please check this link to learn more about the internal structure of a TDMS file. The document explains a lot but I am not sure if it answers your question. The key point is, that a TDMs file could be quite fragmented, channels could be spread over the complete file. This has something to do with the way you are creating the file. Each datablock has a reference to a channel and a channel group and when loading the file all data blocks are sorted accordingly.
That means that groups and channels will be imported in the order of their appearance. If you would like to see your time channel first (which we recommend), create the timechannel first when writing the TDMS file.

By the way, due to the fragmentation of the file, reading of the data can eventually be somewhat slow. As I said, the application needs to parse the complete file and gather all blocks of the channel. You can improve the read performance by calling the VI TDMS defragment after you finnished writing to the TDMS file.

regards
Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 2 of 11
(5,149 Views)

Thanks Ingo,

I defragment the file allready and write the time channel at first, and the channel starts with an "a".

If the channels would be sorted alphabetically it should be first.

To write the groupindex and the number in in the properties of the TDMS doesn't help either.

Do you havesome other suggestions?

Thanks Joerg

 

0 Kudos
Message 3 of 11
(5,145 Views)
Hi Joerg,
no, the channels are not alphabetically ordered. (You could do tis in DIAdem, though: Use the list view in the data portal).

I don't know how your application is looking. As far as I understood, the channel order is defined by the order in which you are creating channels in a file (first instance of creating a property or writing a value). If you are writing to the channels a couple of times, the order in which you are doing that later on does not matter anymore.
Do you start with creating the channels first (maybe to add some properties)?
Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 4 of 11
(5,142 Views)

Hi Jörg,

i suppose that you´re programme whose create the *.tdms file is writing on false position. Try to create datas with timechannel on first indes in diadem, then save it and then open it again. you see that all is correct. So please tell me what programm in what version do you use and please attache it here.

Did you use the library for creating *.tdms files like in the link ?

http://zone.ni.com/devzone/cda/tut/p/id/6471

Here you find the gtdms_8.x.zip - when you extract it and opened the *.llb you find vi´s for all functions e.g. writing 2d array of strings to *.tdms file

when you open the subvi´s then you see how created and writing datas/structure to *.tdms files. Because *.tdms is binary you can´t see structure with open it in editor.

When you don´t have Labview you can use the 30 days test of current version 8.5 under following link

german version download link

https://lumen.ni.com/nicif/d/lveval/content.xhtml

english version download link

https://lumen.ni.com/nicif/us/lveval/content.xhtml

Hope it helps

Best Regards

 

 

0 Kudos
Message 5 of 11
(5,130 Views)

Thanks Johann,

the LabVIEW 8.0 VIs are a big help to understand the TDMS storage.

I attached the example for LabVIEW 8.5 with the time channel problem.

I like to have the channel a_zeit_relativ at number 1.

If you run this VI you can see a second feature of the TDMS file format.

On a Windows PC the DataSetComments are fine and you can read the right ASCII character.

On a Real Time PXI 8156B system you can't see all DataSetComments because the converting to DIADEM character coding is missing.

Ciao Joerg

0 Kudos
Message 6 of 11
(5,125 Views)
So when i understand it correct your vi works correct in WinXp or 2k but not when boot your PXI system in Realtime ?
0 Kudos
Message 7 of 11
(5,121 Views)

No and yes

The order of the channels is the same under Windows XP or RealTime for PXI.

But the coding of the not printable characters (Unicode 128-255) is different between XP or Real Time for PXI.

Ciao Joerg

0 Kudos
Message 8 of 11
(5,119 Views)

Best way is to try a simpliest vi for writing *.tdms file and try change orders so you can find where the problem is

Best Regards

0 Kudos
Message 9 of 11
(5,105 Views)
The order of channels in the file is determined by the order in which they are written to disk. The channels get "created" in memory the first time either properties or data values are written to them. They are not necessarily written to disk at the same time and in the same order. They are written to disk when you either write data values or close the file or use TDMS Flush. Channels with NI_MinimumBufferSize>0 will not be written until the minimum size is reached (or you close or flush the file).

Long story short, in your case the channels are created when you set properties in the "open" case. If you finish the "open" case with a TDMS Flush, you should be fine.

Hope that helps,
Herbert
0 Kudos
Message 10 of 11
(5,096 Views)