We can expect to see more commercial off‑the‑shelf bridges, improved real‑time support in ROS 2’s DDS middleware (e.g., zero‑copy shared memory transports), and possibly a native CODESYS‑ROS2 communication library directly from CODESYS Group.
But integration in production is never serene. One night, a malformed DDS packet from a development node caused stale status values to propagate into the translator. An edge node retried a fatal sequence three times. The watchdog triggered, CODESYS locked the arm, and the plant went into a protected safe state—lights pulsed, alarms whispered. Operators rushed in. In the postmortem, they found the flaw not in CODESYS nor ROS 2, but in the assumptions between them: who owns authority, what counts as truth, and which failures require graceful recovery versus immediate shutdown.
Several architectural patterns exist for connecting a CODESYS runtime with a ROS 2 system. The right choice depends on performance requirements, existing infrastructure, and the skill set of the development team.
The integration of CODESYS and ROS 2 is a powerful solution for modern industrial automation, combining the real-time reliability of PLCs with the intelligent capabilities of robotics. Developers can choose from multiple integration methods, including using a , OPC UA, shared memory, or ROS Bridge via WebSockets, each suited to different application needs. With the support of advanced tools like CODESYS SoftMotion and the Gazebo simulator, these integrated systems can be efficiently developed, simulated, and deployed. codesys ros2
CODESYS Control Runtime follows a cyclic executive pattern:
Based on community experience and existing projects, here's a practical guide to implementing a CODESYS and ROS 2 integration.
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. We can expect to see more commercial off‑the‑shelf
ROS 2 relies on Data Distribution Service (DDS) as its underlying middleware for publish-subscribe communication.
trigger(CLK:= TRUE); IF trigger.Q THEN ros_pub(execute:= TRUE, topic_name:= '/joint_states', data:= joint_pos); END_IF ros_pub(busy=>);
Combining them tackles a common industrial pain point: low-level hardware integration. A system can be architected where: An edge node retried a fatal sequence three times
In the evolving world of automation, industrial machinery and robotic systems are no longer operating in silos. —traditionally masters of determinism, safety, and I/O handling—are increasingly collaborating with Robot Operating Systems (ROS) , which excel in complex motion planning, AI, and vision.
CoDeSys (Controller Development System) is a software tool for programming and configuring industrial controllers. ROS 2 (Robot Operating System 2) is an open-source software framework for building robot applications. In this post, we'll explore the integration of CoDeSys with ROS 2, enabling the use of CoDeSys controllers in ROS 2 environments.