CODESYS Software PLC¶
CODESYS is the leading manufacturer-independent IEC 61131-3 automation software for engineering control systems. It is used in ECI to provide a software PLC (programmable logic controller) for executing real-time control applications. The CODESYS Runtime is capable of performing complex tasks and communicating with industrial communication protocols such as PLCopen OPC UA Transport Layer, Profinet, and EtherCAT. CODESYS global website can be accessed from: https://www.codesys.com/
CODESYS IDE¶
The following section is applicable to:

CODESYS provides an IDE (integrated development environment) for Windows. Using the CODESYS IDE, control applications can be developed, tested, and compiled for the CODESYS Linux runtime. A typical IDE project environment is presented in the image below.

See the following section for instructions on installing the CODESYS IDE to a Windows PC: CODESYS IDE Installation
CODESYS Linux Runtime¶
The following section is applicable to:

Important
CODESYS features must be enabled in the ECI image before CODESYS can be used. Creating an ECI image that contains the CODESYS features can be accomplished by selecting the
CODESYS Software PLC
feature option during image setup. See section Building ECI Targets for more information.![]()
CODESYS provides a Linux runtime that allows control applications to execute on Linux-based systems. The CODESYS Linux runtime is free to use without a license, however it will automatically stop execution after two hours. A license must be purchased and installed if using the CODESYS Linux runtime beyond the two-hour time limit is desired. For information on licensing CODESYS: https://www.codesys.com/the-system/licensing.html
There are two primary licensing methods for the CODESYS Linux runtime:
License Method |
---|
USB Dongle
|
License Soft Container
|
Restarting the CODESYS Linux Runtime¶
The CODESYS Linux runtime will continue to run without a license for up to two hours. If the CODESYS Linux runtime stops running due to the two-hour time limit, it may be restarted using the following command:
systemctl restart codesyscontrol
CODESYS IDE Installation¶
The following section is applicable to:

Setup a PC with a 64-bit version of Windows [ 7 (Service Pack 1 or higher) / 8 / 10 ] installed.
On the Windows PC, open a web browser and download the 64 bit version of CODESYS from the following website:
For US based customers: https://us.store.codesys.com/codesys.html
For non-US based customers: https://store.codesys.com/codesys.html
Note
A free account will need to be created before the download becomes available.
Attention
ECI was validated against CODESYS version: V3.5 SP15 Patch 4 + (64-bit)
Download the CODESYS Control for Linux SL package (
CODESYS Control for Linux SL x.x.x.x.package
) from the following website:For US based customers: https://us.store.codesys.com/codesys-control-for-linux-sl-bundle.html
For non-US based customers: https://store.codesys.com/codesys-control-for-linux-sl-bundle.html
Note
CODESYS Control for Linux SL package is free to download and evaluate. The price listed on the website is for a License Key, which is not required for evaluation purposes. Without the License Key, the CODESYS Linux runtime will operate for up to 2 hours before requiring a restart.
Attention
ECI was validated against CODESYS version: V3.5 SP15 Patch 4 + (64-bit)
Install CODESYS by running the installer downloaded earlier (Name format should be: “CODESYS 64 #.#.#.#.exe”).
Double-click on “CODESYS Control for Linux SL #.#.#.#.package” which was downloaded in the previous steps. This will initiate the CODESYS package manager.
Follow the installation prompts.
The following section is applicable to:

Copy “CODESYS Control for Linux SL #.#.#.#.package” to the
eci-release/codesys_packages
directory of the Linux build system. This ensures that ECI images built with theCODESYS Software PLC
feature option enable contain the same version of the CODESYS Linux runtime as the CODESYS IDE.
CODESYS Runtime Optimizations¶
The following section is applicable to:

ECI images are built with number of useful scripts for improving the real-time performance of the CODESYS Linux runtime. On the target system, navigate to /opt/benchmarking/codesys to find the applicable scripts.
The scripts available at /opt/benchmarking/codesys include:
start_CODESYS_native.sh
: Optimizes the system (see list below), stops non-essential services, and restarts the CODESYS runtime.
start_CODESYS_container.sh
: Optimizes the system (see list below) and starts the containerized CODESYS Linux runtime with RT priority.Note
The
start_CODESYS_container.sh
script assumes the user has completed the CODESYS Containerization section of this guide: Microservice: CODESYS Linux Runtime & CODESYS Edge Gateway
taskset_CODESYS.sh
: Optimizes the system (see list below)In addition to the description above, the provided scripts perform the following runtime optimizations:
Cache allocation technology (CAT) to allocate the entire L2 cache of physical CPU 1 to core 3
Assign benchmark thread affinity to cores 1-3
Assign non-benchmark thread affinity to core 0
Disable kernel machine check interrupt
Increase thread runtime utilization to infinity
CODESYS Example Applications¶
ECI is bundled with CODESYS example applications:
Application #2: CODESYS OPC UA Publish/Subscribe¶
The OPC UA Publish/Subscribe Example makes use of CODESYS and the ECI Edge Control Protocol Bridge to showcase bridging OPC UA Client/Server Model to OPC UA Publish/Subscribe Model. In this example topology, the EC Protocol Bridge establishes a connection as an OPC UA client to the CODESYS Linux Runtime OPC UA server. Data on this OPC UA client/server protocol is bridged to an OPC UA publish/subscribe protocol, which the EC Protocol Bridge makes available.
![]()
CODESYS Benchmark Application¶
The CODESYS benchmark is an example application that allows deterministic control and test of the CODESYS SoftPLC. The application is defined such that a main task occurs every 250us. Within the main task is a configurable workload which iterates a number of user defined times. The specific workload is configurable to either: “floating point”, “arithmetic”, or “boolean” operations. Cycle execution times are measured from which minimum, maximum, and jitter measurements are derived. These measurements allow performance characterization of the CODESYS SoftPLC on the target system.
![]()
CODESYS Example Projects¶
Explore the following topics to learn more about CODESYS:
Section |
Description |
---|---|
Tutorial demonstrating how to setup, configure, and control a PROFINET device using CODESYS. |
|
CODESYS project for measuring system performance. |