what is CoDeSys?

What is CODESYS? From a PLC program to a running machine
Hello, friends,
CODESYS is a software platform for developing industrial control applications. It covers writing a program on a computer, compiling the project and running it on a compatible controller. A useful starting point for understanding what CODESYS is used for is to distinguish the development environment that prepares the program from the runtime that executes it on the device.
Development environment, runtime and hardware
CODESYS Development System is the engineering environment on the computer. The runtime executes the control application on the target device. The hardware provides the processor, memory, inputs, outputs and communication interfaces. These three layers work together, so hardware requirements for CODESYS extend beyond the specifications of the engineering computer.
An industrial computer with a suitable runtime can operate as a SoftPLC; a PLC into which the manufacturer has integrated CODESYS can also be a target. However, PLCs are not automatically compatible with CODESYS. Check the runtime, device description, libraries and software version supported by the manufacturer together.
One of the features that distinguish CODESYS from other PLC software is a common engineering approach across compatible devices from different manufacturers. This can improve project portability, but does not guarantee that a project will run unchanged on different hardware. I/O mapping, drivers and timing need to be reassessed.
Does CODESYS only use Structured Text?
No. The programming languages and editors in CODESYS address different needs. LD expresses contact and coil logic; FBD connects functional blocks; and ST expresses conditions and calculations in text. SFC organises sequences through steps and transitions. CFC is an additional graphical editor for connecting blocks in a freely arranged layout.
The relationship between IEC 61131-3 and CODESYS provides a foundation of shared programming concepts. IL may appear in legacy projects; the manufacturer states that this editor is no longer maintained. For a new learning plan, exploring how Structured Text programming complements graphical logic is a more useful starting point.
What does a CODESYS project contain?
When creating and managing a project, you define the target device, application, program units, tasks and required libraries. A POU is a program organisation unit. A Program organises control execution; a Function produces a calculation result; and a Function Block can retain state in its own instance.
Two timers, for example, can use the same block type while each tracks time through a separate instance. User-defined functions and function blocks allow logic to be reused for similar stations. Data types also define meaning: BOOL represents true/false states, INT an integer, REAL a floating-point value and TIME a duration.
A task cycle is not a waiting loop
Timing and task scheduling in CODESYS determine when a program is called and at which priority. A cyclic task runs repeatedly at a configured interval. That interval does not guarantee that the program will always finish within the required time; execution time and scheduling deviations need to be monitored.
Waiting inside a WHILE loop until a sensor changes is different from cyclic execution. Lengthy loops can exceed task timing limits and trigger a configured watchdog. Using a timer for delays and state or step logic for sequences makes many introductory applications easier to understand.
A small ST example: Three seconds of continuous demand
In this learning example, a variable becomes active when demand and a software permissive remain true together for three seconds. Add an ST POU of type PROGRAM to a cyclic task and check that the TON block from the Standard library is available in the project. Place the first section in the declaration area and the second in the implementation area.
Variable declarations:
VAR
xDemand : BOOL := FALSE;
xPermit : BOOL := FALSE;
xOutput : BOOL := FALSE;
fbDelay : TON;
END_VAR
Code executed on each task cycle:
fbDelay(IN := xDemand AND xPermit, PT := T#3s);
xOutput := fbDelay.Q;
In simulation, set xDemand and xPermit to TRUE. The timer’s ET value shows elapsed time; after three seconds, Q and therefore xOutput become TRUE. If either condition becomes FALSE, the timer resets and the output variable becomes FALSE on the next execution. This example has no physical output mapping.
The learning point is that the program does not wait on one line for three seconds. The task calls it repeatedly, while the timer retains its state and is evaluated on every call. Understanding this distinction is more valuable than memorising commands when learning PLC programming in CODESYS.
Understanding ST statements correctly
Within the CODESYS instruction set, IF selects execution by a condition and CASE by a selector value. FOR repeats with a counter, while WHILE checks its condition before execution. REPEAT…UNTIL checks afterwards, so it executes at least once and ends when the UNTIL condition becomes TRUE.
RETURN provides an early exit from the current block execution; it should not be described as a “RETURN value” statement. A function’s return value is assigned to the function name. Labelled jumps are documented as JMP in the CODESYS ST reference. For beginners, explicit conditions and structured control flow are easier to follow than code complicated by jumps.
What can simulation and debugging show?
Simulation can run the logic of a suitable application without a physical PLC. During debugging in CODESYS, variables and block states can be observed. However, simulation does not update real I/O channels or send fieldbus telegrams; hardware timing and communication behaviour require separate testing.
For the example, first test completion of the delay, then remove demand two seconds into the delay and test loss of the permissive. Does the observed result match the expected result? These small experiments turn concepts from CODESYS training resources into something tangible.
Projects, operator displays and network connections
Projects developed with CODESYS can include machine sequencing, pump control and data acquisition. When designing an industrial automation system, match the required functions to the capabilities of the device and software options. Additional functions such as motion control may require suitable hardware and product components.
Visualization supports operator interface development; WebVisu provides browser-based display and TargetVisu displays on the target device. When reviewing the key features of CODESYS, treat screen development and execution of the PLC application as distinct functions.
Network features include options such as EtherCAT, PROFINET, Modbus, OPC UA and MQTT. For data transfer between CODESYS platforms, support, configuration and data types must match at both ends. A protocol being available in the platform does not establish that every device supports the same role and scope.
Free software, licensing and security
CODESYS Development System V3 is available as a free download. Runtime and additional product licences are assessed separately; a licence included in a controller’s price differs from a separately purchased SoftPLC licence. When downloading CODESYS, check the device manufacturer’s recommended version and required packages.
CODESYS security features include tools for user management, signing and encrypted communication. Availability depends on the version and target. Record who can download programs, which connections are enabled and which version is in operation.
For official references, consult CODESYS Development System, CODESYS Runtime and the TON block documentation. Downloads are available from the official CODESYS Store.
Refine Search
- How are user-defined functions and blocks created in CoDeSys?
- How is a project created and managed in the CoDeSys software?
- How is data transferred between CoDeSys platforms?
- How is PLC programming done in CoDeSys?
- How is Structured Text programming done in CoDeSys?
- How is the debugging process done in CoDeSys?
- How is timing and scheduling done in CoDeSys?
- What are the different data types in CoDeSys and how are they used?
- What are the key features of the CoDeSys software?
- What are the network features in CoDeSys and how are they used?
- What does the command set in CoDeSys include?
- What exactly is CoDeSys and what is it used for?
- What features distinguish CoDeSys from other PLC programming software?
- What is the IEC 61131-3 standard in CoDeSys?
- What kind of hardware do I need to use the CoDeSys software?
- What kind of projects can be developed with CoDeSys?
- What security features does CoDeSys have and how are they used?
- What training resources are available for CoDeSys?