# Using urscript form rtde

**URL:** <https://forum.universal-robots.com/t/using-urscript-form-rtde/29992>\
**Category:** URScript\
**Created:** [August 16, 2023, 11:29am UTC](https://forum.universal-robots.com/t/using-urscript-form-rtde/29992 "2023-08-16T11:29:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon87078445](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@anon87078445](https://forum.universal-robots.com/u/anon87078445)\
**Post date:** [August 16, 2023, 11:29am UTC](https://forum.universal-robots.com/t/using-urscript-form-rtde/29992/1 "2023-08-16T11:29:39Z")

</div>

I am a mechanical engineering student working in a robotics company, and im trying to work with the function sendCustomScript() in python with the library ur\_rtde.  
This is my code:  
import rtde\_receive  
import rtde\_control

IP = XXXXX  
port = XXXXX  
rtde\_r = rtde\_receive.RTDEReceiveInterface(IP, port)  
rtde\_c = rtde\_control.RTDEControlInterface(IP, port)  
command1 = (  
“movej(p[-0.2,-0.3,0.9,0,0,3.14], 0.1, 0.1, 0,0.1)\n”  
)  
rtde\_c.sendCustomScript(command1)  
print(“he hecho el primer movimiento”)  
command2 = (  
“movej(p[-0.2,-0.2,0.9,0,0,3.14]), 0.1, 0.1, 0,0.1)\n”  
)  
rtde\_c.sendCustomScript(command2)  
print(“he terminado”)

# Desconectamos

rtde\_c.stopScript()  
rtde\_r.disconnect()  
rtde\_c.disconnect()

The problem is the code moves to the first point but doesnt exits the first sendCustomScript so doesnt prints the next print. If anyone knows a solution it will be very helpful.
