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.
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 :-
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))