To all of you who write applicable comments:

That is an interesting idea. You find that the end works better than the beginning just to avoid extra scrolling at the top of the program?

Yes. It's out of the way, but there if you need it.

One of the unfortunate techs that has to troubleshoot my programs made the suggestion years ago. It works fine ... and less scrolling (it began on PLC5, in the DOS days, so the scrolling was with the cursor keys (y))
 
I have come across some programs where the comment on the first rung was so long that trying to see the rung itself was difficult - Windows kept jumping down to the next rung if the down arrow was pressed to read the next line of the comment or get to the actual rung.

I have cut the comment and pasted it on the END line of the ladder during online edits, and usually put it back when I am done and go to save.

Comments over 3 or 4 lines get too verbose, and seem to fill the ego of the programmer?

Good tip.

I think I would need some training to cut down the comments to 4 lines. The summaries seldom go over 4 lines.

If the person reading it needs the in depth info, they read it. If they have experience and understand the code when they see it, the summary is enough, or at least it is usually enough.

I still get questions, but most of those seem to be because I assume that they know a bit more about other stuff - like the process, hydraulic system, instrumentation, etc.
 
While I'm totally on-board with comments, it's also more important to write good code. As I have said before, as quoted from SICP

https://en.wikipedia.org/wiki/Structure_and_Interpretation_of_Computer_Programs

"A computer language is not just a way of getting a computer to perform operations.. .it is a novel formal medium for expressing idea about methodology. thus, programs must be written for people to read, and only incidentally for machines to execute."
 
I usually like to Comment the Code in "Sections" i.e ; The Following piece code will do X . Then if there are more complex tasks I may add a few notes on the following rungs or a reference to the proper documentation describing the process in a detailed design spec or FRS.
 
Dealing with a nightmare of a program now. Siemens program from over seas. Half English, half German. We requested all English, but the bean counters on the project accepted what we got. Comments are vague when used, tag names are their interpretation of what something is supposed to be or do. Struggling through now.
Also on same project, on a different portion of the line, received the program in Italian. It means something to somebody.
 
The number one feature that AB has added is the comments stored in the PLC. Now I don't have to worry about finding the offline file of a previous job. Or making sure I give the customer the 'new' offline file.

Or even more importantly another vendor coming in and hacking in some code without giving me the comments (as long as they comment it online).
 
Should I document this ProofOfConcept code?
I did, I just turned off all docs for the pdf print.
 
Saw a program the other day that had a ST routine at the beginning that wasn't being called. It was a description of the program and how it was supposed to function, with revision notes (newest at the top). I thought it was a really neat use of a ST routine.


I'll second (third?) comment the WHY not the what.
 

Similar Topics

I've gotten to the learning curve where I can program a call for pump to come on at set point but I'm not sure how to turn the same pump off when...
Replies
1
Views
105
Hi everyone, I am working on a project that needs to expose the SV (Set Value) of a temperature controller to a SCADA system. SCADA <-...
Replies
4
Views
152
Thank you for any and all responses/help. I have an RSLogix 5000 v20 and a Cognex In-Sight v5.9 spreadsheet (8502P). I can not figure out how to...
Replies
0
Views
118
Hello, This is my first exposure to CCW Micro8xx family. Someone will write to my existing micro850. Modbus TCP is turned on and I created a...
Replies
2
Views
162
When using System Platform, I can use the object viewer to directly manipulate attributes/tags/whatever. When I have a standalone InTouch...
Replies
11
Views
970
Back
Top Bottom