CODESYS is a widely used industrial automation engineering environment for programming PLCs with IEC 61131-3 languages. ROS 2 (Robot Operating System 2) is the modern, distributed robotics middleware standard focused on real-time-capable communication, modularity, and cross-platform support. Combining CODESYS and ROS 2 lets industrial control systems interoperate with advanced robotic capabilities — useful for factory automation, mobile robots, AGVs, collaborative robots, and lab or research deployments.
| Pattern | Direction | Real-time req. | Suggested QoS | |---------|-----------|----------------|----------------| | Sensor streaming | PLC → ROS2 | <5ms latency | BEST_EFFORT, VOLATILE | | Command/control | ROS2 → PLC | Deterministic (<1ms jitter) | RELIABLE, TRANSIENT_LOCAL | | Parameter sync | Bidirectional | >100ms | RELIABLE, PERSISTENT | | Emergency stop | ROS2 → PLC | Priority interrupt | RELIABLE, Deadline 1ms |
For decades, the worlds of industrial automation and mobile robotics have run on parallel, yet distinctly separate, tracks.
On one side, we have CODESYS, the gold standard for industrial programmable logic controllers (PLCs). It is reliable, deterministic, and governed by strict IEC 61131-3 standards. It is the language of the factory floor—handling sensors, actuators, and safety logic with millisecond precision.
On the other side, we have ROS2 (Robot Operating System). This is the dominant framework for robotics research and development. It handles complex motion planning, computer vision, SLAM (Simultaneous Localization and Mapping), and high-level decision-making.
Historically, getting these two to talk required custom middleware, messy socket programming, or expensive hardware gateways. However, as Industry 4.0 advances, the demand for "Industrial ROS" has led to a convergence. Today, integrating CODESYS with ROS2 is not just possible—it is becoming a best practice for building robust, scalable robotic systems.
Abstract The convergence of classical Programmable Logic Controller (PLC) ecosystems and modern robotic software frameworks is a critical challenge in Industry 4.0. CODESYS, a dominant IEC 61131-3 development environment, excels at hard real-time control and fieldbus management (EtherCAT, CANopen). The Robot Operating System 2 (ROS2), built on Data Distribution Service (DDS), provides a flexible, distributed middleware for perception, planning, and collaboration. This paper proposes a formal architecture for integrating CODESYS runtime with ROS2. We analyze communication patterns, data representation mapping, real-time constraints, and security implications. A reference implementation using ROS2-native client libraries for CODESYS is presented, alongside performance benchmarks comparing native DDS versus OPC UA gateway approaches.
Keywords: CODESYS, ROS2, Industrial Robotics, Real-Time Systems, DDS, EtherCAT, IEC 61131-3.
The integration of CODESYS and ROS2 represents the maturation of the robotics industry. We are moving away from "hobbyist" control systems and toward a hybrid model where ROS2 provides the intelligence and CODESYS provides the discipline.
For automation engineers, learning how to interface their PLCs with ROS2 is no longer a niche skill—it is becoming a requirement for building the next generation of intelligent machinery. As the tools for bridging these environments improve, the line between the "Industrial Controller" and the "Robot Brain" will continue to blur.
Unlocking the Power of Industrial Automation with CoDeSys and ROS 2
The world of industrial automation is undergoing a significant transformation. The increasing demand for flexibility, scalability, and interoperability has led to the development of innovative solutions that combine traditional industrial control systems with modern software frameworks. One such combination that has gained significant attention in recent years is CoDeSys and ROS 2.
What is CoDeSys?
CoDeSys (Controller Development System) is a popular software development environment for industrial automation. It provides a comprehensive set of tools for creating, testing, and deploying control applications on a wide range of industrial controllers. CoDeSys is widely used in various industries, including manufacturing, process control, and building automation. codesys ros2
What is ROS 2?
ROS 2 (Robot Operating System 2) is an open-source software framework for building robot applications. It provides a flexible and modular architecture for developing complex robot behaviors, allowing developers to focus on high-level tasks rather than low-level details. ROS 2 is designed to be highly scalable, secure, and reliable, making it suitable for a broad range of applications, from robotics and autonomous systems to industrial automation and IoT.
The Convergence of CoDeSys and ROS 2
The integration of CoDeSys and ROS 2 represents a significant milestone in the evolution of industrial automation. By combining the strengths of CoDeSys in industrial control with the flexibility and modularity of ROS 2, developers can create powerful and scalable control applications that leverage the best of both worlds.
Benefits of CoDeSys and ROS 2 Integration
The integration of CoDeSys and ROS 2 offers several benefits, including:
Use Cases for CoDeSys and ROS 2 Integration
The integration of CoDeSys and ROS 2 has numerous applications in industrial automation, including:
Technical Details of CoDeSys and ROS 2 Integration
The integration of CoDeSys and ROS 2 is achieved through a combination of software components and development tools. Some of the key technical details include:
Conclusion
The integration of CoDeSys and ROS 2 represents a significant milestone in the evolution of industrial automation. By combining the strengths of CoDeSys in industrial control with the flexibility and modularity of ROS 2, developers can create powerful and scalable control applications that leverage the best of both worlds. The benefits of this integration, including improved flexibility, increased scalability, enhanced interoperability, and faster development, make it an attractive solution for a wide range of industrial automation applications. As the industrial automation landscape continues to evolve, the integration of CoDeSys and ROS 2 is likely to play a key role in shaping the future of industrial control systems.
Introduction to CoDeSys and ROS 2
CoDeSys (Controller Development System) is a popular software tool used for developing and programming industrial automation controllers. It provides a comprehensive environment for designing, testing, and deploying control applications. On the other hand, ROS 2 (Robot Operating System 2) is an open-source software framework widely used in robotics and automation for building complex robot applications. It provides a flexible and scalable architecture for developing robot software.
What is CoDeSys?
CoDeSys is a software tool developed by 3S - Smart Software Solutions GmbH, a leading provider of automation software. It allows users to design, test, and deploy control applications for various industrial automation controllers, including programmable logic controllers (PLCs), industrial PCs, and other embedded systems. CoDeSys supports multiple programming languages, including IEC 61131-3 languages (e.g., Ladder Logic, Function Block Diagram, and Structured Text).
What is ROS 2?
ROS 2 is an open-source software framework developed by the Open Source Robotics Foundation (OSRF). It is designed to simplify the development of complex robot applications by providing a flexible and scalable architecture. ROS 2 offers a wide range of features, including:
CoDeSys and ROS 2 Integration
The integration of CoDeSys and ROS 2 enables developers to leverage the strengths of both technologies. By combining CoDeSys's industrial automation expertise with ROS 2's flexibility and scalability, developers can create sophisticated automation applications that benefit from:
Benefits of CoDeSys ROS 2 Integration
The integration of CoDeSys and ROS 2 offers several benefits, including:
Use Cases for CoDeSys ROS 2 Integration
The integration of CoDeSys and ROS 2 can be applied to various industries and applications, including:
Getting Started with CoDeSys ROS 2 Integration
Developers interested in integrating CoDeSys and ROS 2 can follow these steps: CODESYS + ROS 2: Bringing Industrial Control and
Conclusion
The integration of CoDeSys and ROS 2 offers a powerful combination of industrial automation expertise and robotics flexibility. By leveraging the strengths of both technologies, developers can create sophisticated automation applications that benefit from high-performance control, scalability, and flexibility. As the industrial automation and robotics industries continue to evolve, the integration of CoDeSys and ROS 2 is poised to play a key role in shaping the future of automation and robotics development.
Integrating CODESYS with ROS2 bridges the gap between high-level robotic decision-making and robust industrial real-time control. While ROS2 excels at perception and complex path planning, CODESYS provides the deterministic communication needed for industrial hardware. Bridging the Industrial Gap
Combining these two systems creates a powerful architecture where:
CODESYS handles low-level hardware communication (like EtherCAT or CANopen) to ensure reliable, real-time machine safety and motion.
ROS2 manages high-level logic, SLAM, and visualization through its distributed node system. Popular Integration Methods
Because CODESYS and ROS2 don't naturally "speak" the same language, developers typically use one of these bridges:
ROS-Bridge & WebSockets: A common approach involves using a ROS-Bridge client within CODESYS that connects via WebSockets to the ROS network.
Intermediate Protocols: Using Modbus or OPC UA as an intermediary layer. For example, a Python script in the ROS2 workspace can act as a bridge, reading data from CODESYS via Modbus and publishing it to a ROS2 topic.
Direct Driver Development: Writing custom C++ drivers that handle the hardware mapping in a way that remains compatible with ROS2's communication. Getting Started with ROS2 Topics
If you are new to the ROS2 side of the equation, the core communication revolves around topics—anonymous channels where nodes publish or subscribe to data:
Define your data: Use standard messages like geometry_msgs/msg/Twist for motion or create custom messages for specific industrial signals.
Launch a Bridge Node: This node will take your PLC data and use ros2 topic pub to push it into the ROS network. Improved flexibility : CoDeSys provides a comprehensive set
Visualize: Use tools like rqt_graph or the MATLAB Message Viewer to confirm your CODESYS data is successfully streaming across topics.
Are you planning to use a Raspberry Pi as your industrial gateway, or are you working with a specific PLC hardware like Beckhoff or Wago? What is a ROS2 Topic? - ROS2 Tutorial 6