DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Are TDMS property names case-sensitive? If so, which case should I use?

Hello,

 

Context

I used NI-DAQmx to automatically log data into TDMS files. Out-of-the-box, I'm unable to search this data by maximum/minimum values, because the relevant properties are not automatically created: http://forums.ni.com/t5/DIAdem/Cannot-search-by-channel-maximum/td-p/1456700

 

That's not a big problem, as I can easily find these values and add the properties myself. So, I wrote some LabVIEW code to add "Maximum" and "Minimum" properties to each channel (notice the uppercase 'M' for both properties). Now, I chose these property names because they were shown in http://www.ni.com/white-paper/14252/en/ -- it suggests adding these 4 properties: "Maximum", "Minimum", "Monotony", and "NoValueKey".

 

This worked, and I'm now able to use DIAdem to search through my data.

 

 

Confusion

I thought I'd try to get DIAdem to write the properties I want, instead of running a LabVIEW program. I loaded a test file in DIAdem, and re-saved it. It turns out that DIAdem writes the properties in all-lowercase, unlike the article above: "maximum", "minimum", "monotony", and "novaluekey".

 

Now, http://www.ni.com/white-paper/14252/en/ also says, "property names are case sensitive and must be in lowercase". Does this apply to the waveform properties only, or to all properties?

 

What casing should I use?

 

TDMS itself seems to be case-sensitive; notice the "duplicated" properties (one set created by DIAdem, one set created by my LabVIEW code):

 

TDMS Duplicate Properties.png

Certified LabVIEW Developer
0 Kudos
Message 1 of 4
(3,047 Views)

Hello,

 

When you say that you used DAQmx to automatically log data into the TDMS, do you mean using the DAQmx Configure Logging VI? It is true, it does not populate all properties, but if you open a TDMS with DIAdem, you should see the correct Maximum and Minimum values (DIAdem find them for you, along with Monotony and other properties).

 

The all-lowercase disclaimer is about the waveform properties like wf_xname or wf_increment. Non waveform properties in TDMS files are not all-lowercase, but are case sensitive. That's the reason for the duplicate. DIAdem is not creating Maximum and Minimum; DAQmx does, even when it does not populate them automatically and since you created maximum and minimum, you get them twice.

 

In fact, you can right-click a TDMS file created by the DAQmx Configure Logging VI and select Open With » Excel Importer and you'll be able to see all the properties that are created, and which of those are populated automatically. Only MaximumMinimumDescription and Start Index should be empty.

 

Hope it helps. Let us know if you have more questions and we'll try to help.

 

Regards,

Camilo V.
National Instruments
0 Kudos
Message 2 of 4
(3,000 Views)

Hello Camilo, and thanks for replying.

 


@Cavarval wrote:

 

When you say that you used DAQmx to automatically log data into the TDMS, do you mean using the DAQmx Configure Logging VI?


Yes.

 

if you open a TDMS with DIAdem, you should see the correct Maximum and Minimum values (DIAdem find them for you, along with Monotony and other properties).

That's not the same as having the Maximum and Minimum values stored inside the file.

 

DIAdem calculates those properties when I load the channel into the Data Portal and click on it. However, DIAdem does not store these properties anywhere, so I'm unable to search for them. This is already described in http://forums.ni.com/t5/DIAdem/Cannot-search-by-channel-maximum/td-p/1456700

 

DIAdem Data Portal vs File.png

DIAdem Unsearchable.png

 

 

The all-lowercase disclaimer is about the waveform properties like wf_xname or wf_increment. Non waveform properties in TDMS files are not all-lowercase, but are case sensitive. 

Great, thanks for clarifying.

 

Now, on to my main issue: To make my files searchable in DIAdem, I need to calculate the max/min values and write them into the TDMS files. However, it's not clear to me what I should name these properties.

 

When I use DIAdem to save a TDMS file, it creates the properties "maximum", "minimum", "monotony", and "novaluekey" (all lowercase). However, http://www.ni.com/white-paper/14252/en/ says I should create "Maximum", "Minimum", "Monotony", and "NoValueKey" (camelcase).

 

My main question is: Which should I use -- "maximum" or "Maximum"? Or is there no difference either way?

Certified LabVIEW Developer
0 Kudos
Message 3 of 4
(2,992 Views)

Short answer: Those Property names are lower case!

It is: 'name', 'description', 'unit_string', 'minimum', 'maximum', 'novaluekey', 'monotony', 'displaytype'
'wf_samples', 'wf_xname', 'wf_xunit_string', 'wf_start_time', 'wf_start_offset', 'wf_increment'


Background: The problem shows up because DIAdem(TDM, TDMS, ...) handles property names case insensitiv while Labview(TDMS) handles them case sensitiv.

This means you can create two attributes in LabVIEW (like you figured out), while they result in a single property in DIAdem. Which one is loaded in DIAdem is random (order on the file).

Additional confusion shows up because there is a translated display name shown in DIAdem data portal.

The following DIAdem script shows diplay and real name

Option Explicit
dim prop : for each prop in data.Root.ChannelGroups(1).Channels(1).Properties
  LogFileWrite "Name: '" & prop.Name & "'  DisplayName: '" & prop.DisplayName & "'"
Next

which results in (english version, just a few)

Name: 'name'  DisplayName: 'Name'
Name: 'description'  DisplayName: 'Description'
Name: 'unit_string'  DisplayName: 'Unit'
Name: 'minimum'  DisplayName: 'Minimum'
Name: 'maximum'  DisplayName: 'Maximum'
Name: 'novaluekey'  DisplayName: 'NoValues'
Name: 'monotony'  DisplayName: 'Monotony'
Name: 'displaytype'  DisplayName: 'Display format'
Name: 'waveform'  DisplayName: 'Waveform'
Name: 'wf_xname'  DisplayName: 'Waveform x-name'
Name: 'wf_xunit_string'  DisplayName: 'Waveform x-unit'
Name: 'wf_start_time'  DisplayName: 'Waveform x-start time'
Name: 'wf_start_offset'  DisplayName: 'Waveform x-offset'
Name: 'wf_increment'  DisplayName: 'Waveform x-step width'

Sorry for the inconveniance.


P.S.: Most times you can figure out the real name by dragging the property from portal into your script. But it does not help with 'minimum' and 'maximum' Smiley Sad

0 Kudos
Message 4 of 4
(2,982 Views)