Guide and example: UR Remote Control via TCPIP

Hi, Thanks for the comment.

about using .URP, there is a rtde_control_loop.urp file in the python library download page, which can be used as start point. please copy it to UR robot then run it.

there are two ways to transfer URP to robot other than using USB:

  1. using FTP to put the urp into robot controller memory;
  2. the urp is finally transferred to UR Script to run in robot controller. So you can draft the function as script lines, then use 30001 port to send it to robot controller, as explained in article above. ##chapter: sending multiple line ##

for example:
(replace the script to read/write register functions.)

import socket

mySocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#change the robot IP address here
host = ‘192.168.56.103’
port = 30001

mySocket.connect((host, port))

script_text=“def test_move():\n”
" global P_start_p=p[.6206, -.1497, .2609, 2.2919, -2.1463, -.0555]\n"
" global P_mid_p=p[.6206, -.1497, .3721, 2.2919, -2.1463, -.0555]\n"
" global P_end_p=p[.6206, -.1497, .4658, 2.2919, -2.1463, -.0555]\n"
" while (True):\n"
" movel(P_start_p, a=1.2, v=0.25)\n"
" movel(P_mid_p, a=1.2, v=0.25)\n"
" movel(P_end_p, a=1.2, v=0.25)\n"
" end\n"
“end\n”

mySocket.send((script_text + “\n”).encode())
mySocket.close()