Modbus TCP connection between robot and PC

Hallo,

I working with a UR CB3 (software version : 3.15.6). I want to communicate with the robot and my pc. I configured the robot’s IP to be in the same network at my PC and I’m able to read inputs, outputs. additional I made a desktop application where I can visualize the inputs and outputs. What i want to do now is to send the robot a bit to start for example the program and because you can’t write the inputs I’m a little bit lost. My question is are there alternatives or internal bits/registers which I can use to write to the robot so that its like simulating inputs?
on the picture you can see what i have done but in the Modbus Client setup. if i understand it correctly you need to put in the client which is in this case the pc and define some variables at a address.
should the connection set itself or are there other options where i need to look?

thank you in advance and best regard.

Great question, I feel like a lot of people opt out of simulating IO.

Modbus could be a good way to do things. All you’d have to do is set up a Modbus slave server for the UR to connect to. We’ve done this before in Python with nice results. Here are some applicable resources:

Modbus Slave Simulator:

Python Library for making your own modbus slave:

Docs:

Hallo,

first of all thank you very much for replying :slight_smile:

But Modbus communication is a Client/server communication. this means that there is a client (eg: pc, PLC), and a server (eg : UR). so normally a client can request for data to the server and the server will send a reply to the request. So why do I need Modbus slave? Also I have creating the desktop app with .NET. so there is no problem to implement MODBUS.

best regards,

hallo,

Also what are “general propose 16 bits registers”? i found it on the excel of data table of the UR. (see photo below)

best regard,

hello,

I found a solution, if you see my previous reply there are some “general purpose registers” → address 128 to 255. With those addresses you can send some simple integers from your pc to your robot. The only thing what you will need in the program of the robot is to add a assignment. So in the robot I create a variable and i assign that variable to “read_port_register(‘address’)”. After i create a button on my desktop application (c# .NET, can also be done with python, c++/c) and i send a value to the robot. in the robot program I add a if statement (e.g. if(variable == 1) → start program).

Here are some references that I use.
https://www.universal-robots.com/articles/ur/interface-communication/modbus-server/

best regards