Tuesday, August 05, 2008

Automatic Block Diagram Clean Up, One of the New Features of LabVIEW 8.6

"Clean up diagram" has changed the way I use LabVIEW.

After years of learning to keep my diagram tidy as I develop it, I now find that I can concentrate solely on functionality and click a button (or use the ctrl-U keyboard shortcut) whenever things get messy. LabVIEW rearranges everything: nodes, structures, wires, etc. I also use it right before I save my VI. It's fast. It's easy. It's really slick.

Of course, it's not a complete panacea. So far, I use it only on "leaf-level" subVIs because I often have design patterns in my higher level VIs that I want in a particular layout. For example, I like having my producer loop above my consumer loop and automatic cleanup sometimes flips them around.

My one complaint with the first release of this feature is that diagram items that don't participate in data flow get "pushed out" to the edge. That means free labels get pushed to the side instead of staying near the code they comment. This is another reason why I tend to use block diagram cleanup on smaller subVIs, because they're likely to have only a single comment for the whole diagram.

Here are the questions I anticipate many will ask about this feature:

Q: Is it fast?
A: Yes, I've been impressed with how quickly it cleans up diagrams.

Q: Can I undo?
A: Yes. If you don't like the results, you can undo the block diagram cleanup with one Ctrl-Z.

Q: Can I tweak the parameters?
A: Yes. Look in Tools>>Options under Block Diagram: Cleanup.

Q: Can I clean up a portion of my diagram automatically?
A: No. It operates on the entire diagram, not a selection.

I don't think any description of this feature can really do it justice. I encourage you to get a copy of LabVIEW 8.6 and try it out for yourself!



Blogger Ancle said...

Hello Christina,
1.Why don't have "Clean Up Front Panel"?
2.I checked Tools>>Options...Bolck Diagram::Cleanup,"Move controls to the left of the containing diagram" and ","Move indicators to the right of the containing diagram" it doesn't work. Am I wrong?

4:08 AM, August 06, 2008  
Blogger Christina said...

Hi Ancle,
No clean up front panel yet. It's certainly something we're thinking about though! But that wouldn't help much with panels that people need to operate since I don't think there's any way to automate usability design.

I haven't played with the clean up options yet, but I'll write again when I learn more about them.

Thanks for the questions!
- Christina

2:41 PM, August 06, 2008  
Blogger Christina said...

I researched the options you asked about. Those change the way LabVIEW positions front panel terminals inside containing structures such as loops. When off, the fpterms cascade with the dataflow they're wired to. When on, the fpterms move near the edge of the structure. I'll post a picture later (I'm writing this from my iPhone).

5:22 PM, August 06, 2008  
Blogger Christina said...

Here's an illustration of the "Move controls/indicators to the left/right of the containing diagram" options: the original VI, the results of block diagram clean up with the options off, and with the options on.

7:52 PM, August 06, 2008  
Anonymous Omar said...

Useful article Christina. As your part of LabVIEW R&D I thought I'd post my feedback.
I'm currently evaluating whether my company should upgrade our copy of LabVIEW to 8.6, and the clean up feature is primarily what we are looking at as cleaning up code takes a fair proportion of development time. Since you can't tell it to clean up only a portion of code, and therefore for one example it stuffs up all your commenting, I think it might be better for us to wait until that feature is available. Hopefully you'll decide to put it into 8.7

11:54 PM, December 11, 2008  
Blogger Christina said...

Hi Omar,

Thanks for your feedback. I, too, would like to be able to clean up portions of my code. I'll keep you posted if/when we release that as a feature!

3:45 PM, January 05, 2009  

Post a Comment

<< Home