Codesys Ros2 | CERTIFIED |

A mobile manipulator with a CODESYS‑based safety PLC controlling gripper and lift, and ROS 2 handling perception and navigation.

Bridging Industry 4.0: Integrating CODESYS with ROS 2 The integration of , the global standard for industrial controller programming, with ROS 2 (Robot Operating System), the premier framework for advanced robotics, represents a significant leap for Industry 4.0 . By combining the deterministic reliability of PLCs with the advanced perception and planning capabilities of ROS 2, engineers can build sophisticated, safety-critical robotic systems. Why Integrate CODESYS and ROS 2?

The CODESYS ROS 2 library supports:

Thanks to the , you no longer have to choose. codesys ros2

Traditional industrial automation often operates in "silos," where PLCs handle high-speed I/O and motor control, while robotic frameworks manage complex tasks like SLAM (Simultaneous Localization and Mapping) or computer vision. Integrating them allows for:

Create a clean interface documentation sheet. Always map 64-bit floats ( LREAL in CODESYS) directly to float64 in ROS2 to prevent truncation or rounding errors during critical navigation math. 3. Coordinate System Transformation

There are three primary methods to establish communication between a CODESYS runtime and a ROS2 node network. The right choice depends on your latency requirements and hardware constraints. 1. The Native DDS Approach (Lowest Latency) A mobile manipulator with a CODESYS‑based safety PLC

Engineers use CODESYS because it offers hard real-time performance. The scan cycle of a PLC is sacred; inputs are read, logic is processed, and outputs are written in a guaranteed timeframe. It is designed to handle the "low-level" reality of hardware: turning on hydraulic valves, reading safety light curtains, and managing motor drives via EtherCAT.

If using the OPC UA method, configure the CODESYS Symbol Configuration to expose your control variables. On the ROS2 side, write a bridge node that subscribes to your robot's /cmd_vel (command velocity) topic and writes those linear and angular velocity vectors directly into the CODESYS OPC UA tags. Step 4: Manage the Determinism Frontier

Implement a heartbeat signal (watchdog timer). Have the ROS2 node increment an integer variable on the PLC at regular intervals. If the PLC notices the number stops changing for more than a few milliseconds, it should safely drop into a controlled stop state. 2. Data Type Mapping Why Integrate CODESYS and ROS 2

Integrating these two ecosystems allows developers to combine the "hard" real-time reliability of a PLC with the cutting-edge libraries of the robotics world. Here is an in-depth look at why this integration matters and how to achieve it. Why Integrate CODESYS with ROS2?

CODESYS (Controller Development System) is the global standard tool for programming controller applications according to the international industrial standard IEC 61131-3. It turns standard embedded or industrial PCs (IPCs) into powerful PLCs. CODESYS manages deterministic real-time tasks, handles industrial fieldbuses (like EtherCAT, PROFINET, and EtherNet/IP), and guarantees predictable execution times down to the microsecond level. What is ROS2?