# UR robot default script to run with Variable values from External python script

**URL:** https://forum.universal-robots.com/t/ur-robot-default-script-to-run-with-variable-values-from-external-python-script/25522
**Category:** General Application Help: How do I?
**Created:** [December 7, 2022, 1:57pm UTC](https://forum.universal-robots.com/t/ur-robot-default-script-to-run-with-variable-values-from-external-python-script/25522 "2022-12-07T13:57:58Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![anon94642087](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@anon94642087](https://forum.universal-robots.com/u/anon94642087)
#### Post date: [December 7, 2022, 1:57pm UTC](https://forum.universal-robots.com/t/ur-robot-default-script-to-run-with-variable-values-from-external-python-script/25522/1 "2022-12-07T13:57:58Z")

</div>

How do i run polyscope default program remotely with variables send to polyscope program from external python code running on host ( PC/raspberry pi).

I tried looking online material but could not find way to run default polyscope script on robot.

---

<div class="post-metadata">

### Author: ![m.hammerton](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@m.hammerton](https://forum.universal-robots.com/u/m.hammerton)
#### Post date: [December 7, 2022, 2:26pm UTC](https://forum.universal-robots.com/t/ur-robot-default-script-to-run-with-variable-values-from-external-python-script/25522/2 "2022-12-07T14:26:23Z")

</div>

chouguleprasad9,  
you need to use the Dashboard server port 29999

[https://www.universal-robots.com/articles/ur/dashboard-server-e-series-port-29999/](https://www.universal-robots.com/articles/ur/dashboard-server-e-series-port-29999/)  
It has examples of python code you can download to help you.

---

<div class="post-metadata">

### Author: ![anon94642087](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@anon94642087](https://forum.universal-robots.com/u/anon94642087)
#### Post date: [December 9, 2022, 3:07pm UTC](https://forum.universal-robots.com/t/ur-robot-default-script-to-run-with-variable-values-from-external-python-script/25522/3 "2022-12-09T15:07:31Z")

</div>

Hi i am more looking to run throw external python script from external pc. in your suggestion it shows example how to run throw socket test software. this is ok with testing purpose. For production environment, external python script is better as it has realtime variables to be sent to robot script .urp .

---

<div class="post-metadata">

### Author: ![m.hammerton](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@m.hammerton](https://forum.universal-robots.com/u/m.hammerton)
#### Post date: [December 12, 2022, 8:18am UTC](https://forum.universal-robots.com/t/ur-robot-default-script-to-run-with-variable-values-from-external-python-script/25522/4 "2022-12-12T08:18:23Z")

</div>

If your looking to send commands over TCP/IP then you should use primary of secondary port  
see [Overview of client interfaces - 21744](https://www.universal-robots.com/articles/ur/interface-communication/overview-of-client-interfaces/) and [Remote Control Via TCP/IP - 16496](https://www.universal-robots.com/articles/ur/interface-communication/remote-control-via-tcpip/) for more details

you will still need the dashboard server for  
Loading and playing programs  
powering on and brake release  
querying robot status  
setting operational mode

your python code will need to read and write to port 29999 for dashboard commands  
and port 30001 for script commands.
