Jump to content

Grouping on the block diagram


Daklu

Recommended Posts

QUOTE(T_Schott @ Mar 5 2008, 02:34 PM)

Hi,

what about creating sub vis for each "block diagramm group"

making the code more readable ;)

-timo

Yeah, but this would be an extra option. I like the idea (I've never tried it, so I don't know if it's already possible or not)......

Just my 2c

Shane.

Link to comment

QUOTE(neB @ Mar 5 2008, 07:55 AM)

I don't think it would encourage bad coding style. I frequently wish for Grouping on the block diagram so I can move bits of code around together without doing a multi-step select-an-area-then-deselect-individual-items-that-I-don't-want-to-move gymnastic. There are plenty of times when I'd use that functionality to improve the layout of code. Besides, if LabVIEW is a graphical dataflow programming environment, and we have standard tools for Grouping on the front panel, why wouldn't we have the same tools on the block diagram?

I've often wondered, though, if there's some technical or usability reason why Grouping isn't available on the block diagram. It's reasonable to think that it's been explored at some point by NI. I'd be interested to know if there's an inside story behind it.

QUOTE(T_Schott @ Mar 5 2008, 06:34 AM)

what about creating sub vis for each "block diagramm group"making the code more readable
;)

There are scenarios where that isn't enough.

Example 1: Virtually every subVI I create has Error In/Error Out terminals, and an Error Case Structure surrounding the code of the subVI. I would really like to be able to group the Error In/Error Out terminals with their tunnels on the Case Structure, so that I can easily move them up or down. This is a routine I go through for almost every subVI I create.

Example 2: I might have a series of LVOOP class VIs that happen one after the other. In this case, I might not want to create a subVI containing methods from all those classes because it would (A) have a ton of terminals, and/or (B) create a subVI with a lot of class dependencies that I don't want.

Creating a subVI also won't work if the VIs you want to Group are located both inside and outside some structures, but you don't want the structure to be part of the group.

You're right, however, that creating a subVI is a solution some of the time.

Link to comment

QUOTE(neB @ Mar 5 2008, 09:55 AM)

Almost every feature can encourage bad coding style :)

QUOTE(neB @ Mar 5 2008, 09:55 AM)

What value do you see in this idea and how would you envision using it?

For exactly the same reason(s) I use it on the front panel - for convenience. I like to group related items, so I don't have to do the multiple-click-select. It'd also be useful to "attach" free text labels (ie: documentation) to code.

Link to comment

QUOTE(Justin Goeres @ Mar 5 2008, 10:11 AM)

I don't think it would encourage bad coding style. I frequently wish for Grouping on the block diagram so I can move bits of code around together without doing a multi-step select-an-area-then-deselect-individual-items-that-I-don't-want-to-move gymnastic. There are plenty of times when I'd use that functionality to improve the layout of code. Besides, if LabVIEW is a graphical dataflow programming environment, and we have standard tools for Grouping on the front panel, why wouldn't we have the same tools on the block diagram?

I've often wondered, though, if there's some technical or usability reason why Grouping isn't available on the block diagram. It's reasonable to think that it's been explored at some point by NI. I'd be interested to know if there's an inside story behind it.

Thanks. I can relate to the selection gymnastics issue.

Two technical complications come to mind.

1) If you open a diagram on a mahcine that is using a larger font that what you used at development time, the grouping would add extra work to clean-up since ...

2) Ctrl-shift-drag when performed inside a set of grouped objects would... A) deal with the group as a single object, or B) just blow-up the group?

Ben

Link to comment

QUOTE(Justin Goeres @ Mar 5 2008, 04:11 PM)

I don't think it would encourage bad coding style. I frequently wish for Grouping on the block diagram so I can move bits of code around together without doing a multi-step select-an-area-then-deselect-individual-items-that-I-don't-want-to-move gymnastic. There are plenty of times when I'd use that functionality to improve the layout of code. Besides, if LabVIEW is a graphical dataflow programming environment, and we have standard tools for Grouping on the front panel, why wouldn't we have the same tools on the block diagram?

I've often wondered, though, if there's some technical or usability reason why Grouping isn't available on the block diagram. It's reasonable to think that it's been explored at some point by NI. I'd be interested to know if there's an inside story behind it.

I agree (obviously judging by my previous response).

It's enivitable that, due to either space constraints or pure optical luxury, different "groups" of block diagram objects get to overlap. Moving that "group" is, as Justin says, a multi-step operation. We have a graphical language. The visual representation (orientation of objects) has a lot to do with understanding how the code works. We (I'm not quite sure who "we" are, but either way....) automatically group parts of code with similar functions visually on the BD, so why not lock their positions to each other? This allows us to pull the whole code section somewhere else without either destroying the arrangement or needing to do a multi-step move.

Another case I would like to address is inherited code..... I can imagine some cases in which code would have been MUCH easier to clean up if I had this tool available.

I also think it's something NI HAS tried. I too would be interested in knowing if this is even probable....

@Ben. I think as per normal usage, a group behaves as a single unit.

Shane.

Link to comment

QUOTE(T_Schott @ Mar 5 2008, 05:34 AM)

If I'm grouping a large number of components in which it makes logical sense to put in a sub vi that is definitely the way to go. Usually when I'm wishing for it I have a small number of components (~3-5) where adding a sub vi would add to the overall complexity of the project. For instance, in my current project I have a sub vi I use in several places. The output of the sub vi is usually immediately wired to an unbundle by name so I can get the data I need. For readability it makes sense to group the sub vi to the unbundle control to keep them aligned, but it makes no sense to create a series of sub vis for each unbundle combination I might need.

QUOTE(BobHamburger @ Mar 5 2008, 09:23 PM)

A little clever application of scripting could solve this issue. Sounds like a good code challenge.
:unsure:

*Ding* You're it! I'm looking forward to seeing what you come up with. :)

QUOTE

2) Ctrl-shift-drag when performed inside a set of grouped objects would... A) deal with the group as a single object, or B) just blow-up the group?

Ctrl-shift-drag makes a copy of whatever is selected. Selecting an item in a group selects the entire group. Therefore, ctrl-shift-drag copies the entire group, just like what happens on the front panel. (That's how I would deal with it anyway.)

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.