Jump to content

Reading Custom TDMS properties


Recommended Posts

Hi all!

I'm new to the forum and I have a strange issue with reading TDMS custom properties with Labview.


Creating user properties is working fine using TDMS Set Properties.vi, but I can't read them with TDMS Get Properties.vi. I can read the "standard" properties, and also I do see the properties in DiAdem (dataportal and using script) and also in Excel when I use TDM(s) importer. The property names are not listed when calling TDMS Set Properties.vi without the property name and data type terminals connected.   

There is no simultaneous file reading or writing.

I solved the problem with loading DiAdem and running a script, but that's very slow and also not all target machines have DiAdem installed (and no licence either, obviously).

I also tried with property names such as User Properties\Device_ID, User_Properties/Device_ID in whatever combinations (I look for the property "Device_ID") without success.

Thank you for any hints in advance!

Link to comment
56 minutes ago, Lipko said:

Creating user properties is working fine using TDMS Set Properties.vi, but I can't read them with TDMS Get Properties.vi.

  1. What level of properties did you write? File, Group, or Channel?
  2. What level of properties are you trying to read? File, Group, or Channel?
Link to comment
7 minutes ago, JKSH said:
  1. What level of properties did you write? File, Group, or Channel?
  2. What level of properties are you trying to read? File, Group, or Channel?

Channel for both. And I checked the written files in diAdem, the property is porperly on the channel level.
Also I managed to read "standard" properties from the channel in Labview which are only valid at channel level (displaytype for example) and it works, so there shoudln't be a mistake.

Link to comment

I did realize earlier that I used "illegal" space character in the property name and I'm aware illegal characters are replaced with underscores in DiAdem. I think I have a theory which I can only try on Monday:

set properties does accept the illegal characters "silently" without fixing but read property doesn't find properties with illegal characters (because my first read property try was with spaces and it was not successful. At set properties I don't get errors). I was deceived that set properties was okay because DiAdem and Excel importer do accept spaces but replaces them with underscore. Later I also tried read property with underscore without success. This implies that the illegal character fixing happens in DiAdem and not by set properties as I took it as given.

So the question is: is it possible to read property names with illegal characters somehow (so that I can read old files too) in Labview, if it is possible in Diadem?
Of course my first try will be to read with spaces, but only on Monday. I was too excited to wait with my posts...

Link to comment
4 hours ago, Lipko said:

So the question is: is it possible to read property names with illegal characters somehow (so that I can read old files too) in Labview, if it is possible in Diadem?

If was written successfully, then it can be read too.

The key is to find out what name was stored in the TDMS file. If you call TDMS Get Properties.vi without wiring the "property name" and "data type" input, you're meant to get an array of all available properties in the "property names" output.

 

11 hours ago, Lipko said:

The property names are not listed when calling TDMS Set Properties.vi without the property name and data type terminals connected.

I presume you meant TDMS Get Properties.vi? If so, then that's very weird. My next guess would be you're opening different files in LabVIEW vs. DIAdem.

Try calling TDMS Get Properties.vi without the name inputs immediately after you write the custom property.

Link to comment
4 hours ago, JKSH said:

If was written successfully, then it can be read too.

The key is to find out what name was stored in the TDMS file. If you call TDMS Get Properties.vi without wiring the "property name" and "data type" input, you're meant to get an array of all available properties in the "property names" output.

 

I presume you meant TDMS Get Properties.vi? If so, then that's very weird. My next guess would be you're opening different files in LabVIEW vs. DIAdem.

Try calling TDMS Get Properties.vi without the name inputs immediately after you write the custom property.

Yes, I meant get properties, and it didn't return those properties. I tried TDMS viewer, some 3rd party labview viewer and those didn't find my properties either

Okay, I will try a few things next week (testing with proper property names). If it's successful, I'll rewrite my set properties code. I'll make two versions of the getter to deal with the old files with the illegal property names. Or something...

 

Link to comment

Thanks for the replies!

As usual, I did things wrong. This time it was with the testing. When I started I tried with the actual property names with the illegal characters. But the tested files (which were chosen randomly) were probably all files that was once re-saved with Diadem. Then I tried with the underscores, this time probably on totally different files which were never re-saved in DiAdem. Funny thing is that I tested multiple times with the underscore, seeminly always on non re-saved files...

Anyways, Now I look for both the original property and the fixed property. Thanks Antoine for the illegal characters' list. I used it as the search+replace regex search string.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.