Popular Post GregSands Posted July 13, 2011 Popular Post Report Share Posted July 13, 2011 (edited) I've had a few evenings to work on another XNode, this time to unbundle an array of elements from a Cluster Array (as per this Idea). As much as possible, I've tried to mimic the functionality of Unbundle Cluster by Name. There were a few tricky things to get this to work, and I'd be interested if I missed an easy way to achieve any of them: traversing a cluster hierarchy to build the pop-up menu not permitting the XNode to be shrunk past any connected wires correctly wiring outputs again if the XNode is extended upwards Comments welcome! Requires: LabVIEW >8.6.1 Gavin Burnell's Scripting Tools (thanks again!) OpenG LabVIEW Data and String Libraries Unbundle Cluster Array.zip Edited July 13, 2011 by GregSands 7 Quote Link to comment
John Lokanis Posted July 13, 2011 Report Share Posted July 13, 2011 Pretty cool. Wondering how to integrate this into the IDE... 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? Quote Link to comment
GregSands Posted July 13, 2011 Author Report Share Posted July 13, 2011 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. Quote Link to comment
hooovahh Posted July 21, 2011 Report Share Posted July 21, 2011 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. Quote Link to comment
Samapico Posted July 21, 2011 Report Share Posted July 21, 2011 ^ 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. Quote Link to comment
asbo Posted July 21, 2011 Report Share Posted July 21, 2011 ^ 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. Quote Link to comment
GregSands Posted July 21, 2011 Author Report Share Posted July 21, 2011 (edited) 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. 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 July 21, 2011 by GregSands Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.