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: 

Cluster of Array

Hi,

If I recieve an array of an unkown size from my analog input reading (unkown size) and I want to section this array into small arrays of size 60 until no more arrays of size 60 are left. 

For example if I have an array of 124 elements, I want two arrays of the first 60 elements and then the next 60 elements. 

I also want to display these arrays in an overlaid graph which may require bundling these arrays into a cluster. 

Is there a way to save the arrays or saving these arrays into a cluster of arrays. I'm not very familiar working with clusters so I don't really know how to append or index clusters of arrays. 

Thanks! 

0 Kudos
Message 1 of 4
(2,180 Views)

What you're basically asking for is dynamic creation of clusters (by changing the number of elements in one), which you cannot do at runtime. I would suggest to use a 2D array, since you can use the Reshape Array function to change the shape of your 1D array into a 2D array in which you have 60 rows and N columns (or vice-versa), depending on your eventual needs. A 2D array can be wired directly to a graph to draw multiple plots.

Message 2 of 4
(2,176 Views)

2D Array:

+ Very suitable for future computations on the data. High scalability.

- Each packaga (aka row) has to have an equal number of values. So there will be samples removed (128 => 2*60 + 8, the last 8 samples are therefore discarded)

 

Bundle (aka create cluster during runtime):

+ Can handle different package sizes

- Some effort necessary for future computations. No scalability (adding new elements to the cluster is not possible as smercurio states).

- Naming of the cluster elements is done by passing named elements. So the packages should/must have proper names for the cluster to be readable.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 4
(2,172 Views)

Thanks so much! I used the 2D array and it seems to work. 
I accidentally put down that I wanted to display as overlaid plots but it would be better if they were stacked plots. Is it possible to change the plot from the 2D array to this or to have separate waveform graphs for each column or row of the 2D array (if the number of plots is unknown) 

0 Kudos
Message 4 of 4
(2,140 Views)