# Guide and example: UR Remote Control via TCPIP

**URL:** <https://forum.universal-robots.com/t/guide-and-example-ur-remote-control-via-tcpip/32973>\
**Category:** Robot Communication\
**Created:** [February 27, 2024, 2:14am UTC](https://forum.universal-robots.com/t/guide-and-example-ur-remote-control-via-tcpip/32973 "2024-02-27T02:14:36Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![tizh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/tizh/32/4176_2.png) [@tizh](https://forum.universal-robots.com/u/tizh)\
**Post date:** [March 11, 2024, 3:02am UTC](https://forum.universal-robots.com/t/guide-and-example-ur-remote-control-via-tcpip/32973/9 "2024-03-11T03:02:20Z")

</div>

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()

---

_[View the full topic](https://forum.universal-robots.com/t/guide-and-example-ur-remote-control-via-tcpip/32973)._
