Establish rs485 connection with Tool

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) https://www.geeksforgeeks.org/socket-programming-python/ → 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!!!

6 Likes