# URX and python control API

**URL:** <https://forum.universal-robots.com/t/urx-and-python-control-api/37521>\
**Category:** Robot Communication\
**Created:** [December 6, 2024, 4:53pm UTC](https://forum.universal-robots.com/t/urx-and-python-control-api/37521 "2024-12-06T16:53:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aghiles.yousfi](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@aghiles.yousfi](https://forum.universal-robots.com/u/aghiles.yousfi)\
**Post date:** [December 6, 2024, 4:53pm UTC](https://forum.universal-robots.com/t/urx-and-python-control-api/37521/1 "2024-12-06T16:53:50Z")

</div>

Hi,

I’m a beginner in robot programming and I’m currently using a UR10e. I was wondering :what are the options on the different methods to control the robot simply using a python script?

I’m aware of the urx library but it is missing the force\_mode() urscript implementation that I need for my application. If I’m correct, it’s based on TCP/IP protocol so can I use the same protocol to implement the force\_mode function?

Thanks  
Aghilès

---

<div class="post-metadata">

**Author:** ![HungNguyen.HopLong](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/hungnguyen.hoplong/32/6617_2.png) [@HungNguyen.HopLong](https://forum.universal-robots.com/u/HungNguyen.HopLong)\
**Post date:** [December 7, 2024, 1:18am UTC](https://forum.universal-robots.com/t/urx-and-python-control-api/37521/2 "2024-12-07T01:18:50Z")

</div>

I think you can send URscript via socket with port 30001 or 30002. And dont forgot to turn the robot control on the controller on “remote control”.  
You can see this topic:

> [@Sending UR-Script to robot via socket connection](https://forum.universal-robots.com/t/sending-ur-script-to-robot-via-socket-connection/24546):
>
> Hello, I am working with an UR5e in my university project. Currently I am trying to activate my gripper through setting the “Tool Digital Output 1” to true, which works when changing its value on the robots controller. While searching for a way I found the possibility of sending an UR-Script command via a socket to the robot. While it seems to work for the examples I found, the value does not change for my robot. Is my code (see below) correct or am I missing something? s = socket.socket(soc…
