12-15-2011 10:29 AM
My vi has 6 graphs, and I need to modify them through property nodes through out my vi, so I wanted to store all the graph references into an array and pass it along. When I do that, I am getting a class conflict between my input array and array in cluster. They are both waveform Waveform Graph Refnum (strict), so I am not sure why there is a conflict. See attachment for additional info.
Solved! Go to Solution.
12-15-2011 10:55 AM
I'll generally use a cluster instead of an array so that I can access all of the properties but in your case...
Disconnect the broken wire, create an indicator from the output of the array build.
Copy it and go back and edit your type def and replace the arry with your new version. It should wire up after that.
Note:
In your sub-VI (if you stik with the array) you may have to cast the wire class (to more specific) to get at the properties you need.
Ben
12-15-2011 01:36 PM
It works. However, can you explain how using cluster will allow you to access "all" of the properties?
12-15-2011 01:55 PM
A cluster can be made up of objects of different types. Meanwhile for an array, the array elements must all be of the same type.
When you are dealing with the references to different classes of objects (even if the classes aren't dramatically different), the references are all typecast to a common class when they are built into an array. So you are only able to access the properties that are in common to all of those classes. Otherwise you need to cast a particular reference to a more specific class to get to a property that is a part of that class type, but not in the class types of the other objects built into the array.
Since a cluster can preserve the classes of all the different objects in it, you can just unbundle the reference and get to whatever properties it provides.
12-15-2011 01:58 PM
all elements of an array can differ only in value and must be exactly the same type of data in this case ref classes. WHen you build an array from diferent ref types LV find the common class shared by all elelements of the array and cast them all to that type. Extreme case... if you included a boolean in your array the only property you would find are visable and lable (may a fw more).
So by using a cluster each ref can be different and provided I coded it right be exactly the strict ref of the original and there allow me to access all of the properties associated with that class of control.
I hope that cleared up some confusion,
Ben
12-16-2011 09:27 AM
That make sense. In my case, I am just creating an array of waveform class property nodes, so that are all waveform specified.