Universal Robots Forum

Establish rs485 connection with Tool

Hai,

I am using a UR5e robot and i am trying to communicate with my Custom end-effector tool using rs485. As far as i have tried i am not able to find a way to access(send, receive data) that rs485 pin. Can anyone suggest a way to send commands to a robot end-effector via the rs485. Any help from your side would be of great help.

Thanks in advance,

Hi,

Suggest you read this thread and may give you some idea.

1 Like

Thank you so much for your response @sya . It looks like URCap is the only way to read and write from rs485 tool communication.

Hi @aswanthamang,

It is not necessary to be the form of URCap but it cannot be achieved by Polyscope or ur script directly indeed so far.

Thanks

@sya
Thank you so much for your response. I will try with the daemon first.
Have a good day

I found an easy way to communicate with the rs485 port. And i have documented that elaborately below so that it might be easy for beginners to easily integrate their custom end-effectors in UR robots :-

Download the rs485.urcap file attached here rs485-1.0.urcap
rs485-1.0.urcap (138.7 KB)

Transfer the URCaps file to the Robot controller with the help of this reference:-

Once if the urcap file is loaded successfully you will be able see the output in the teach pendant saying that “RS-485 daemaon runs”

Once if that is achieved, Copy paste the following code in jupyter notebook or any other python programming interface to send and receive the data in TCI from remote port.

import socket
host = 'robot_ip'
port = 54321         # Remains the same, because it is specified as default port in URCaps code
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
s.sendall(b'Hello rs485 port from ash')
data = s.recv(1024)
s.close()
print('Received', repr(data))

References

  1. https://www.tutorialspoint.com/python/python_networking.html → helped in socket python code
    2) Socket Programming in Python - GeeksforGeeks → helped in socket python code
  2. GitHub - UniversalRobots/Universal_Robots_ToolComm_Forwarder_URCap: Utility to forward the UR Tool Communication Interface (RS-485) to a remote PC. → the urcap package that we used
  3. GitHub - BomMadsen/URCap-ToolCommunicationInterface: URCap sample that demonstrates assuming control and using the RS485 TCI interface on e-Series robots. → gives a code level understanding of the URCap daemon (XmlRpc, /dev/ttyTool etc)

I Hope it helped!!!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.