Jump to content

Unbundle Cluster Array


Recommended Posts

One issue: for some reason, when I open the project, LabVIEW opens 4 new (untitled) VIs while the project loads. Other projects don't do this. Any ideas?

I get this behavior randomly on some project files - and I think only for LabVIEW 2010, not 8.6.1. I've never managed to track down why it happens, or how to cause it or prevent it.

Link to comment

I saw the random multiple untitled VIs as well.

One thing I noticed is this doesn't seem to work with arrays, but if it did I could see some issues with it. What I mean is I have an array of a cluster, and in that cluster is a 1-D array of strings labeled "ArrayString". When I use the Xnode on this data type it recognizes that I have an item named "ArrayString" but according to its output the data type is a Void. In a perfect world I would expect it to output a 2-D array of String where each row is the 1D array found in the cluster.

To be fair it isn't often that I have an array of string, inside a cluster inside an array, this was just a test to see how well the Xnode did what I expected. It of course did work with a 1-D array of string, inside a cluster, inside a cluster, inside an array. Here the output was an array of a cluster with one item which was the 1-D array of a string.

Link to comment

^

That could cause some problems though... if the arrays in each of your clusters are of different lengths, putting it all in a 2D array would add some unwanted padding.

Good point. An easy (but still limited) workaround would be to accept a value to pad arrays with. There's no great fix that sticks out to me, maybe something I'll play with later.

Link to comment

I saw the random multiple untitled VIs as well.

So does anyone have any idea why these come up in recent versions of LabVIEW only (or not in 8.6 in any case)?

One thing I noticed is this doesn't seem to work with arrays, but if it did I could see some issues with it. What I mean is I have an array of a cluster, and in that cluster is a 1-D array of strings labeled "ArrayString". When I use the Xnode on this data type it recognizes that I have an item named "ArrayString" but according to its output the data type is a Void. In a perfect world I would expect it to output a 2-D array of String where each row is the 1D array found in the cluster.

Nice spotting - I hadn't checked for that. Here's a new version which seems to cope with arrays (of any dimension) inside the ClusterArray. It does just pad with the default value, same as auto-building any multi-dimensional array.

post-3889-0-99787700-1311285853_thumb.pn

There do still seem to be other bugs that arise when the ClusterArray is changed after wiring some outputs. It would probably need a more sophisticated system of keeping track of element names in order to handle this properly.

Unbundle Cluster Array v1.1.zip

Edited by GregSands
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.