From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unbundle an array of clusters

Solved!
Go to solution

Hello,

Im trying to figure out if it is possible to efficiently unbundle an array of clusters which contains about 20 elements without disassembling the array prior to unbundling the clusters.

 

Thank you,

Ran

0 Kudos
Message 1 of 15
(6,964 Views)

What is it you want to do?  What is your goal?  I assume you want to do something other than put your array into a For loop, and within the loop unbundle the Cluster, then reassemble on the way out.

 

Bob Schor

0 Kudos
Message 2 of 15
(6,929 Views)

@ran0 wrote:

Hello,

Im trying to figure out if it is possible to efficiently unbundle an array of clusters which contains about 20 elements without disassembling the array prior to unbundling the clusters.

 


You cannot "unbundle" an array of clusters, because it is an array, not a cluster. It would be interesting to know what you mean by "disassembling". Is the cluster of mixed datatype? What kind of data structure do you want at the end? (e.g. a cluster of 20 arrays? 20 individual arrays, one for each element? a N x 20 2D array? Just random access to a specific inner element? something else?)

 

I guess you figured out a way to do whatever you are trying to do, but you are worried about performance or efficiency. Is this correct? Do you have performance or memory problem? If so, what is the evidence? Can you show us your code? How big is the array of clusters?

 

Where does the data come from? If you feel that the data structure is not suitable for your use case, maybe you want to carry it as a different data structure from the beginning.

Message 3 of 15
(6,924 Views)

My guess is that you're looking for a function that is the complement of "Index & Bundle Cluster Array".

There's no built-in function for that, you just have to code it like this:

iub.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 4 of 15
(6,877 Views)
Solution
Accepted by topic author ran0

@paul_cardinale wrote:

 

There's no built-in function for that, you just have to code it like this:


Exactly 😄

0 Kudos
Message 5 of 15
(6,869 Views)

I asked this same question about a week or so ago.  Unfortunately, the answer is the same.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 15
(6,844 Views)

To make it clear

No


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 15
(6,834 Views)

Thank you all...

My aim is to record about 20 mixed datatypes in one giant array. I thought it would be better if i cluster them all together, per iteration, and unbundle by request only the datatype array i want.

Since it can't be done, i guess i'll work with multiple arrays, as easy as it could be at first place.

 

Once again, I thank you all.

Ran

0 Kudos
Message 8 of 15
(6,832 Views)

Here's a better solution.

Just drop "Index and Unbundle.xnode" onto the block diagram.

(To make it handy, add it to a palette.)

"If you weren't supposed to push it, it wouldn't be a button."
Message 9 of 15
(6,153 Views)

I just discovered that it gags when it comes across cluster elements with empty labels (but you're not supposed to do that anyway).

Here's the fix (it invents a name if it finds a blank one).

 

"If you weren't supposed to push it, it wouldn't be a button."
Message 10 of 15
(6,134 Views)