LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 12/21/2009

For the past few months I've been working on a rather large-scale project in which I am using block diagram cleanup as the only mechanism to arrange my diagrams.  You can read more about my adventure in the two blog posts I have written about it so far:

 

The Diagram Cleanup Experiment

Progress Report #1

 

One thing I've noticed in LabVIEW 2009 (that I don't believe was present in LabVIEW 8.6) is that diagram cleanup tries to respect the positioning of comments.  If you have a free label in close proximity to wires or nodes, diagram cleanup tries to keep that proximity intact after a cleanup.  Unfortunately, it doesn't always work, and your free label will sometimes move somewhere far away from the code it was trying to document.  One technique I've used to combat this repositioning is to use the labels of nodes instead of free labels.  By choosing Visible Items > Label on a diagram node, and entering your text there, you are ensuring that the node comment will stay close to the node even after a cleanup.

 

And if your next question was going to be, "But how do we do the same for wires?", then go kudo this idea🙂

Message 1 of 5
(5,388 Views)

Yes I do this all the time.

But it only works for LabVIEW native nodes and not for sub VIs 

Only if we could do this for created sub VIs

 

See

http://forums.ni.com/ni/board/message?board.id=170&thread.id=417585

 

Omar
0 Kudos
Message 2 of 5
(5,336 Views)

My diagrams are build clean from the ground up and a cleanup operation only makes them worse. 😉 However, the cleanup button is absolutely essential when trying to decipher horrible code posted here in the forum. A quick cleanup as a first step often really helps to make sense out of the mess. 🙂


Darren wrote:

One technique I've used to combat this repositioning is to use the labels of nodes instead of free labels. 


You say "nodes", I actually say "structures". I often use e.g. labels of FOR loops to indicate what they are looping over (e.g. "Loop over all blue sites"), case structures what they are selecting, or event structures ("Main UI even structure"), etc.

0 Kudos
Message 3 of 5
(5,302 Views)
To each his/her own, I guess. I tried using diagram cleanup tool but it just seems to make a mess of things by my standards. Besides, while one half of my brain is cleaning up code the other half is thinking about what I'm going to code next.
PaulG.
Retired
0 Kudos
Message 4 of 5
(5,260 Views)
I have found that if you select a case structure and clean it up by itself, the case is small. Then if you right-click on it and disable cleanup on that case structure, then cleanup the next outer loop, the inner one stays tight. Then you can progressivly cleanup your code without so much sprawl.
0 Kudos
Message 5 of 5
(4,850 Views)