IEC 61131-3 Programs

In the previous section you saw how to deploy a real-time C++ project using PLCnext Engineer software.

Using PLCnext Engineer, it is also possible to write real-time programs in any or all of the four languages defined by the IEC 61131 standard - Ladder (LD), Function Block Diagram (FBD), Structured Text (ST) and Sequential Function Chart (SFC). Programs written in these languages run on the Embedded Common Language Runtime (ECLR), and programs written in these languages can run alongside - and exchange GDS data with - real-time programs and components written in C++.


As the name suggests, the Embedded Common Language Runtime is based on Microsoft's Common Language Runtime (CLR), which is required to run C# and other .NET programs on Windows platforms. Unlike the CLR, the ECLR is specifically designed to run real-time, deterministic programs on embedded devices. The ECLR contains a sub-set of CLR libraries, along with specialised libraries added by Phoenix Contact.

Phoenix Contact provides a Visual Studio extension that helps write C# code that targets the ECLR. In this way, it is possible to write real-time programs, function blocks and functions in C#.

IEC 61131 and ECLR programming is outside the scope of this book, but there is plenty of information on these topics in the PLCnext Info Center.