Codesys Ros2 [2021] Jun 2026

FUNCTION_BLOCK FB_ROS2_Publisher VAR_INPUT execute : BOOL; topic_name : STRING(64); qos_depth : INT := 10; data : VARIANT; // Points to PLC memory END_VAR VAR_OUTPUT busy : BOOL; error : BOOL; error_id : DWORD; END_VAR

The first test was simple: let a ROS 2 node tell a conveyor to pause if a vision node detected a misaligned board. CODESYS, always wary, demanded unequivocal safety: a hardware interlock and a watchdog that would seize control if messages failed. They implemented a heartbeat over DDS, wrapped it in a CODESYS library, and made the conveyor a cautious partner: it would accept ROS 2 commands only while the heartbeat remained steady. The result was poetry—the vision node shouted “misaligned” and the PLC’s ladder logic honored the command, the belt stilled, and a red LED blinked like a heartbeat finding a rhythm. codesys ros2

If you build mobile robots, autonomous guided vehicles (AGVs), or industrial manipulators, you’ve likely faced this painful choice. Do you use a standard PLC for safety and I/O but struggle with complex navigation? Or do you use ROS 2 for perception and planning but struggle with real-time fieldbus control? Or do you use ROS 2 for perception

For engineers facing the greenfield challenge of Industry 4.0, mastering this bridge is no longer a "nice to have"—it is a competitive necessity. the belt stilled