SWITCH Security-Blog

SWITCH-CERT IT-Security Blog


Secure PLC Coding Practices

In the world of operational technology, programmable logic controllers (PLCs) control physical elements such as a municipal water supply system, the room temperature in offices or a chocolate bar packaging machine. Twenty years ago, manufacturers promoted their PLCs as compliant with the IEC 61131 standard. Today, the standard is well established and supported by all major PLC suppliers. To program a PLC, five programming languages are defined:

IEC 61131-3 languageDescription
Ladder Diagram (LD)Looks like a electrical diagram
Function Block Diagram (FBD)Contains elements from boolean algebra / digital technology
Structured Text (ST)Similar to Pascal or C
Instruction List (IL)Has its roots in the assembler language
Sequential function chartGraphical elements for programming e.g. batch programming

An electrician will likely choose Ladder Diagram as programming language. Someone who is used to programming in a high-level language will most probably use Structured Text. Often it is a mixture: functions or libraries are written in ST, while the “glue logic” is written in Function Block Diagram.

Continue reading