LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting clusters

Solved!
Go to solution

I've got two clusters with numerical elements:

1: a,b,c,d

2: a,b,e

Now, I want to convert the first cluster to the second one.

What is the best way to do this?

0 Kudos
Message 1 of 6
(2,663 Views)

Raggie,

 

This is a fine example of a question which will only generate more questions.

 

What is the relationship between elements c and d of cluster 1 and element e of cluster 2?  Without information about that relationship, it is impossible to answer your question.

 

Lynn

0 Kudos
Message 2 of 6
(2,659 Views)

I should have clarified that a bit more indeed.

The first cluster consists of 5 I32 numbers with label's a,b,c,d and e.

I'd like to create a new cluster (/convert this to a new cluster) with elements a,b and f (also I32), where a and b have the same value as in the first cluster and f depends on some other calculations.

0 Kudos
Message 3 of 6
(2,646 Views)
Solution
Accepted by topic author Raggie

Unbundle the data from Cluster 1, connect a and b to the corresponding elements on a Bundle for Cluster 2.  Connect the desired value to the f element on the Bundle.

 

Lynn

 

Clusters.png

0 Kudos
Message 4 of 6
(2,637 Views)

Ok, thank you

Is it also possible to do this with some kind of typecast?

0 Kudos
Message 5 of 6
(2,625 Views)

Typecast is used primarily to transform data from one type to another and does so by converting everything to a flattened string and then attempting to convert it to the new data type. It usually works best on data types which are closely related in terms of how the data is represented and stored in memory.  Even it you succeeded in doing this you would still need a Bundle primitive to put the value of f into Cluster2.

 

Lynn

0 Kudos
Message 6 of 6
(2,613 Views)