Newsboys Foundation

Codesys Ros2 -

Bridging Real-Time Control and Robotic Middleware: An Architectural Framework for CODESYS-ROS2 Integration

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.

  • ROS 2 manages motion planning and trajectory generation; PLC handles low-level motor drives, safety I/O, and hardwired interlocks.
  • Useful when a ROS-native robot requires industrial I/O or safety chains.
  • Single industrial PC or controller runs both a CODESYS runtime and ROS 2 nodes (containerized or co-resident).
  • Offers compact deployment for AGVs or cobots where space and latency matter.

ROS 2 (The Intelligent Layer): Provides the "higher-level" intelligence, including computer vision, SLAM (Simultaneous Localization and Mapping), and path planning. ROS 2 is designed for distributed systems and asynchronous communication using the Data Distribution Service (DDS) middleware. 2. Common Integration Methods codesys ros2