LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph control reference array conflict

Solved!
Go to solution

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.

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 6
(3,921 Views)
Solution
Accepted by topic author jyang72211

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 6
(3,914 Views)

It works.  However, can you explain how using cluster will allow you to access "all" of the properties?  

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 6
(3,903 Views)

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.

Message 4 of 6
(3,897 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 6
(3,896 Views)

That make sense.  In my case, I am just creating an array of waveform class property nodes, so that are all waveform specified.

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 6 of 6
(3,885 Views)