LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove 2nd cluster from another cluster

Solved!
Go to solution
I am trying to inspect a wire, and if it contains a cluster, then pull the cluster out and process it separately from the initial cluster.  Help on this would be greatly appreciated.
0 Kudos
Message 1 of 13
(3,553 Views)
you can use an unbundle function in order to unnbundle the cluster
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 2 of 13
(3,550 Views)
I was looking to do this automatically, with the 'scan from file' function or something like that.  I just tried to put an equals comparison function wired to a cluster constant to check, but then I have to have identical clusters to compare and I don't always know how big or what the internal cluster will be comprised of. 
0 Kudos
Message 3 of 13
(3,518 Views)

If you use a reference, you can try to type cast it to a cluster. If no error is thrown, it is a cluster and you can use the property ClusterElem (?) to get each element.

 

Felix 

0 Kudos
Message 4 of 13
(3,505 Views)

I'm sorry, but your new reply doesn't make any sense to me.  What does "scan from file" have to do with it?  Are you working with files?  What do you mean by you don't know what the internal cluster will be comprised of?  If you defined the cluster, then you know what is in that cluster.

 

Let's step back and look at the big picture.  What is it exactly you are trying to do?  Perhaps you can post a VI with an example of your clusters.  Somehow I think the questions you are asking aren't going to be able to help you figure out what you really want to do.

0 Kudos
Message 5 of 13
(3,499 Views)

F. Schubert wrote:

If you use a reference, you can try to type cast it to a cluster. If no error is thrown, it is a cluster and you can use the property ClusterElem (?) to get each element.

 

Felix 


 

And if you like the idea Felix mentioned you may want to review this Nugget on using control references when the data type is not known. It includes this image

 

 

 

 

 

 that illustrates the first step Felix mentioned.

 

 

Have fun,

 

Ben

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

After stepping back and looking at the bigger picture, ...I first want to pull an array of data from a cluster, send the appended cluster to a vi that pulls the names and values out, then process the data array differently.  This is the base action that I want to do, and then if there is another cluster in the first cluster I was looking to pull it out and deal with it like I first requested. 

 

Attached is an example of what I am trying to do.

 

Much thanks,

 

  Vince

 

0 Kudos
Message 7 of 13
(3,454 Views)
Solution
Accepted by topic author _vbolling

_Vince wrote:

After stepping back and looking at the bigger picture, ...I first want to pull an array of data from a cluster, send the appended cluster to a vi that pulls the names and values out, then process the data array differently.  This is the base action that I want to do, and then if there is another cluster in the first cluster I was looking to pull it out and deal with it like I first requested. 

 

Attached is an example of what I am trying to do.

 

Much thanks,

 

  Vince

 


 

You were sooo close.

 

To_More_Specific.PNG 

 

 

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 13
(3,439 Views)

Gosh Ben--thanks for the quick reply,

 

But I get error 1057 from the 'more specific class' inside the for loop.  My 'class specifier constant' does not have the braided look to it.  It is the Generic>GObject>Control>Array, is that correct?

 

Thanks again,

 

  Vince

0 Kudos
Message 9 of 13
(3,429 Views)

Ignore the "braid" that is because I have the option set to show constant folding.

 

On the front panel right click the Array INSIDE the cluster and create a reference for the array only. Use that ref for the final "To more Specific".

 

Post your code if that does not work so someone can take a closer look.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 13
(3,427 Views)