From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

NI_DataType vs Datatype properties

Solved!
Go to solution

What is the difference between NI_DataType and Datatype properties?

Thanks to Excel Importer I can check the Datatype properties and see e.g. that my channel is of type DT_DOUBLE.

However, when I try to read this property it can't be found.

TDMS_Type.png

 

I need to create the tool in LabVIEW which loads TDMS file, alter it and then save it preserving the original file structure (data types). Now I'm a bit confused about what property should be used to accomplish my task.

 

I have two groups: One with waveform channels and second with numeric channels. If I read waveform channel NI_DataType I'm getting 10 (which can represent DBL, Analog waveform or Dynamic data). If I read my numeric channel NI_DataType I'm getting 0 which is not correct.

Excel returns DT_DOUBLE Datatype property for both channels.

Data.png

 

So how to properly determine the data type?

Michał Bieńkowski
CLA, CTA

Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
Message 1 of 3
(3,702 Views)

In the attachement, you can see the example showing the weird behavior.

Michał Bieńkowski
CLA, CTA

Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
0 Kudos
Message 2 of 3
(3,670 Views)
Solution
Accepted by topic author bienieck

I have got some unofficial response from support. So in case, someone in the future will face the same problem, here are some useful pieces of information.

 

NI_DataType is a virtual property, evaluated based on the channel data, specific to LabVIEW and it is loosely coupled to the Datatype property of the TDMS channel object. The value is an integer that corresponds to a LabVIEW type code and is READ ONLY - basically, it is a descriptor of the data within a channel and it is set based on the data which are written into a channel. This implies that it will always be found, for all of the defined channels, and that's why NI_DataType was always present in my example (TDMS_Test.zip). Whether or not it will return a valid datatype value, will depend on whether or not the respective channel was initialized. The reason why uninitialized arrays also sometimes work is unknown. For some data types, it works for some not. The array of strings is an example which does not work and that's one of the visible inconsistencies (see TDMS Test2.vi).

 

So one might use NI_DataType to create data converter however, the problem is that there are some inconsistencies regarding the datatype codes returned by the TDMS Get Properties function and the LabVIEW codes. This can be seen in the TDMS Test.vi. We can clearly see inconsistent type descriptors. This problem was supposedly escalated to R&D.

 

About the Datatype property:

NI Diadem does not use the same TDMS API as LabVIEW. DIAdem/TDMS DataPlugin expose this information through other API members and there are differences between the LabVIEW and the Diadem metadata stored within a .tdms file. If I open the "File0.tdms" (TDMS_Test.zip) in Diadem and if I check both the Base or the Extended Properties of the channel, there is no "datatype" property. It is created in the background by the Diadem TDMS API as an auxiliary property to store the information about channel datatype however, it is not meant to be "visible".

 

This is a poor idea IMO. I thought that the power of NI is a "platform approach", in the sense that all the tools are compatible and the exchange of data is transparent/natural. This case shows it's not true because it seems that the proper tool for data exchange between LabVIEW and DIAdem does not exist (yet?).

Michał Bieńkowski
CLA, CTA

Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
Download All
Message 3 of 3
(3,648 Views)