NI Home > Community > NI Discussion Forums
Announcements
We've turned on a search before post feature in the LabVIEW Idea Exchange. This new feature will help cut down on the number of duplicate ideas in this space!

The NI Idea Exchange is a product feedback forum where NI R&D and users work together to submit ideas, collaborate on their development, and vote for the ones they like best. View all of the NI Idea Exchanges to post an idea or add your opinion on an existing one today!
JackDunaway

Eliminate Typedef Explosion on Block Diagram

Status: New
by Trusted Enthusiast on ‎06-04-2009 10:01 AM

Who has ever made a cluster typedef, then added some elements, then added more, then a little more? Have you noticed the "typedef explosion" of your block diagram as a result, with constants overlapping other code? Make a right-click option to "link" a bundle by name to a typedef. Note that the two pieces of code below would be identical, but the bundle on left would not suffer from typedef explosion. In addition, have a selectable menu

LinkToTypedef.png

 

Another idea is to link the bundle to the destination:

 

LinkToDestination.png

 

 

Comments
by Trusted Enthusiast on ‎06-04-2009 10:02 AM
Edit: For the picture on top, the bundle on the RIGHT (not left) would not suffer from typedef explosion.
by Member hfettig on ‎06-04-2009 01:31 PM

Personally I don't like the idea of 'linking' to a type def since it would be hard to no which type def you are linked to.

 

However, I do hate the 'explosions' as well, especially if you have painfully auto arranged all the clusters in the typedef to be horizontal and when you make a change to the type def (don't even have to add an item) it defaults back to vertical arrangement.

 

You can get around that and the amount of space that they take up by selecting the constant and creating a SubVI for it. That way you can give it a nice icon,and if you set the VI properties to re-entrant/pre-allocate you can use it multiple times and set you constant values in the subVI.

This is a little time consuming so I only do it for really large clusters but if that functionality could be automated it would be perfect.

by Trusted Enthusiast on ‎06-04-2009 01:50 PM
hfettig, Creating a slim subVI that only has one output as the typedef... that's what I do now for HMI work. If that subVI had an "inline" execution priority (i.e., no hit for subVI overhead for mem allocations into and out of the call), then it would be a perfect solution! However, this solution suffers from performance loss in high-speed RT apps. Here's an idea! Make the functional equivalent of the marriage of your idea and mine. Make a second menu item right under "Link to Typedef" and call it "Open Initialized Typedef". That way you could open up a separate BD with values you can initialize, but it is compiled inline with the parent VI so you don't see performance loss. What do you think? Regards, Jack
by Member Lavezza on ‎06-05-2009 03:19 PM
I'd be happy if there was just an option to show typedef's on the block diagram as their icon instead of the actual control. There is already an icon for the typedef, let us use it.
by Knight of NI on ‎06-07-2009 05:38 AM
The main issue with using the icon is the values. If you change the values in the constant, this will be hidden. Maybe NI needs to mandate that an icon constant always has the cluster's default values. Another alternative is the one already suggested, where double clicking the icon opens an editor window for changing its values.
by Trusted Enthusiast on ‎06-12-2009 10:40 PM

I think Lavezza has the most elegant solution yet - better than my original proposal. The icon would feed the "input cluster" terminal of the unbundle, and the icon would compile down as efficiently as a BD constant.

 

Double clicking on the icon would bring up the editor window that allows editing of the constants. This way, each icon could have its own initialization, not just the default values for the cluster.

 

tst - true, the initial values would be hidden. Let's say hovering over the icon would bring up the initial values in Context Help. I would rather live with this than Typedef Explosion.

by Active Participant LabBEAN on ‎07-07-2009 12:35 PM

We just need a way to take CTL file default values OR provide custom values values (maybe a right click option with check mark) when this is implemented.  In any case, we're talking about gaining since a developer can still revert to the old method when applicable.

 

This could be implemented well along with Add block diagram design for typedefs.

by Member jdunham on ‎07-10-2009 02:11 PM
I would love to see the icon rather than the data elements.  I also recommend against ever changing the cluster constant's contents if it is a typedef, because if you ever change the typedef, you won't know that instance has changed, until the bug comes to light.  The icon could also have a special border if it contained non-default data.  There is already something subtle like that for lvclasses.
by Member JICHFI on ‎08-20-2009 08:19 AM

I also use the subvi idea, it's okay for huge clusters but takes time to create.

 

I dont think it's possible to adapt to a polymorphic destination.

by Member Garvacious on ‎09-26-2009 11:12 AM
I have been wishing for a feature like this for a long time.  Regardless of whether you make a typedef for the cluster, it would be nice to be able to "embed" the cluster constant into a Bundle By Name function just by dragging it into the Bundle By Name.  I cant count the number of times I have a big cluster condtant wired into the Bundle By Name and have to "shrink" it on the block diagram to avoid taking up lots of space.  Then of course if I add to the cluster it "explodes" again.  Its just annoying, the amount of BD space a simple Bundle function needs to take up becuase of this.  I like the idea of making the constant a subvi but it is an extra step that takes time- the drag and drop Bundle definition would be simple and fast.
Latest LabVIEW Idea Exchange Blog Posts
About LabVIEW Idea Exchange

Have a LabVIEW Idea?

  1. Browse by label or search in the LabVIEW Idea Exchange to see if your idea has previously been submitted. If your idea exists be sure to vote for the idea by giving it kudos to indicate your approval!
  2. If your idea has not been submitted click Post New Idea to submit a product idea to the LabVIEW Idea Exchange. Be sure to submit a separate post for each idea.
  3. Watch as the community gives your idea kudos and adds their input.
  4. As NI R&D considers the idea, they will change the idea status.
  5. Give kudos to other ideas that you would like to see in a future version of LabVIEW!
Idea Statuses
Top Kudoed Authors