hpr4778 :: Programmable Logic Controls - Episode 8
A brief overview of industrial control systems.
Hosted by Whiskeyjack on Wednesday, 2026-11-25 is flagged as Clean and is released under a CC-BY-SA license.
PLC, Programmable Logic Controller, technology.
(Be the first).
Listen in ogg,
opus,
or mp3 format. Play now:
Duration: 00:21:48
Download the transcription and
subtitles.
general.
01 Introduction
This is the last episode in an 8 part series.
02
In the previous episode we looked at
* Personal computers in industry,
* SCADA systems,
* HMI systems,
* Test and measurement systems
03
In this episode we will look at the following.
* The IEC-61131 standard,
* Soft logic systems,
* A free and open source soft logic system and its shortcomings.
* What a hypothetical free and open source soft logic system suited to industrial use may look like.
--------------------
04 IEC-61131
In 1993 the International Electrotechnical Commission published a set of standards under the name IEC-1131.
This was later renamed IEC-61131 due to a change in the standards naming process.
05
This standard covers many aspects of PLC hardware and programming languages.
However, it has had very little impact in practice.
This is for several reasons.
One is that to get vendor acceptance the standard was treated as a participation trophy.
Vendors need only make token efforts to comply with the standard, provided they issue a compliance document that states what, if anything, they comply with.
06
Let me give you a few quotes from one vendor's compliance document.
Quote
The instruction set specified by IEC61131-3 is entirely optional.
End of quote
07
Here is another example.
Quote
In IEC61131-3, the programmable controller OS can contain zero or more tasks, that can execute one or more programs each containing one or more functions or routines. According to IEC61131-3, the number of each of these components is implementation dependent.
End of quote
08
As you can see, compliance requirements are not exactly very rigorous.
The result is that the major vendors have standards washed their existing proprietary product lines, and only a small number of minor vendors have made more than a token effort.
09
In my opinion, what IEC-61131 has proven is that attempts at written standards for PLCs are a waste of time.
What I believe the industry needs is a Free Software soft logic system that runs on a Free Software operating system that runs on a wide range of hardware.
I will go into what I think is needed in more detail later.
However, I believe the existing state of affairs is due to the following factors.
10 Market structure
The first is market structure.
The major vendors offer a complete and comprehensive product line of which PLCs are only a part.
Distribution channels are tightly controlled to prevent competition.
Training is organized around learning vendor products, not on general principles.
11 Unsophisticated customers
The next is unsophisticated customers.
PLCs are ready to use right out of the box.
You do not need much in the way of general computer skills to learn how to program and use one.
Most users are not ready to push very far outside of their comfort zone.
12 Lack of suitable hardware until very recently
Still another reason is lack of suitable hardware until very recently.
Early attempts were made to use personal computer hardware, but large size, lack of ruggedness, and problems connecting IO made this impractical in most applications.
Furthermore, early efforts were in most cases based on using a Microsoft operating system, and customers viewed these as too unreliable.
There were single board computers, but there was no standardization, making sourcing replacements over the long term problematic.
13
The end result was that vendors enjoyed a degree of vendor lock in very similar to mainframe computer companies in the 1960s.
14
However, this standard was to have an influence on players from outside of the traditional big PLC vendors.
--------------------
15 Soft Logic Systems
At some point in this series you may have asked yourself a question along the lines of "would it not be possible to emulate a PLC in software running on a desktop PC?"
If so, then you are correct, it is possible to emulate PLCs on a PC, and it is something that is done.
This sort of thing is called a "Soft Logic System".
A number of vendors have come out with them.
16
However, they haven't been big sellers.
One reason is that the software alone tended to be more expensive than a conventional PLC that could do the same job.
17
Yet another is that most PLC vendors chose to target running the software on Microsoft Windows on standard PC hardware.
To industrial automation customers, Windows had a poor reputation for reliability as did standard PC hardware.
18
Furthermore, the software was still proprietary and closely modelled on their conventional PLCs, so soft logic systems did nothing to break vendor lock in.
Also, they weren't generally any cheaper than a small conventional PLC that was ready to use out of the box.
19
All these taken together meant that interest in soft logic systems was limited.
There are certain minor vendors who sell them.
This isn't the full story however, and I will turn to this next.
--------------------
20 OpenPLC / Beremiz
This does not mean there were no attempts at open source or Free Software soft logic systems.
One such Free Software soft logic system is called OpenPLC.
There is also a fork of OpenPLC called Beremiz.
This is spelled B E R E M I Z
It is available under GPL-2.0+ or LGPL-2.1 or later.
21 OpenPLC - Installation on Linux
OpenPLC offers three different installation options on Linux.
These are from an AppImage package,
cloning their git repository,
and downloading a tarball and running an installation script.
22
I could not however get any of these to actually work with the current version, which is 4.2.7.
There was always some library version conflict with fuse or npm or some other reason.
As a point of interest, poking around in the tarball shows that this is an Electron app, and they used Claude Code AI to create it.
23 Beremiz - Installation on Linux
Beremiz appears to be a fork of OpenPLC with additional features.
In this case I installed the Snap package version on Ubuntu 24.04.
The snap package does indeed run.
24
However, the Snap integration with the file system is very poor.
The permissions are not set up to allow saving project files outside of the snap, which is a bit of a problem.
25
I was able to create a new project directory by selecting "New", and then selecting an existing directory within the snap, then right clicking and selecting "open with file manager" and then navigating around with the file manager to where I wanted the directory to be, keeping mind that this is still inside the snap.
26 Editing with Beremiz
I won't provide a proper review of Beremiz, as this whole category of software is going to be so unfamiliar to most listeners that it would be difficult to describe in a manner which they can relate to.
Instead I will describe a brief experience of working with it.
27
I created a new program, and selected ladder as the language.
I was able to create a basic stop-start push button circuit.
However, the ladder editor is a bit rubbish.
28
You drag and drop instructions onto a canvas in the editor pane and move them to wherever you want, lining them up manually.
This is like having a text editor where you manually drag and drop each letter onto a canvas and arrange them into words and lines manually with your mouse.
29 Building a Project
I was then able to build the project.
What this does is to translate the project into C source code and to then compile the C to an .so file.
The next step would be to combine this with the Beremiz or OpenPLC runtime on the target hardware.
I did not test this, as going any further than this would be at least a full episode in itself, if not its own series.
30 Project Files
By using the file manager trick mentioned above, I was able to find the project and source files which were generated and copy them to another location, so it is possible to get the files out of the snap with some effort.
The files appear to be a combination of C, Python, XML, and CSV.
31 Other Languages
The editor supports ladder, instruction list, sequential function chart, function block, and structured text programming languages.
I tried ladder and instruction list and got about half way through creating a sequential function chart sample before deciding to stop as I didn't know enough about how it worked to finish it.
32 Overall Impression
I haven't completed a full project with OpenPLC or Beremiz, but overall I would say that it is good enough to use for a hobby, but it's not good enough to run a factory.
It is more suited to being a development system for writing programs for something like an Arduino than it is for replacing typical PLCs in a factory.
33
The cumbersome ladder editing and the steep learning curve do not make them viable for typical factory use.
If you want to gain some experience writing programs for a PLC however, then it's pretty much the only thing out there that I am aware of that is Free Software.
--------------------
34 Web Based Training Demos
If you are looking for something very easy to use to learn some basic PLC programming techniques, there are a couple of web sites which offer web based ladder editors and simulators at no charge at this time.
35
These are
https://www.plcfiddle.com/
and
https://plcsimulator.online/
I will leave their links in the show notes.
36
If you go to PLC Fiddle, the home page shows a basic start - stop circuit in ladder.
There is a normally open contact for a start button.
In series with this is a normally closed contact for a stop button.
37
On the far right is a solenoid coil for a motor relay or contactor.
One of the contacts of the relay is wired in parallel such that when enabled, the relay "seals in" around the start button, so that when the start button is released the motor relay remains on.
When the stop button is pressed, logic continuity to the relay is interrupted and it turns off again.
38
On the left, the variables for the two buttons and the relay are defined, along with web page elements which you can click to turn them on and off.
The ladder elements change colour when energized.
39
If you click beside the variable definition for "Start Button", the relay is energized.
If you click again, the relay remains energized.
If you click beside the variable definition for "Stop Button", the relay is de-energized.
40
You can add more rungs and more variables.
Only the basic contacts and coils seem to work at this time, but that should give you plenty to play with for a start.
41
Plcsimulator is similar, but appears to have more functions which work, such as timers.
I can recommend playing around with these two sites in order to get a feel for what programming a PLC is like, at least for the PLC equivalent of a "hello world" type program.
--------------------
42 A Hypothetical Ideal Free Software Soft Logic System
At this point it should become evident that the essence of a PLC is an abstract machine which executes a machine control program, and hardware which can be installed in an industrial environment to run this software.
If you make the software independent of specific hardware, it is known as a soft logic system.
43
I have described OpenPLC and Beremiz above, but if I were to describe what the ideal Free Software soft logic system would be like what would it look like?
I think this is an interesting question not because I intend to create this, but rather because it provides a good way of talking about the essentials of how PLCs work and what features they actually need as opposed to what features they currently have due to historical accretion.
44 Essential Characteristics
Let's lay out some essential characteristics and criteria.
First, forget about IEC-61131 compliance.
It really doesn't matter, and ignoring it allows us to make a lot of simplifying design decisions.
45
For example, we will specify that standard integers are arbitrary precision numbers.
An arbitrary precision integer has no specified limit on its size and can grow as large as there is memory to hold it.
46
An example of a programming language that has arbitrary precision integers is Python.
At a stroke these does away with issues such as how to handle integer and counter overflow.
Integers and counters simply can't overflow.
47
Data types would be
Boolean,
integer,
floating point,
time, which is also used in timers,
byte and word, which are used when interfacing with external hardware,
string, as UTF-8,
48
Lists, queues, and FIFOs would be provided as basic features.
Variables are addressed by name only, there are no numeric addresses and no guarantees about where variables are stored in memory.
Programs using the above features are more focused on logical abstractions than on bit and byte twiddling.
49 The Data Table
The heart of any PLC is the data table.
Virtually all features in a PLC do something by interacting with the data table.
In our hypothetical PLC, the data table would be implemented as a high speed low overhead key value store.
Local variables inside an individual function would be locally defined and transient, but all IO and all persistent global variables would stored in the data table.
This relates to the modular design of the system.
50 Modular Design
All other features would be implemented as modules which attach to or plug into the data table.
Some examples of these are as follows.
51 Logic Engine
The module that executes the PLC program would be the logic engine.
This would attach to the data table and all its inputs and outputs would go through the data table.
52 IO Connectors
IO would be connected to the data table via protocol modules.
These would handle things such as Modbus TCP networks or any other protocol for which a protocol module is written.
53 Web Based HMI
An HTTP server would handle a web based HMI.
Graphical elements would be based on SVG and Javascript.
54 Specialized Functions
As well as the regular logic engine, additional specialized modules which handle fixed tasks such as closed loop control of heating processes could be included.
55 Management and System Control Functions
Other functions would include
Alarm and event management.
Recipe management.
Start, stop, and system diagnostics.
ERP interface.
Etc.
56 Logic Engine Implementation
This would probably be an interpreter that would execute a defined Instruction List.
Programs would be compiled from text to executable format when loaded.
Programs are saved only as source, never as compiled object files.
57 Program Editors
The program editors would all be web based, not a desktop GUI.
See the examples of web based ladder editors above which show that this is feasible.
Editing off line, that is, without a connection to the running PLC, would be done by simply running a copy of the soft logic system in a VM on your PC and interacting with it via a standard web browser.
58
The high cost of the programming software for PLCs is one of the major problems that people working in the field face.
For example, I just googled a price for Rockwell Studio 5000 Logix Designer Professional for a perpetual license, and I am seeing figures on the order of $5,000 to $8,000.
59
Just so you understand, this is the cost of one license for the programming IDE, not for the PLC hardware.
You cannot do anything with the hardware without this software.
This is a bit of a sore point for people working in the automation field.
60 Operating Platform
This system would run on a standard Linux or BSD operating system.
It should run on a PC, Raspberry Pi, or other common commodity hardware.
It should be portable between x86, ARM, and RISC-V.
IO would typically interface via Ethernet.
These days there is plenty of hardware which would accommodate such a system, something that was not always true in the past.
61 Free Software Soft Logic Summary
I am not proposing to start a project to create such a Free Software soft logic system.
This was purely an intellectual exercise to give you an idea of what the scope of such a project would be if someone were to attempt it.
It is straightforward and not even that technically challenging.
62
What you can see though is that it is a very different approach to what OpenPLC and Beremiz took.
I think their design choices, which no doubt made sense in the context in which they were created 20 years ago, have contributed to their limited adoption.
However, we also have to face the fact that this is an industry that is oriented around maximizing vendor lock in, so I don't hold out much hope for seeing such a system being widely adopted any time soon.
--------------------
63 Episode Conclusion
In this episode we looked at the following.
* The IEC-61131 standard,
* Soft logic systems,
* A free and open source PLC
* What a hypothetical ideal free and open source soft logic system may look like.
--------------------
64 Series conclusions
I this series we have looked at the following
* What preceded PLCs.
* The background of hard wired relay logic.
* Early use of computers in industry.
* The first PLCs.
* What a simple PLC looks like.
* Basic PLC concepts.
65
* Common PLC programming languages.
* An overview of some of the common early PLCs, including the Allen Bradley PLC 2 and the Siemens S5 series.
* PLC IO.
* Safety systems.
* Safety and cyber security and some of the fallacies surrounding this.
* PLC networks.
* A brief overview of the Modbus protocol.
* SCADA
* HMI
66
* Test and measurement systems
* The IEC-61131 standard.
* Soft logic
* OpenPLC and Beremiz.
* What a hypothetical free and open source soft logic system suited to industrial use may look like.
67
This has been the briefest of brief overviews of the industrial automation field.
I hope that I have been clear that I have barely scratched the surface of the field.
I have probably over simplified some of these topics in an effort to be as brief as possible, so I hope that you will forgive me if some unintended mistakes have crept in as a result of this.
68
This has been the last episode in an 8 part series.
69
I hope that this has been informative and entertaining.
I hope to see you all again later in another episode of HPR.
--------------------