LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS Get Properties returns wrong value

Hello, its me again
 
This time I have problems concerning the new tdms data format. I write the test data including a lot of properties in a single file. When the vi "TDMS Get Properties" reads one property which does not exist,  the output "found" should be false and "Property Value" be the default value. But the value of an other property in the file is returned sometimes. This error only occurs in my real program. I was not able to reproduce the error in a little example even with the same tdms file and reading the same property. But in the application the error is repeatable. When I restart and create a new file, the error occurs at the same place as before.
It looks like this error only occurs when the propertys parent (the channel or the group) does not exist. My workaround will be to check if the parent exists and probably to set default values for properties that always exist.
Does anybody else know this problem? Is there a better solution?
 
Thanks
shb
0 Kudos
Message 1 of 7
(4,117 Views)
Hi SHB!

What I dont understand is, that you want to read a property which doesn't exist! Right? And the output found is "FALSE"? And you should get the at "Property Value" the default value. What is the default value of a property, which does not exist?
It is hard to understand your problem. Can please programm a VI where the error is reproducable, because without that, I cant look for a better solution!

Greetings, Mona
Ramona Lombardo
Applications Engineer, NI Germany
Certified LabVIEW Developer
0 Kudos
Message 2 of 7
(4,102 Views)
Hi Mona
 
In my project the test requirements often extend. That means that a new protocol contains more properties than an older one. If the program loads an old protocol it tries to read nonexistent properties.
There is an image attached showing how I read a property. The value returned when the property does not exist should be the default value of the data type (0 for numeric, empty string, ...). But for me the main problem is that the output Found is true instead of false sometimes.
 
Since I do not call the VI TDMS Read Property when the parent of the property does not exist, the error does not occur any more. I check the existence of the parent channel or group by seeking its name in the array returned by the VI TDMS List Content. I assume this is time consuming, but this is acceptable for my program. I look forward to hear better solutions of course.
 
I did not manage to create an example which shows my problem, sorry. TDMS Read Property always works correctly except in my real program. I suppose the program must exceed a certain size or any VI must be present or called several times.
 
Thanks
shb
0 Kudos
Message 3 of 7
(4,089 Views)
I have written a VI that reproduces the problem of getting a wrong value on a non-existing property (see attachment). Under a given set of circumstances what you get back is the value of the last property you successfully read before the non-existing one. Technically, this is a bug in LabVIEW. I filed a Corrective Action Reuqest (CAR 45EC5AWJ) for this. However, the workaround is very simple (see attachment).

I understand that you did not see any case in which the "found" boolean came back with an incorrect value. If that happens, I would highly appreciate if you could post it to this thread.

Hope that helps,
H. Engels
National Instruments
Download All
Message 4 of 7
(4,031 Views)
Great, thats really worth five stars.
In my application the property is read in a SubVI and not in a loop. But the effect is the same.
Extending your VI, I managed to reproduce the wrong value of "found". This happens when a property is read from a non-existing channel after a successful read. The example is attached.
I already use your workaround. Additionally there is checked if the parent group or channel exists.
 
Thank you very much indeed.
shb
 
Download All
Message 5 of 7
(4,018 Views)
Thank you very much for your help. These issues will be terminated. Robot Mad

Herbert
0 Kudos
Message 6 of 7
(3,997 Views)

It's too bad about the error is not one of those hundreds witch are corrected in LabVIEW 8.2.1. My test was negative.

I am waiting for 8.2.2.

Greetings

shb

0 Kudos
Message 7 of 7
(3,874 Views)