The Real Reason PLCs use Ladder Logic rather than C++?

This article on PLC programming languages was written by Chris Urban, an automation educator and PLC trainer with over 40 years of hands-on experience. Find Chris on YouTube and LinkedIn. — CU


Can we even compare the programming languages used on our PCs to those used in PLC programming?

To get to the bottom of this, we have to first understand how computer programming languages evolved.

The First Generation — Machine Language

At the very beginning of the computer business — right after the Second World War — the instructions and commands given to computers were just long strings of “0”s and “1”s. These were the logic values of the Low/High or Off/On switches that engineers toggled on the computer panels.

As our brains are rather well organized for images, sentences, and words — but not for memorizing long strings of numbers — the task of programming was very arduous and cumbersome. Imagine a huge book listing all these commands that you had to navigate every time you wanted anything from the machine. Until today, these long sequences of 0101100… remain the only ones that any computer’s brain truly understands.

This was later called Machine Language — and for obvious reasons it is known as the first generation of programming languages.

The zero/one sequences were not the only hurdle. A bigger problem was lurking in the shadows: every new computer that universities and specialized companies produced came with its own set of instructions. So instead of having one machine language, there were as many versions as there were computer models. With processors now embedded in integrated circuits, we can say that machine language is processor dependent.

The Second Generation — Assembling Language

It did not take long before someone — Kathleen Booth — tried to build a bridge between the way our brains work and the machine code.

A second column appeared in the reference books: for each 01101011001… instruction, a shortcut was attached. ADD if the machine code was to execute an addition, SUB, DIV, MUL, and so on. These shortcuts are not abbreviations in the conventional sense — IBM is an abbreviation, for instance. We call them mnemonics — shorter parts of words that still preserve their meaning.

A much friendlier kind of language was born: the Assembly Language. It is the second generation of programming languages. However, it still had the same fundamental problem as the first generation — it was processor-dependent. There are as many assembly language versions as there are processor models.

To appreciate the scale of that problem, let’s jump for a moment to the mid-1990s. With the first Intel Pentium processor came more powerful graphics cards for PCs. All of them were programmed in assembly language. Being very close to the processor, the conversion to machine language was fast — fast enough for the video card to keep up with the processor speed.

But every time a new processor and graphics card came to market, factory engineers had to be retrained in the newer assembly language. Someone in the industry rightfully decided it was worth giving up assembly language — even with its speed advantage — in favor of C/C++.
This transition marked the arrival of the third generation.

The Third Generation — Procedural and High-Level Languages

Procedural or high-level languages allow you to use whole words for instructions, write loops with while and do-while, and make decisions quickly with if-else. More importantly, they brought a much bigger advantage: portability.

You can copy a C++ program and run it on any other computer, regardless of the processor version.

Most of the languages you have heard about — Java, Python, Go, Ruby, Rust, Pearl, Ada, C, C++ — are procedural languages.

The Fourth Generation — SQL

Two exceptions to the procedural category are Microsoft Access and Oracle. These form the fourth generation, used exclusively to build databases.

Access handles small and medium-sized databases — the kind a municipal library might use.
For the large databases required by banking systems, utility companies, and ticket reservation systems for trains, concerts, and airlines, Oracle is the industry standard. It is also why Larry Ellison remains one of the wealthiest people on earth.

The Fifth Generation — Natural Language

The fifth generation — Natural Language — remains largely in development. AI will probably take care of it soon.

The Chart — Computer Languages vs PLC Programming Languages

The Real Reason PLCs Use Ladder Logic and Not C++

The 5 generations of computer languages (left) and their PLC programming language counterparts regulated by IEC 61131-3 (right). Diagram courtesy of Chris Urban.

 

The languages are tools for making a processor execute your instructions. The closer a language is to the processor, the less time it takes to convert instructions into machine language.
But there is a catch: if the language is too close to the processor, it moves further from the user — becoming more complicated and often processor-dependent.
The opposite is equally true: if the user wants a more natural language, the effort and time required to convert the result into machine language increases considerably.
In practice, you will be asked to choose the right compromise between execution speed and programming effort — sometimes giving up the most user-friendly language in favor of faster translation.

Where Do PLCs Fit In?

In the small town of Bedford, Massachusetts, Dick Morley was well versed in programming.
For his numerous machine-tool applications, he used the same kind of DEC minicomputers that Dennis Ritchie and Ken Thompson had already used to develop Unix and the C language a couple of years earlier.

But Morley’s industrial applications were not easy to sell. Placing expensive minicomputers in a harsh environment was not ideal. They also required specialized personnel. And from design to delivery, the timeline was around six months.

Almost exasperated by the mounting inconveniences, he designed a new piece of equipment specifically adapted to industrial working conditions — temperature and humidity fluctuations, interference from welding machines and AC motors, dust, and lack of airflow.

When Bedford project #84 was prototyped, it was named MODICON — MOdular DIgital CONtroller.

The Programming Language Decision That Changed Everything

What programming language to choose for the new device? The first three generations were available. As an experienced engineer, Morley understood that factory floor technicians were not comfortable with computer programming in any current language. But all of them seemed at ease with relay ladder diagrams.

So why not squeeze that inside?

This was a stroke of genius.

The relay ladder has two vertical power rails, and each rung connected between them forms a distinctive electric circuit you can verify on the spot. It is similar in spirit to the BASIC language used a few years later on the Commodore 64, Sinclair, and Atari — where the interpreter checks one line of code at a time, making troubleshooting straightforward.

The only limitation at the time was that graphical applications were not available on the computers of 1968-69. The language chosen to implement the ladder diagram was what we now call the IL—Instruction List —similar to assembly language.

As you might expect, each company applied the language with its own syntax. A simple instruction like “Load” is not even consistent: it is LD for Omron, LOD for IDEC, and L for Siemens — which also renamed the language to STL (Statement List).

The IEC 61131-3 Standard (PLC Programming Languages)

The first edition of the IEC 61131-3 standard, released in 1993, listed five programming languages. The Instruction List was recently deprecated, and the fourth edition (2025) now contains only four languages. In terms of programming instructions, all four fall into the third generation of computer languages.

ST — Structured Text

Although it contains a subset of C++ instructions, the ST language can also relate to Pascal. Anyone comfortable programming in Pascal or C++ should find Structured Text relatively easy to learn.
PLC Programming Languages - Structured Text

Note: Although not yet included in the IEC 61131-3 standard, C++ is already supported by some PLC manufacturers. Almost all ScadaPack models — now under the Schneider Electric umbrella — have offered C++ as an alternative language for years. Open PLC uses only C++, which is precisely why it is not considered an industrial PLC — none of the IEC standard languages are present.

LLD — Ladder Logic Diagram

PLC Programming Languages - LLD Ladder Logic Diagram

You can practice ladder logic right now in the free ACC PLC Simulator — no hardware or software required.

FBD — Function Block Diagram

FBD Function Block Diagram

SFC — Sequential Function Chart (Grafcet)

PLC Programming Languages - SFC Sequential Function Chart

Aside from Structured Text, the other three remaining languages in the IEC 61131-3 standard are graphical and highly specialized for PLCs. They do not have direct equivalents in conventional computer languages.

Which PLC Programming Language Is Most Popular?

There is no straightforward answer — it depends largely on where you live.

Ladder Logic — The North American Standard

Relay Ladder Diagrams appeared somewhere in the second half of the 19th century, when the relay was king. Nobody can point to exactly where or who used it first. It was easy to draw and understand, so it spread rapidly. After Dick Morley adopted it as Ladder Logic, its dominance became even stronger.

Ladder Logic was the dominant PLC programming language for more than 30 years. Nowadays the landscape is changing. More people are growing up with C++ from an early age, and PLC manufacturers are adapting accordingly. For demanding industrial processes, some tasks simply cannot be solved reasonably with ladder instructions alone — making more complex languages a natural choice.

Ladder Logic remains extremely intuitive — accessible not only to engineers but also to technicians. In North America, where it spread first, it remains dominant.

Grafcet — The European Tradition

The trend is different in Europe. In 1977, Grafcet was officially recognized as a programming tool. Invented in France, it quickly became a core subject in European universities for programming automated machines.

One reason for the shift to Grafcet in Europe is also the historically higher density of engineers per km² compared to the North American continent.

In 1993, Grafcet was incorporated into the IEC 61131-3 standard under the international name SFC — Sequential Function Chart.

A Special Note on Grafcet

Grafcet was invented by a team of researchers and industrial managers led by Michel Blanchard. It adapts the Petri Net Model, established in 1962 by Carl Adam Petri.

The acronym Grafcet highlights both the origin of the language — AFCET — and its identity.

AFCET stands for Association Française de Cybernétique Économique et Technique.

From a functional perspective, GRAFCET stands for Graphe Fonctionnel de Commande Étape Transition — and, as the title suggests, the two main elements of the language appear: Steps and Transitions.

To understand Grafcet properly, a solid foundation in PLC fundamentals and programming languages is needed. But with that background, SFC can substantially reduce programming time for complex projects — because the user focuses mainly on the sequence of operations in organigram form, while the software handles the compilation into machine language. Ladder logic and Grafcet charts can even coexist in the same program.

Recognizing its efficiency in organizing complex tasks, Siemens adopted Grafcet in 1985, and Allen-Bradley followed in the USA in 1986. In the SFC format of the IEC 61131-3 standard, the language is natively supported in Siemens S7-Graph, Schneider Electric Unity Pro, and Allen-Bradley RSLogix 5000/Studio 5000.


This article is part of Chris Urban’s series on ACC Automation. Read the relay series: The Relay Obituary? Not So Fast! · Relay Symbols Glossary · EMR Contacts in Applications

About the author: Chris Urban is an automation educator and PLC trainer with over 40 years of hands-on experience. Find him on YouTube and LinkedIn. — CU