Ladder Logic and Other PLC Programming Options

The most common way to program early PLCs was using so-called ladder logic programming. Basically, a ladder logic diagram was a graphical way of representing the functions in a typical PLC and the control actions it would have to take. For instance, lines on a ladder logic diagram could include opening or closing a switch, turning a motor on or off, or energizing a coil on a relay. These functions would be represented graphically as rungs on a ladder — hence the name “ladder logic”.

For many years this was the standard way of programming a PLC. Even today, ladder logic programming tends to be the most favored programming language in the U.S., perhaps due mainly to its simplicity and familiarity to many in the controls industry, especially electricians and technicians.

These days, there are other programming languages for PLCs that have been standardized in the IEC 61131-3 standard. (The “3” refers to the third part of the standard published in 2013.) This standard defines two basic types of programming languages — graphical and textual.

A typical ladder logic diagram. (Diagram by Nuno Nogueira, Wikimedia Commons)

The standard defines 5 different languages:

  • Ladder diagram – The original PLC programming language, this gives a graphical representation of circuit elements such as switches and motors.
  • Function block diagram – A graphical programming language; functions are described as blocks with input and output connections.
  • Sequential function chart – Also a graphical programming language, good for coordinating large tasks into smaller processes.
  • Structured text – A textual programming language; it is based on Pascal, a higher-level language, and can communicate with other languages based on common structural elements.
  • Instruction list – A textual language, it is a low-level programming language that closely resembles assembly.

The programming language largely depends on the PLC manufacturer. The most common language continues to be ladder logic with sequential function charts also fairly popular. In addition, not all PLCs are capable of running the various IEC languages due to lack of memory or processor speed.

The natural tendency for many engineers is to stick with a programming language that they already know and are familiar with. However, this will also depend on which company’s PLC is being employed and which programming language it uses.

About this author

More posts by Digi-Key's North American Editors