LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read tdm file out of order

Hello,
 
I am trying to read a .TDM file into LabVIEW.  I have created a .tdm file with multiple groups.  When I try to read in the file the channels within the groups are not in the same order as when I read them in (i.e. Pressure was saved as index 1 when I read it in labview it is run 5 and so on.)   Also the channels are in different loacations betwwen runs.  When reading in a .tdm file with 1 group I can read it fine.
 
Has anyone else ever seen this problem?
 
Dan

Dan Shangraw, P.E.


   

0 Kudos
Message 1 of 8
(3,251 Views)

Dan,

I can't say I've ever seen this problem before, but I'd be interested in investigating it. Would it be possible for you to post a simple example that illustrates the behavior (without hardware so that others can run it)?

Kind Regards,

E. Sulzer
Applications Engineer
National Instruments
0 Kudos
Message 2 of 8
(3,233 Views)
Here is the VI I am using to read the data and the .tdm and .tdx files

Dan Shangraw, P.E.


   

0 Kudos
Message 3 of 8
(3,229 Views)

Dan,

I am happy to report that I was able to reproduce the behavior aa well as find an explanation for you. The different order of signals produced by the two different methods of reading TDM channels is actually expected behavior and is explained below:

  1. Reading channels from one channel group at a time. The order of the signals read will correspond to the order in which they are written for each channel group. This explains why reading the two channel groups in this manner in the example you posted yields two different orders (the channels within the channel groups must have been written in different orders).
  2. Reading channels from multiple channel groups at a time. The order of the signals read will be determined by the engine parsing through the file. This order does not appear to be predictable (i.e. alphabetical, etc.), but does appear to be consistent from channel group to channel group within the read.

Being aware of these differences should allow you to intelligently navigate them and can even allow you to tailor you TDM reading to your specific purpose. I will publish this information in a Knowledgebase so that others can benefit. Please let me know if you have any further questions about it!

Kind Regards,

E. Sulzer
Applications Engineer
National Instruments
0 Kudos
Message 4 of 8
(3,204 Views)

Hello,

So how do I read the channels if I have no control in the order?

I wrote the channels in the same order, and when I open my tdm file in Diadem they are displayed with the correct order.

I also noticed in diadem that each channel has an index associated with it.  The index is in the correct order.  Do I have access to that from LabVIEW?

Dan

Dan Shangraw, P.E.


   

Message 5 of 8
(3,197 Views)

Hello,

I have also observed that the data is not in a consistant order from channel group to channel group when I read it

Dan

Dan Shangraw, P.E.


   

0 Kudos
Message 6 of 8
(3,197 Views)
Gentlemen,

the difference is not really in the order you read through the file-groups-channels hierarchy, but in the VIs you use for that.
- "Read Data" uses a built-in query engine to e.g. get all channels that comply with a given condition. LabVIEW has limited control over the order of return values from that query engine.
- The method that retrieves the channels in the order they've been written in uses "Get Properties" instead. That's also what DIAdem does. You can see the "Read Channel Groups" example for how this is done. I also attached a modified version of your VI.

Hope that helps,
Herbert
0 Kudos
Message 7 of 8
(3,171 Views)

Herbert,

You Rock!!!

That is exactly what wanted.

Thank you so much!

Dan Shangraw, P.E.


   

0 Kudos
Message 8 of 8
(3,160 Views)