LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

?LabView Collections? -> Is dynamic unbundling of an N-dimensioned cluster possible?

I am hoping to create a sub-VI that takes a cluster of XY plots and dynamically unbundles them. I would not know up front how many XY plots have been bundled into the cluster. I would want to unbundle them one at a time regardless of how many and store them. Is this possible?

In C++ or VB I'd just use a collection. Is there something similar to a collection in LabView?

Thanks,
Steve
0 Kudos
Message 1 of 7
(3,368 Views)
If you have an array of waveform data in a cluster can't you just get the array size of the array. Or you can just wire the array to the left side of a for loop and the for loop will determine how many times to run based on the number of elements in the array. This will create an auto indexing terminal on the left side of the loop and each element will be peeled off during each iteration allowing you to manipulate it. I hope this helps if not could you post a brief example?
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 2 of 7
(3,354 Views)

@slacy wrote:
I am hoping to create a sub-VI that takes a cluster of XY plots and dynamically unbundles them. I would not know up front how many XY plots have been bundled into the cluster. I would want to unbundle them one at a time regardless of how many and store them. Is this possible?

In C++ or VB I'd just use a collection. Is there something similar to a collection in LabView?

Thanks,
Steve


Yes, it is possible by using variants, to dynamically handle arbitrary clusters. However, I think that an array of XY Plots would better suite your needs. If you have to start with a cluster, you can convert it to an array using the "Cluster to Array" node.

-Jim
0 Kudos
Message 3 of 7
(3,353 Views)
Steve,

The first thing that comes to mind is to convert the cluster to an array using the 'Cluster to Array' function from the Array or Cluster palette. The resulting array would contain an element for each item in the cluster.

The array could then be processed in a For or While loop using auto indexing so it wouldn't matter how many items you start with.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 4 of 7
(3,347 Views)
OK. Thanks for the responses. I'm still stumped on how to create the front panel. I tried to create an array control and drop a XY graph in it, but it doesn't seem to like that. I also tried to drop a XY graph into a cluster control and that was fine, but wouldn't I have to know how many XY graphs are coming in and put one graph for each coming in? Basically whether it is a cluster or an array of arrays I don't care, but I won't know how many are inside the cluster or array...how do I setup the front panel of my sub VI to handle that?
0 Kudos
Message 5 of 7
(3,340 Views)
Try looking at this example. hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 6 of 7
(3,333 Views)
That's right, an XY graph is a type of array, and you can't have an array of arrays. But you can have an array of clusters that contain arrays. So what you need do is put a single XY graph in a cluster container, then put that into an array container.

Then to pass this to a suVI, you just need a copy of this array of clustered graphs as a control on the front panel. It won't matter how many elements are in the array.

Hope that made sense.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 7 of 7
(3,330 Views)