Lipko Posted July 12, 2019 Report Share Posted July 12, 2019 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! Quote Link to comment
JKSH Posted July 12, 2019 Report Share Posted July 12, 2019 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. What level of properties did you write? File, Group, or Channel? What level of properties are you trying to read? File, Group, or Channel? Quote Link to comment
Lipko Posted July 12, 2019 Author Report Share Posted July 12, 2019 7 minutes ago, JKSH said: What level of properties did you write? File, Group, or Channel? 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. Quote Link to comment
hooovahh Posted July 12, 2019 Report Share Posted July 12, 2019 Does the Get Properties return an error? If so what is the error? Show your VI that does the reading and writing. Oh and what is the property names there are a few that NI reserves. Quote Link to comment
Antoine Chalons Posted July 12, 2019 Report Share Posted July 12, 2019 maybe this thread can help you, at the end it give the list of forbidden characters. Quote Link to comment
Lipko Posted July 12, 2019 Author Report Share Posted July 12, 2019 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... Quote Link to comment
hooovahh Posted July 12, 2019 Report Share Posted July 12, 2019 Here is an answer by NI about why DIadem and Excel add-in do weird things with spaces. https://forums.ni.com/t5/DIAdem/Spaces-In-Property-Names/td-p/2831180 Basically its due to how it is indexed and put into a database. The standard LabVIEW TDMS API does allow writing and reading properties with spaces in them. Quote Link to comment
JKSH Posted July 13, 2019 Report Share Posted July 13, 2019 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. Quote Link to comment
Lipko Posted July 13, 2019 Author Report Share Posted July 13, 2019 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... Quote Link to comment
Lipko Posted July 15, 2019 Author Report Share Posted July 15, 2019 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.