CODESYS 4
CODESYS 4 is a resource-saving, platform-independent development tool for industrial automation technology according to IEC 61131-3. The user interface runs entirely in the browser and is therefore available on a wide range of operating systems, including Windows, Linux, macOS, iPadOS, and Android. The backend – the actual functional core – is separate from the user interface. It can be run in different environments – desktop, server, cloud, and on-premises – on Windows or Linux, and on x86/x64 and ARM CPU platforms.
During the development of CODESYS 4, the focus has always been on software quality and a solid platform foundation. The functional scope of version 1.0.0.0 is specifically tailored to two application scenarios and will continuously grow in short release cycles (see section Looking ahead to future developments).
Separation of backend and frontend: The graphical user interface is unnecessary for the core functions. This means that CODESYS 4 can be used both interactively in the browser and fully automatically via the command line (headless).
Text-based, open data storage: A project is a directory of readable text files instead of a binary project file.
Shared runtime with CODESYS 3: The generated machine code is identical, and compiled libraries are interchangeable between the two tools.
Target group and application scenarios
CODESYS 4 is intended for users who develop IEC 61131-3 controller applications and want to use established IT methods in automation, such as platform-independent work, version control, CI/CD, and team development. IEC 61131-3 remains the foundation: The programming languages and working methods continue to apply unchanged.
Library development with CI/CD: CODESYS 4 is suitable for developing libraries which are integrated into automated build and release processes. Compiler integration via the command line, file-based project storage, and deterministic dependency resolution are integral parts of the architecture. This allows libraries to be built in a reproducible way and without a graphical interface – on any supported operating system and in any common CI/CD pipeline.
Simple applications: The first version of CODESYS 4 is suitable for straightforward controller applications on a single controller. This includes, for example, small machines, test benches, or applications integrated into devices with a limited number of digital and analog I/O points. You use the editor of the Modbus device (Modbus TCP) to assign I/O variables and download the application to the controller. In online mode, you monitor variables at runtime and adjust parameters. In this way, you cover the essential commissioning workflow fully in CODESYS 4.
For projects which go beyond this, CODESYS 3 is still the tool of choice (see section Classification in the CODESYS portfolio).
Advantages of CODESYS 4
Platform-independence: The user interface of CODESYS 4 runs in any conventional browser and is therefore independent of the operating system of the workplace. The backend runs on Windows and Linux, including x86/x64 and ARM CPU platforms. No virtual machine is required for development on Linux and macOS.
Separation of the frontend and backend makes it possible for CODESYS 4 to operate in different environments:
Desktop application
Local workstation instance open in the browser
Centrally administered multi-user server
Directly on the controller hardware
On a virtual controller (vPLC)
Text-based and open data storage: A key feature of CODESYS 4 is the text-based, UTF-8-encoded data storage. CODESYS 4 works directly at the file level. A project is a directory of readable files. IEC source code is provided as UTF-8 text files, structured data as JSON, device descriptions as XML, and images in their natural format (JPEG, PNG, or SVG). Each element is stored in its own file within an intelligible folder structure.
External access is a particular use case here. Files can be viewed, compared, and merged directly within external standard tools – including text editors, diff tools, Git clients, or in the diff view of GitLab and GitHub. CODESYS 4 formats files in a stable and deterministic manner. This includes consistent line breaks, a fixed order in JSON files, consistent indentation, and the omission of unnecessary metadata. As a result, comparisons show the actual content changes without any complicated formatting noise. Version control is handled by established tools such as Git, SVN, or Mercurial. CODESYS 4 is therefore only one of many tools in the development process and no longer the exclusive "master tool".
Because external changes are possible at any time, CODESYS 4 is designed to handle inconsistencies in a controlled way. For example, after a merge or checkout, CODESYS 4 detects changed files via the file system monitoring, and any errors in the project storage are issued with a notification.
Workspace concept: Projects in CODESYS 4 are organized in workspaces. A workspace combines multiple device and library projects, loaded together and edited side-by-side on an equal basis – comparable to a solution in a modern development environment. There is no primary project – all projects in the workspace can be edited at the same level.
In practice, this means that you develop a Modbus project consisting of a server, a client, and a shared library side by side in a single workspace. If you change a structure in the library, then you can immediately continue working in the server and client applications. Shared code is outsourced to a library which is referenced by all applications. Because library projects are opened and edited in the same workspace, you develop the library and application in one process.
Automation and CI/CD from the ground up: From the outset, CODESYS 4 is designed for Continuous Integration and Continuous Delivery (CI/CD). CLI operation is an equally valid usage variant alongside desktop applications and multi-user servers, not a downstream add-on tool. Because the compiler runs without a graphical interface and generates identical machine code regardless of the tool used, a pipeline builds reproducibly with every commit.
Dependencies are managed according to a pattern which is well-known in modern software development (comparable to npm or NuGet): a manifest file (Libraries.json) describes the desired library references and a lockfile (Libraries.lock.json) records the specific resolution of all direct and indirect dependencies with the version and a SHA384 checksum. Together with semantic versioning (semver), identical source code versions can be built reproducibly.
Shared runtime system with CODESYS 3: CODESYS 4 shares the same runtime system with CODESYS 3. The compiler generates identical machine code in both tools, and compiled libraries are interchangeable in both directions. Code which has been compiled in CODESYS 4 runs on any controller where CODESYS 3 code is currently running – without new target hardware and without runtime recertification. The requirement is a runtime system CODESYS V3.5 SP16 or higher.
Security as part of the architecture: Security in CODESYS 4 is factored in from the ground up (Security by Design). This includes conventional authentication methods, rate limiting, and process isolation – particularly relevant for operation as a multi-user server.
Operation and tools
In version 1.0.0.0, the ST editor and the ladder editor (LD) are provided for programming. The ladder editor has been fully redesigned and is built on a web-based architecture.
A dedicated scripting interface is not provided because the project files are directly accessible and editable. For automation and integration tasks, a comprehensive CLI control is available instead.
Classification in the CODESYS portfolio
The CODESYS 4 application is a fully new development, intended to complement CODESYS 3, not replace it. Both generations will coexist for the foreseeable future and share the same runtime system and the same libraries.
Library development in automated build processes and release processes
Straightforward controller applications on a single controller
Development on Linux or macOS, as well as centrally administered multi-user operation
Complex projects with a full function scope, for example with visualization, motion, or additional fieldbuses
Projects which require the CODESYS Test Manager or the debugger
Tip
If you are already familiar with CODESYS 3, then see the chapter Switching from CODESYS 3 for the conceptual differences and a mapping of the usual functions.
Looking ahead to future developments
CODESYS 4 follows a short release cycle, intended to provide a new major version approximately every two months, which is made possible by a modern technological foundation and comprehensive automated test coverage. Instead of individual patches, full upgrades will be provided.
Succeeding versions will include features such as online changes, additional CLI library commands, the ability to exclude elements from the build, user-installable extensions, and perpetual bug fixes.
Additional graphical editors: The implementation of CFC has begun, and the ladder editor is being extended to include convenient functions. These include smart code support, advanced editing and refactoring functions, drag and drop, ladder monitoring, and error underlining.
More fieldbuses, such as EtherCAT and PROFINET
A strategic focus of further development is the Extension Platform. It will allow for a modular extension of CODESYS 4 with additional functions provided and installed as extensions.