Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


PLC programming standards for efficiency and ease of use

PLC programming standards for efficiency and ease of use

PLC programming standards for efficiency and ease of use

My company makes several lines of equipment for use in the pharma industry. We use mainly AB logix5000 processor and have employed a modular style of programming for several years now which allows us to plug and play different modules depending on what options the individual machines have. We have an increasing number of complaints both internal and external customers that the code is too complex. At this time, I believe this to mean any or all of the following:
- too long overall
- too many rungs in a routine
- long/confusing tag names
- too many steps to follow when trying to trace back through a function (get lost when trying to follow the code)
- code unnecessarily blocked into several levels of add on instructions
and there are probably other complaints that don't come to mind right now.

So, I am interested in improving our code to be more efficient, easier to navigate, and perhaps to fall more inline with standards used by others. I'm looking for any references that any of you have to published standards, internal company standards that have been successful, good sets of guidelines, etc for high quality, efficient, easy to navigate PLC code.

Thanks in advance.

RE: PLC programming standards for efficiency and ease of use

Have you considered that the customers do not have the qualifications to understand the code?

RE: PLC programming standards for efficiency and ease of use

What is the purpose of the code? Was it intended to be modified by the customer?

First and foremost is DOCUMENTATION. Obviously, ample commenting for non-original programmer usage is mandatory. One possibly useful thing is an algorithm description document (ADD), which describes in mathematical or boolean terms, what the code is trying to do. Computer flow diagrams have tended to fall out of fashion, but can be useful for someone to figure out someone else's code. Alternately, Unified Modeling Language (UML) documentation can be useful if the code is particularly object oriented.

Typically, presumbably applicable to PLC code as well, modularity is a way to break up complex code into smaller, easier to digest modules.

FAQ731-376: Eng-Tips.com Forum Policies

Need help writing a question or understanding a reply? forum1529: Translation Assistance for Engineers

RE: PLC programming standards for efficiency and ease of use

What you have is a tough row to hoe. There are a couple of axioms of developing-code-for-customers that have helped me manage my customer's frustrations:
  • Programming power usually arrives from programming complexity.
  • Most end-users simply aren't trained in the advanced stuff that is used to produce the complexity needed to be powerful.
  • Most end-users are too busy getting the product out the door and are never given the time to learn deeply a particular machine's programming language or construction.
  • Documentation is key. As my Journalist-parents taught me well at an early age, "Good writing is hard to do." The same applies to code documentation and machine function descriptions. In 35 years of machinery work, I feel confident in saying that the majority of engineers suck at it. And the majority of companies that employ and pay those same engineers to develop and ship the equipment won't give them sufficient time or training to be good at it. That's a lose-lose proposition.
Personally, I have been successful with short, understandable modules of code that are documented out the wazoo. It requires a lot of code-planning effort, adoption of an internal philosophy of "supportable & sustainable code for the customer" versus "elegant & efficient code for the programmer", hours punching keys and writing good 4th-Grade level descriptions, and the courage to give the Project Manager some hefty push-back if required. Couple that with patient training and setting the clear expectation that the customer must learn the content. THAT is what keeps disgruntled folks from calling me in the middle of the night. Well...mostly. But done well, they will keep coming back for more.

Good luck hoeing that row.

Blue Technik LLC
Virtuoso Robotics Engineering

RE: PLC programming standards for efficiency and ease of use

One thing I consistently see in some PLC software (I am mostly using Simatic PLCs) is the hard coding of tolerances and limits in the code instead of keeping everything nice and tidy in an aptly named "XXXX CONFIGURATION" DB.

We have one of our suppliers that has a coding standard (showed to us) and after going through their standard, it becomes easy to know where to look for things next. There are no hardcoded values inside function blocks, everything is inside DBs and the names are not abbreviated to extinction and actually mean something a human can relate to.
On the other hand, another company we deal with, barely uses DBs to save configuration data and everything is hard coded inside function blocks. This makes it extremely hard to find anything as we can't cross reference for DB addresses to find the relevant code.

Just another important point to increase the readability (at least on Simatic) of code. Normally, if the development of the system is well structured, the documents mentioned by TygerDawg will already exist.
Also, alarm lists, communication tables, etc... are all pluses as a lot of the times, the customer is not interested in the software itself but from where the signals and values will be coming from.

Finally, there is a reason why you are making and selling machines... and it is the capability of making said complex code and complex functionality or complex code in "weak" hardware.

RE: PLC programming standards for efficiency and ease of use

Try looking at ANSI/ISA 88. It says that it pertains to batch processing, but in reality is a very good all around programming standard.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close