The official CODESYS ROS 2 library is not the only path. Consider these alternatives for specific use cases:
The industry is seeing a massive shift toward "SoftPLCs" running on Linux. CODESYS has fully embraced this with its runtime for Linux ARM and x64 systems.
This is a game-changer. It allows a developer to run the CODESYS runtime and the ROS2 middleware on the same edge computer. This eliminates the need for external cabling or gateway hardware. It allows for shared memory communication between the real-time CODESYS memory space and the ROS2 nodes, drastically reducing latency.
| Method | Mean latency (μs) | Max jitter (μs) | CPU load (one core) | |--------|------------------|----------------|---------------------| | Native DDS (C++) | 85 | 210 | 12% | | CODESYS→ROS2 (lock-free) | 220 | 380 | 18% | | CODESYS→OPC UA→ROS2 | 3850 | 1200 | 25% | codesys ros2
Robot-centric (ROS 2 master)
Hybrid edge device
Gateway-based
Hardware/Software:
Libraries to Install:
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. The official CODESYS ROS 2 library is not the only path
We implemented a CODESYS ROS2 Client Library written in C++ (compiled as a CODESYS External Library) and exposed to IEC code via Function Blocks (FBs).
This paper presented a practical, real-time capable bridge between CODESYS PLCs and ROS2. By embedding a ROS2 client library into the CODESYS runtime and using a lock-free FIFO between the real-time task and a lower-priority spin thread, we achieve mean latencies of 220μs—suitable for high-speed robotic control. The architecture preserves the determinism of IEC 61131-3 code while leveraging the full ROS2 ecosystem. Source code for the CODESYS ROS2 client library is available under Apache 2.0 license (anonymized for review).
Acknowledgments – The authors thank the CODESYS community and ROS-Industrial consortium for feedback. Robot-centric (ROS 2 master)