04-24-2013 06:12 AM
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.
04-24-2013 06:17 AM
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!
04-24-2013 07:00 AM
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.
04-24-2013 07:05 AM
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
04-24-2013 07:54 AM
@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.
04-24-2013 07:56 AM
@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.
It's like teaching C++ and not emphasizing indentation.
04-24-2013 08:03 AM
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.
04-24-2013 08:29 AM - edited 04-24-2013 08:30 AM
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
04-24-2013 09:09 AM
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:
After Diagram Cleanup:
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:
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
04-24-2013 09:26 AM - edited 04-24-2013 09:30 AM
there' a few things I use when developing...