12-19-2019 10:31 PM
I’m wondering if there is a best practice concerning the Bundle/Unbundle by Name for nested clusters. For the action, I have the two example below I’m thinking about for both the Unbundle (left) and the Bundle (right). Most of the time, I have gone with the visually simple lower methods, just using a single node to perform the action.
I’ve seen others go with the top version.
In benchmarking both versions, there doesn’t seem to be much a difference in the unbundle operation, but almost a twice the time in the Bundle operation, which may make sense with all the memory copies being made.
But something recently happening to me to make me wonder if breaking the unbundle into cluster level sections make sense. I added a copy of a subcluster (original named DataB) to the larger Orange cluster. Named the new one DataA, and made it the first control (0) in the Orange cluster. I found that in a few unbundle by name functions I already had in the code with “Orange.DataB.Numeric” LabVIEW had gone and changed them to “Orange.DataA.Numeric”. The new subcluster’s name. I found when errors popped up in parts of the code that I did not think I had touched. And changed them back to “Orange.DataB.Numeric”.
I don’t remember seeing that happen in 20 years. But I’m wondering if making the best practice of an unbundle operation the one where I do it in steps. I think it might prevent LabVIEW from changing the code again in the situation I had. I’ll stick with the single Bundle operation because it takes too large a relative time hit.
What do people think?
12-20-2019 12:40 AM
Not near a computer, but don't forget about the unbundle/bundle version of the IPE.
12-20-2019 03:16 AM
I'd definitely prefer the bottom solution. Less is more.
I don't use much clusters anymore, but of course classes are nearly the same discussion when it comes to (un)bundling.
I use IPES as well to unbundle the class data. Not for efficiency, but because it sometimes simply looks cleaner.
There's also the option to hide long names. So "Orange.DataB.Numeric" would read "Numeric". I use that when it's obvious and the long names are too long. This adds a flavor.
About the problem; That is disturbing. I suspect that over the past 20 years I learned how to avoid problems like that. Sadly, not consciously of course.
12-20-2019 07:18 AM
Changing order in a cluster (as in adding elements anywhere except at the end) often causes problems. If the items isn't in the memory at the time it often defaults to the same integer/position and not the name.
/Y
12-20-2019 08:46 AM
Renaming or adding a control and reordering at the same time is too much for LabVIEW.
After I was bitten a few times by this problem, I always do changes in steps: rename (or add) and save all related vi's. Then reorder and save again.
12-20-2019 09:05 AM
I use IPES as well to unbundle the class data. Not for efficiency, but because it sometimes simply looks cleaner.
+1 I do the same thing.
mcduff