LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster values differ from property node value

Hi,
I stumbled upon a quite odd case of Cluster values. I have a control "strict type def" which i insert into a VI. If i use the control normally ie. to flatten XML to string format the control gets me a zero value. Somehow the control has 2 sub clusters and i just have 1 subcluster. If i instead take the property node from the cluster and put it as input and output i will get the right answers.
Maybe it's a "feature" for the control, but i feel that it's quite weird. If someone could explain why this is what it is.
Download All
0 Kudos
Message 1 of 3
(2,754 Views)
I was not able to replicate your issue. I created a dummy strict typdef control, set some values, and wrote it out to an XML file. Then, I read in the XML using both of your methods, and each time got the correct values. Using 8.20. Is there a difference in the context help? Yes, but it didn't change the datatype. I think it's more of the way NI chose to display a strict typedef cluster in the context help. To be honest, I never actually noticed it.
0 Kudos
Message 2 of 3
(2,732 Views)

It is my experience that if you read a value property of a strict typedef, you are no longer dealing with a typedef. (Maybe that is expected, because you only want the "values"?)

Use local variables of the control instead of value properties to stay with the strict datatype but it should not be necessary.

One giveaway is the coercion dot on the right property node in one case. Why don't you wire the error out of "Unflatten from XML"? Maybe it wants to tell you something useful. 😉

Maybe something is wrong with the XML code. DIsplay the XML string in a text indicator to see what's in it. What is your LabVIEW version?

 

Still all methods should give you the same result. For example in the following code (Cluster is a strict typedef!), all outputs will show te same values, despite coercion, etc. It also does not matter if I flatten the typedef or the value property to XML. All clusters are the same. The extra level you see when hovering over a strict typedef wire is just for display purpose. It does not indicate a "deeper" cluster.

 

Message Edited by altenbach on 05-25-2007 07:51 AM

Message 3 of 3
(2,726 Views)