LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Common behaviors among LabVIEW Developers


crossrulz escreveu:

 


No.  It is a trick to help the "Cleanup Wire".  If you right-click on a wire, you will see an option to cleanup the wire.  A little bit of space helps that.  The full Diagram Cleanup tool messes everything up.


Ohh.. Sorry, I misunderstood your statement. CTRL+U is currently a mess.

Mondoni
0 Kudos
Message 21 of 36
(853 Views)

Akiel escreveu:

I very rarely get good results with the cleanup tool, cleanup wire sometimes works well (ctrl-z is invaluable when using it tho) I find thinking about the layout as I program gives good layout instead of throwing it down getting it working then wondering where to start on the tidy up. Also good comments are the way forward so in six months time you (or someone else) knows what is supposed to be happening


 

Hello Akiel, thanks for your feedback.

Comments are really important. I'm not certified in LabVIEW (looking forward to CLAD until July), and I've heard that in the CLD and CLA exams, comments are vital (crossrulz's tip in some thread that I've read).

Also, I can't wait for the Advanced Code Commenting Functionality to be available 😄


Regards!

Mondoni
0 Kudos
Message 22 of 36
(852 Views)

I think "neatness" of block diagrams should be taught along with the first lesson in block diagrams. I've been using LV for 15yrs and have seen enough ugly code to last 2 lifetimes.Smiley Indifferent

PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
Message 23 of 36
(842 Views)

Have to say I agree with paul, some of my first projects are a mess, more from lack of experience than anything. Being taught/shown the conventions at the outset would be a good thing, perhaps a module within core 1 or core 2

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
Message 24 of 36
(839 Views)

@joaopam wrote:

LesPeters escreveu:

This a great thread you started Joao and I have enjoyed taking in all the different viewpoints.  First congratulations on reaching the one year mark in LabView.  I have been programming in LabView since version 3.3.  Some of the newer programmers here think I am a little fanatical about the neatness of my block diagrams but no one seems to complain about not being able to follow my code.  I find that developing neat block diagrams (and front panels) from the start helps to organize how I want to lay things out and helps make it scalable / expandable from the start.

 

At least one person mentioned "The labVIEW Style book" by Peter Blume, a little on the expensive side but a good place to find logical guidelines.  There is also a lot of good free info ("Best Practices") on the NI website as well.  I find peer code reviews to be helpful in providing useful feedback about readability.  LabView is an evolution, you never stop learning new things.  Make each successive program better than the last and don't worry about being to neat!




<snip>

I'll be looking forward to "Best Practices" session. And I totally agree with you: LabVIEW is a constant evolution! 🙂


The deeper I dig into LabVIEW, the more I realize I haven't even scratched the surface.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 25 of 36
(824 Views)

@PaulG. wrote:

I think "neatness" of block diagrams should be taught along with the first lesson in block diagrams. I've been using LV for 15yrs and have seen enough ugly code to last 2 lifetimes.Smiley Indifferent


It's like teaching C++ and not emphasizing indentation.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 26 of 36
(821 Views)

I'm surprised about how many people feel block diagram cleanup does a bad job.  I'm curious as to what their results are vs. what they are expecting.  I find it generally does a very good job.  If the block diagram is bad enough (like some VI's posted on the forums), the results are far better than the original.  If I have a section of code that looks bad because I made a lot of changes it to it, then a selective cleanup helps.  Are the results perfect? No.  Do I sometimes wonder why the cleanup leaves things in a state where I think it could of been smarter as to where wires cross or shift registers wind up?  Yes.  But I find that I usually only need to make a few changes to the results of a block diagram cleanup to improve upon it and it saves a lot of work in trying to improve upon a messy diagram.

Message 27 of 36
(816 Views)

RavensFan escreveu:

I'm surprised about how many people feel block diagram cleanup does a bad job.  I'm curious as to what their results are vs. what they are expecting.  I find it generally does a very good job.  If the block diagram is bad enough (like some VI's posted on the forums), the results are far better than the original.  If I have a section of code that looks bad because I made a lot of changes it to it, then a selective cleanup helps.  Are the results perfect? No.  Do I sometimes wonder why the cleanup leaves things in a state where I think it could of been smarter as to where wires cross or shift registers wind up?  Yes.  But I find that I usually only need to make a few changes to the results of a block diagram cleanup to improve upon it and it saves a lot of work in trying to improve upon a messy diagram.


 

As you said, it does a very good job for bad enough diagrams, like some VI's posted on the forums (I'm far to be a judge). 

IMHO, the quality of this tool's work is beyond what it really does. It is all about perspective and personal development parameters.

Maybe when we have a messy diagram, we expect that the diagram cleanup really clean everything. But it's not the "end" of the neatness of the diagram, but just half of the way.

When I applied to LabVIEW Core 1, I was strongly recommended to constantly use "The Tool". I tried but when I have time I prefer to cleanup by myself. Even if I lose more time than I would (if used the tool), I think that following my own parameters of what is a good diagram (readability, neatness, modularity, etc) is going to give me better results.

 

Regards

Mondoni
Message 28 of 36
(810 Views)

I like neat diagrams and probably spend too much time getting them that way.  Over the years I have learned to program in a style that is comfortable for me so that I rarely need to edit a diagram for looks.  I also keep the auto wire routing tool turned off. I think it creates some really strange wire paths.

 

I do not like the Diagram Cleanup tool.  I never use it on my own programs because its idea of good style and mine are quite different.  When I use it on some of the code downloaded from the Forum, I find that it sometimes is a decent starting point.  At least it moves controls left and indicators right (although it gets the justification wrong). It also does a poor job of placing shift registers.

 

This is the way LV with default settings (using VISA Config Serial Port.vi) places controls, indicators and constants:

Create VI.png

 

After Diagram Cleanup:

Clean up diagram.png

Since I do not use Icon view of terminals and a different label placement, my version looks a bit different.  This is the way I would have coded the same thing:

My way.png

I do not have the VI Anayzer, but have reason to believe that it does not like the constant and control terminal borders touching. In this situation I think that a one pixel overlap does not reduce readability significantly while keeping the diagram compact and as many wires as possible straight.

 

Lynn

Message 29 of 36
(798 Views)

there' a few things I use when developing...

 

  • try,try and try to keep the block diagram on one screen size
  • do not use icons
  • try to keep wires straight with few bends
  • use the align and distribute object tools
  • rt clicking alot
  • clean up wire
  • Peter A. Blume's LabVIEW Style book
  • CLD requirements doc.
  • Cntrl/Shft shortcuts
Message 30 of 36
(786 Views)