Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: franji1 on November 08, 2015, 06:38:13 PM

Title: Good PLC Program Documentation
Post by: franji1 on November 08, 2015, 06:38:13 PM
Good software development standards apply in C++ Windows Programming along with PLC Programming.

Checklist of Good Commenting Techniques

General

Statements and Paragraphs

Data Declarations (Designer Documentation Extra Info and/or Description fields are good for these)

This material is copied and/or adapted from the Code Complete 2 Website at cc2e.com.  This material is Copyright (c) 1993-2004 Steven C. McConnell. Permission is hereby given to copy, adapt, and distribute this material as long as this notice is included on all such materials and the materials are not sold, licensed, or otherwise distributed for commercial gain.
Title: Re: Good PLC Program Documentation
Post by: Garyhlucas on November 08, 2015, 08:21:37 PM
I had a young programmer working for me writing assembler to control a machine we were selling around 30 years ago. Every few days I'd sit down with him and ask him to explain some of the code to me. If he hesitated in his explanation I'd stop him programming and have him document instead. When he left after 4 years we had 500 pages at 80 lines per page of well documented code. He got hired away by Mcgraw Hill, and told me later that all that documenting turned out to be very valuable to him later.
Title: Re: Good PLC Program Documentation
Post by: Controls Guy on November 09, 2015, 12:53:00 PM
Nice idea for a thread, franj1.

Also very much appreciating that Do-More stores docs onboard.  Big advantage!   :)
Title: Re: Good PLC Program Documentation
Post by: franji1 on November 09, 2015, 02:23:53 PM
The Symbolic Constant feature is quite powerful.

For example, if you utilize the Date/Time in your application, creating Symbolic Constants like
Jan 1
Feb 2
Mar 3
...

Sun 0
Mon 1
Tue 2
...

Then your relational contacts can look like

$Now.Month Jan
-----] = [-----

or

$Now.DayOfWeek Sun
-------] = [-------


Hardcoded Recipe indexes (e.g. 0 is Doritos, 1 is Tostitos, 2 is Fritos, etc.)

Anything that is an "enumeration" of something, then Symbolic Constants can make the native ladder logic more readable.