ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A

PLC interfaces

Is there any work going on developing packages for interfacing ROS and different PLCs in the market, such as the one provided by Seimens and Mitsubishi?
Are there already packages for that? ( i couldn’t find anything on google)

most importantly is there any documentation or tutorials on using PLC for mobile robots?

Please let me know if this is not the right forum to discuss this.


Hi @pururastogi,

Generally we keep sensors in this list. I did a quick search and found this work from Siemens, which smells like a step in that direction. There are also a lot of questions in this direction on ROS Answers. Let me know what you find and I can help put together a PLC page for the Wiki.


Hi @pururastogi,
I would suggest using opc-ua to interface the PLCs, there is an implementation here I believe you will need to develop the PLC side of things. Good luck!

1 Like

I also suggest using opcua even if the PLC you are using provides some other proprietary interface. This keeps you from getting locked into one.

ros_opcua_communication works well. I have personally done projects with it using Keba and Siemens PLCs and the freeopcua based implementation.

I just tried building it myself as I’ve heard from others that there may be some difficulties. If you run into errors building it try the following:

sudo apt-get install libmbedtls-dev

Edit ros_opcua_impl_freeopcua’s CMakeLists.txt. Change line 11 to
set(FreeOpcUa_LIBRARIES opcuacore opcuaclient)

It looks like freeopcua changed their library definitions at some point. I’ll look into it more later and open a PR after the holidays.


It is not quite clear from your question what you actually want to achieve, but here is another option you could have a look at: it provides some abstraction layer for different native PLC interfaces.

However in a more typical industrial setup you would either want to use OPCUA as stated above or some fieldbus and do not mess around with the PLC at all from ROS. There are specialists for those boxes. There are some open source stacks for some protocolls like SOEM etc but unless you’re running a realtime kernel already you would want some hardware cards actually. We use the ones from Hilscher but they ask for extra bribes to hand out the linux driver so I would recommend having a look at their competitors first. Ixxat by HMS is one I plan to have a look at.


@simonschmeisser @dougsmith @martimorta
Thanks for your response.

To answer @simonschmeisser question:
I work on mobile robots, so typically what we need to do is get odometry feedback (RPM of each wheel) from PLC and send it the required RPM for each wheel. The PLC through its Ladder logic, should be able to set the RPM for each motors and send the current RPM to the computer where our navigation stack is running.

We were looking for a driver/program, which can run on a computer and talk to the PLC, i.e. send the commanded RPM and receive the feedback. We are not trying to modify the PLC at all, we only set ladder logics in it. We realised that Mistubishi and Siemens have different protocols, hence I asked if someone else faced similar issues before.

I going through OPCUA right now.

Merry Christmas!

Hi @pururastogi
We usually use Modbus over TCP. Most PLC we encountered had a Modbus TCP server.
By using libmodbus, a custom ROS node providing the needed ROS interfaces can be written.


If using smaller PLCs I would second the use of Modbus-TCP, as suggested by @rreignier, as nearly all (even older models) with an Ethernet connection provide this feature.
I actually wrote a driver for arbitrary Modbus-TCP enabled devices just recently. You (and everyone) are welcome to try it and discuss at A new ROS MODBUS/TCP device driver (or github).


Hi @pururastogi,
You could also think about using ROBIN package for Codesys.

With OPC-UA and PLC’s you often have the problem, that update rates of the PLCs are quite low (50Hz) and the servers are quite rudamentary.