Standardizing Communication Between ROS2 Nodes and Industrial PLCs
Manufacturing is undergoing a fundamental shift as the wall between Information Technology (IT) and Operational Technology (OT) dissolves. For decades, Programmable Logic Controllers (PLCs) have been the “muscle” of the factory floor, prized for their deterministic reliability. Meanwhile, the Robot Operating System 2 (ROS2) has emerged as the “brain,” enabling advanced perception, navigation, and AI.
Standardizing the communication between these two worlds is no longer a luxury—it is a requirement for modern automation. The rise of autonomous mobile robots (AMRs) and collaborative cells demands a seamless bridge between high-level ROS2 nodes and low-level PLC logic.
Your reading tools
- SimplifyAny section in plain language
- SummarizeThe key points at a glance
- FAQQuick answers to common questions
- NewSpotted a mistake? We fix it in minutes!
Written with AI from the sources listed at the end.
Table of Contents
- The Architectural Challenge: Real-Time vs. “Good Enough”
- Common Protocols for ROS2-PLC Integration
- Modern Standardization Tools and Frameworks
- Best Practices for Implementation
- Summary of Key Takeaways
- Sources
The Architectural Challenge: Real-Time vs. “Good Enough”
The primary hurdle in standardization is the difference in how these systems think. PLCs operate on a scan-based cycle (typically 1ms to 10ms) where missing a deadline can stop a production line for safety reasons. ROS2, built on the Data Distribution Service (DDS) standard, is an asynchronous, message-based middleware [1].
While ROS2 has made significant strides in real-time performance through Quality of Service (QoS) profiles, bridging it to a PLC requires a protocol that respects both industrial determinism and robotics flexibility.
PLCs use a deterministic scan-based cycle ranging from 1ms to 10ms to ensure safety and reliability, whereas ROS2 is an asynchronous, message-based middleware built on the Data Distribution Service (DDS) standard.
Yes, ROS2 can achieve real-time performance by utilizing Quality of Service (QoS) profiles, though it still requires a compatible protocol to bridge its asynchronous nature with the deterministic needs of a PLC.
Common Protocols for ROS2-PLC Integration
Choosing a standard protocol depends on your hardware vendor and the required latency. Here is a breakdown of the current industry standards:
1. OPC UA (The “Gold Standard”)
OPC Unified Architecture (OPC UA) is arguably the most versatile standard for ROS2-PLC communication. It is platform-independent, running on anything from an embedded microcontroller to cloud infrastructure, with built-in encryption, authentication and auditing [4].
-
Best for: Cross-vendor environments (e.g., a Siemens PLC talking to a ROS2 node on an Ubuntu PC).
-
Pros: Rich semantic data modeling; built-in security features.
-
Cons: Higher overhead compared to raw fieldbus protocols; not ideal for ultra-high-speed motion control loops.
2. Modbus TCP (The Universal Fallback)
Modbus is the simplest protocol to implement, often used for basic data exchange like reading sensor values or triggering a robot path.
-
Best for: Simple, non-critical data transfer or legacy hardware.
-
Pros: Easy to debug; supported by almost every PLC on the market.
-
Cons: The protocol itself provides no security against unauthorized commands or interception [7]; not deterministic (jitter can be high).
3. EtherNet/IP and PROFINET
These are the heavy hitters belonging to the Common Industrial Protocol (CIP) family and PI (Profinet & Profibus International) respectively.
-
Best for: High-performance, low-latency control in specific ecosystems. Use EtherNet/IP for Rockwell/Allen-Bradley environments and PROFINET for Siemens-heavy floors.
-
Pros: Faster than Modbus; widely used for I/O and motor drives.
-
Cons: Usually need a gateway or a vendor or community driver to reach ROS 2.
OPC UA is considered the gold standard for cross-vendor environments due to its platform independence, rich semantic data modeling, and built-in security features.
You should use EtherNet/IP or PROFINET for high-performance, low-latency control within specific ecosystems like Rockwell or Siemens, whereas Modbus TCP is better suited for simple, non-critical data transfers on legacy hardware.
No, Modbus TCP typically lacks built-in security features and is not deterministic, making it more suitable for basic data exchange rather than safety-critical control.
Modern Standardization Tools and Frameworks
Rather than “rolling your own” socket communication, the community has developed several standardized frameworks to bridge ROS2 and PLCs:
-
Micro-ROS: For systems where the “PLC” is actually a high-performance microcontroller (like an STM32 or ESP32), Micro-ROS allows you to run ROS2 nodes directly on the hardware, eliminating the bridge entirely [6].
-
Beckhoff ADS Bridge: The beckhoff_ads_hardware_interface package by b-robotized lets
ros2_controlread and write TwinCAT PLC variables over the ADS protocol, bundling them into one read and one write per update [2]; it builds on Beckhoff’s official open-source ADS library [3]. -
Siemens ROXSIE: Siemens offers the SIMATIC Connector for ROS (ROXSIE) to exchange data between ROS 2 and SIMATIC controllers [5].
This level of integration is critical for scaling operations, as discussed in standardizing data communication protocols for heterogeneous robot swarms.
Micro-ROS is a framework that allows ROS2 nodes to run directly on high-performance microcontrollers, effectively eliminating the need for a separate communication bridge between the robot ‘brain’ and the hardware.
Yes: Siemens offers the SIMATIC Connector for ROS (ROXSIE) for exchanging data between ROS 2 and SIMATIC controllers.
Best Practices for Implementation
- Use Shared Memory for High Frequencies: If your ROS2 node and a “Soft PLC” (like CODESYS) are on the same machine, avoid the network stack: a shared-memory link removes network latency and jitter from the loop.
- Map Data Types Carefully: PLCs are strictly typed (Int16, Word, Real). Ensure your ROS2 message types (e.g.,
std_msgs/Float64) are correctly parsed to avoid overflow or precision loss. - Segregate Logic: Keep the Safety and Real-Time Logic (E-stops, limit switches) on the PLC. Keep the Complex Math and Perception (SLAM, MoveIt planning) in ROS2.
If the ROS2 node and a ‘Soft PLC’ (like CODESYS) run on the same physical machine, use a shared-memory link that bypasses the network stack, removing network latency and jitter.
Safety and real-time logic, such as E-stops and limit switches, should remain on the PLC. Complex tasks like SLAM, perception, and motion planning should be handled by ROS2.
PLCs are strictly typed (e.g., Int16, Word), so improper mapping of ROS2 messages can lead to data overflow or precision loss, potentially causing system errors or unsafe behavior.
Summary of Key Takeaways
Decision Matrix
| Requirement | Recommended Protocol |
|---|---|
| High Interoperability | OPC UA |
| Simple Sensor Read/Write | Modbus TCP |
| Deep Siemens Integration | PROFINET / S7 Driver |
| Rockwell/Allen-Bradley | EtherNet/IP |
| High-Speed Controller Access | Shared Memory / ADS |
Action Plan
- Identify the Hardware: Determine if your PLC has a native ROS2 driver or supports industrial standards like OPC UA.
- Define the Data Cycle: Calculate the required update frequency. For simple triggering, 10 Hz is enough; for joint control, aim for 100 Hz+.
- Implement a Bridge: Use a standardized bridge like
ros2_controlhardware interfaces rather than custom TCP scripts to ensure stability. - Test Connectivity: Use tools like Wireshark to monitor packet jitter and ensure the PLC’s watchdog timer doesn’t trip due to network latency.
Standardizing communication between ROS2 and PLCs is the key to moving robotics from the lab to the factory floor. By choosing the right protocol and leveraging existing community frameworks, you can create a system that is both intelligent and industrially robust.
The first step is to identify your hardware and determine if your PLC has a native ROS2 driver or supports industrial standards like OPC UA to establish the best communication path.
Use network monitoring tools like Wireshark to track packet jitter and verify that network latency is low enough to prevent the PLC’s watchdog timer from tripping.