LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
EngrStudent

Very simple improvement on Block diagram clean up OPTIONS

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.

Background:

I am moving from MatLab/R to LabVIEW and the "documentation of blocks" is a challenge.  I have resorted to single panes of flat sequences to group and retain relationships that define an element of function.  

Capture.PNG

My goal there is entirely to partially resist the confusing effect of "clean up" on these elements of function.  I can then justify and more completely describe using labels for the components and the "documentation" for the sequence chunk.  

 

Suggestion:

If you look at the above diagram, the wires overlap the label text.  Can you make an option that allows the label text to not be obscured?

 

 

18 Comments
jcarmody
Trusted Enthusiast

You can color the background of the label to match the Block Diagram.

snip.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

EngrStudent
Active Participant

The label text is not related to the wire.  It is related to the box.  I would prefer to run the wires around the annotations, and not under them.  

 

This is a great interim suggestion though.  I am going to do it right now.  Thank you.

X.
Trusted Enthusiast
Trusted Enthusiast

If you are coming from a text based language, you will have to get used to a very different set of programming habits.

You will have first to go over your resistance to creating subVIs out of those sprawling spaghetti bowls.

It is not always possible to do so when you are performing some complex data manipulation on large data structures, but anything that takes a ridiculous amount of space to do something relatively trivial and not memory expensive/time critical should be "abbreviated" into a subVI.

The advantage is that the icon (e.g. 4 words) can be self-documenting.

Last word of advice: ignore the "diagram cleanup" function. I call it a weapon of mass diagram disruption (WMDD) and never use it, except when I want to get a good laugh about the carnage that ensues... thanks to undo, this is harmless fun.

EngrStudent
Active Participant

@X - I have several big problems with the "sub-VI" the first of which is a quote from Don Knuth: "premature optimization is the root of all evil (or at least most of it) in programming.".  To turn something from a diagram into a sub-vi is an act of optimization of the visual layout.  That doesn't mean as much unless your language is highly visual layout centric.

 

The second is that I need to make sure all the parts of my spaghetti bowl are working as they should before I start turning them into "chunks".  

 

The third is that it can be really hard to undo the process.  While the undo WMDD works within a turn or two - undoing a "turn to vi" after time has passed can be an exercise in ... futility/humility/expense.

crossrulz
Knight of NI

EngrStudent: That is some of the worst advice you could have gotten.  Trust me and my decade+ of experience.  Breaking up your problem into chucks from the beginning makes it simpler, faster, and with less bugs.  Yes, I have done the mega diagrams and it is HORRIBLE to work with.  I have adapted much and am much happier having modularity.  You suddenly do not have a bowl of spaghetti, but a nice simple lasagna.

 

Now, as far as this idea...Yes, it annoys me that the labels on structures are not taken into account when it comes to the "clean wiring".  This even bugs me when I just try to do a "cleanup wire".


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
AristosQueue (NI)
NI Employee (retired)

crossrulz: he's coming from a MScript background -- an interpreted environment where modularity is more free form. That changes priorities somewhat.

RavensFan
Knight of NI

What version of LabVIEW are  you using?  Is it one of the more recent versions?

 

Instead of showing the label, make the subdiagram label visible.  It puts the label inside the top of the flat sequence structure rather than outside the structure.

X.
Trusted Enthusiast
Trusted Enthusiast

@crossrulz: I would argue that VIs are more like raviolis than lasagnas (not mentioning the fact that they contain the two letters VI).

 

@OP: as I said, it takes some drowning in spaghetti code to "get" the virtues of subVIs.

Manzolli
Active Participant

Clean Up Diagram tool is not as smart as we desire, true. But is not that bad as X said. There are two situations that I use it and works fine:

 

1) When I start a new VI, that I know lots of steps right away, my hands are slower than my brain. Then I place all stuff anywhere, connect things with no care (right but messy). Then I use the "Clean Up Diagram" tool. Normally, a Little additional work is necessary to get things in the way I want.

 

2) I need to organize a small portion of the code. I select the code and use the "Clean Up Diagram" tool. Most of the time no extra work is necessary for me, since I use it with very few elements.

 

Labels: you can move the labels (messed up by Clean Up Diagram tool) to left and right of the controls and indicators using the Quick Drop shortcut [Ctrl] + [T]

 

Far from perfect, but helpful in some situations. Smiley Wink

André Manzolli

Mechanical Engineer
Certified LabVIEW Developer - CLD
LabVIEW Champion
Curitiba - PR - Brazil
EngrStudent
Active Participant

Team,

 

I spoke offline with folks here.  

 

My current approach allows some extremely complex VI's to be cleaned up with only positive benefits.  It retains critical structure while allowing auto-routing and optimization.  It also (nicely) stages for transition of chunks of code into sub-vi's after the code is mature.  

 

I put single frames of Flat sequence structure of known "chunks".  I route only required inputs into the box.  I only group if the outputs are coupled.  I only use single frames - not two.  I can nest them, but I don't make the sequence.  (see appended image)

 

What this does:

  • I can clean up huge vi's 
  • I the clean-up and auto-routing actually helps inform selection of components for sub-vi.

 

What this doesn't:

  • I don't lose local visual structure
  • I don't lose optimization.  The folks I spoke with say this has effectively zero effect on run-speed.

 Regards.

 

 

Capture.PNG