LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

index & bundle cluster array VS build array.

I have a attached an LV in 6.0. It has an index & bundle cluster array. I want to change it to build array. However this causes errors. What's the difference between index & bundle cluster array AND build array?
0 Kudos
Message 1 of 6
(5,464 Views)

You really should learn how to find these things out for yourself.

In this case, you have 2 options:

You should start by right clicking the Index & Bundle Cluster Array and selecting Help to read the description for the function. You should also use the context help (ctrl+h) for more immediate help. These will explain what the function does.

The second thing to do is to build a quick example to see what happens. Simply wire 2 1D arrays into Index & Bundle Cluster Array and into Build Array and see the difference in the results to understand what each function does.

Another important thing is to try and understand the error. The errors almost always have a description which should help you understand. In this case, opening the context help, hovering over the broken wire and\or clicking the run button and selecting the error will show you the type of the wire and tell you what the target expects, so you can know how to fix it.
If, for example, it tells you that you have a 1D array on one side and a 2D array on the other, you need to add another dimension or remove 1 dimension (Build Array and Index Array).

These should help you find out how LV works and what the different functions do on your own.

In this case, you can see that Index & Bundle... takes the 1D arrays and creates an array where each element is a cluster built from the elements of the different arrays which have the same index.

Build Array simply builds an array.


___________________
Try to take over the world!
Message 2 of 6
(5,462 Views)
I have attached my own "traing VI". Would it be better if I use index and bundle cluster array ALL the time and forget about the "build array". Would that be wise?
0 Kudos
Message 3 of 6
(5,455 Views)

To be honest, I never actually used Index & Bundle. It looks like it could be useful when using multiplot graphs. Basically, it does the same thing as auto-indexing the 2 arrays into a for loop, wiring the data into a bundle and auto-indexing the result out of the for loop, and almost certainly does this more efficiently..


labview1958 wrote:
Would it be better if I use index and bundle cluster array ALL the time and forget about the "build array". Would that be wise?

Should you eat only apples and forget about oranges?

You shouldn't mix the two. You should use arrays where you need arrays and clusters where you need clusters. Forgetting about Build Array is not wise, because arrays are usually used much more than clusters. Arrays have the same data type and can be enlarged and clusters can hold different data types and are static. Each has advantages and disadvantages.

You should use Index & Bundle only when you need to build a cluster array in the same way that you should use the multiply function only when you want to multiply things. Each function has its use and its up to you to decide when to use what.


___________________
Try to take over the world!
Message 4 of 6
(5,453 Views)
If I have two variables X & Y and I need to plot y against x, I can only use index and build array. I cannot use build array. Is this statement correct? This is because I need a XY graph which can only be wired to index and build array and not wired to build array.
0 Kudos
Message 5 of 6
(5,440 Views)
You can use Build Array, but you will have to have a Bundle node for each XY pair and wire all those Bundles into the Build Array. A more elegant approach is the one I described earlier (auto indexing for loop with bundle inside) and the most elegant is Index & Bundle.

___________________
Try to take over the world!
Message 6 of 6
(5,430 Views)