LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster Bundle/Unbundle Best Practice?

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?

ClusterBundle.jpg

0 Kudos
Message 1 of 8
(4,712 Views)

Not near a computer, but don't forget about the unbundle/bundle version of the IPE.

0 Kudos
Message 2 of 8
(4,654 Views)

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.

Message 3 of 8
(4,617 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 8
(4,547 Views)

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.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 8
(4,519 Views)

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

0 Kudos
Message 6 of 8
(4,511 Views)

True, using an IPE results in the Bundling action running as fast as putting the all the nested parts into one node.

0 Kudos
Message 7 of 8
(4,489 Views)

@pincpanter wrote:

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.


I always do one step, save.  Next step, save.  Especially when deleting items from a typedef'd enum.  Move item to bottom.  Save.  Delete item.  Save.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 8
(4,456 Views)