12-19-2015 07:25 AM - edited 12-19-2015 07:41 AM
I'm a rather recent developer since approximately 1 year 1/2, and I realize I'm allready getting my own programmation habits.
I would like to know if this habits are good from your point of view
you will find joined my most recent code. Can you just take a look of my code design?
don't hesitate to make criticism if necessary (with arguments of course :))
notes:
-made with labview 2015
-project name is "assembly 2.lvproj"
-main VI is "assembly 2.vi"
-programming time: 12 hours.
-validation not finished
For the curious people:
it's a small program that pilots a bar code reader and industrial screwer, for an operator.
1)the operator scans the barcode of the product (step"lecture douchette")
2)if the barcode is scanned + prerequisites and previous building steps are good for this product(step"verif N-1"), the screwer is unlocked (step"envoi visseuse")
3)at the end of the screwing, the screwer returns a frame, handled in step"lecture visseuse"
thanks four your opinions
12-19-2015 09:55 AM - edited 12-19-2015 09:56 AM
Hi Pierre,
I am using LV 2014 so I cannot view your actual files, but if you are just concerned with style, I know there is a style guide check list in the LabVIEW help. Also, using VI analyzer you can get some comments on the style (like are the terminals aligned with the connector pane of a VI?). I've also seen the LabVIEW Style Guide by Peter Blume recommended on here, but have never read it myself.
As I said I could not open your project, so perhaps there is some good organization in there, but I would still like to see better organization outside of the project. Mike Porter talks about naming conventions on his blog: notatamelion.com which could be helpful for you. In the top folder (in Windows explorer) I'd like to only see folders and two files (plus the aliases and lvlps files that LV makes): assembly 2.lvproj and assembly 2.vi. Everything else should be in some well-named subfolders like Bar Code Scanner, Industrial Screwer, Integration, User Interface, etc. Those names are really up to you, I just think there should be more structure. If another developer ever has to take over your project, he will surely thank you 🙂
12-19-2015 01:31 PM - edited 12-19-2015 01:32 PM
Just some simple issues after a 30 second look. 😉
12-20-2015 08:26 AM
I first began to use the array of enum for a queued state machine because I've seen it in the labview intermediate 2011 course book.
It's just my opinion but I don't understand why event handler prod/consumer is so popular, because there isn't any added value to use it compared to standard state machine + it takes more place in the diagram
In fact I deleted "assembly 1 program and created 2. that's why assembly 1 install is at the top of assembly 2 program 🙂
I didn't know vi analyzer and I have just tried if. this is a pretty good tool
for example, the principal NOK results returned are:
-not enough docu
-too much nodes, structures and subdiagrams in the main diagram
-debugging enabled for all vis (what is that?)
-diagrams too big (don't agree)
-terminals inside diagrams
I have taken a look at this website, it seems interresting. favorite added. 🙂
in windows explorer point of view, my code is a mess 😛 I only use labview virtual folders
12-20-2015 12:35 PM
Some more comments:
Bob Schor
12-20-2015 12:44 PM
I meant to say something about "Diagrams too big", with which you disagree. When I began doing serious LabVIEW development, I read (several times!) The LabVIEW Style Book, by Peter Blume. One of his Style Principles is that every VI should fit on a standard Monitor screen (almost all of mine do). The advantage to this is that you see everything at a glance, and it forces you to hide irrelevant (at that level) code.
Two things help in keeping VIs small -- keep your wires as straight, going left-to-right, as possible, and "encapsulate" blocky code (which is often distracting and less relevant) into sub-VIs. You already know about making Icons to help instantly understand something about what the sub-VI is doing -- it is a lot easier to grasp a small Block Diagram with nicely laid out code, connecting 32 x 32 pixel LabVIEW functions with 32 x 32 pixel User Sub-VIs, each with a nice Icon, than a huge VI (I've seen some that would require 50 monitors to view!) with wires running everywhere.
BS
12-20-2015 12:48 PM
Pardonnez moi -- when I saved the Zip File and attached it two posts ago, I forgot to close (and save) the Project file, so I'm not sure if the Zip file has the correct Project or latest version of all of the VIs in it. Please discard it and use this one, instead.
Bob (Careless) Schor