# UR robot TCP server

**URL:** https://discourse.nodered.org/t/ur-robot-tcp-server/30424
**Category:** General
**Created:** [20 July 2020 22:07 UTC](https://discourse.nodered.org/t/ur-robot-tcp-server/30424 "2020-07-20T22:07:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rowen826](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@rowen826](https://discourse.nodered.org/u/rowen826)
#### Post date: [20 July 2020 22:07 UTC](https://discourse.nodered.org/t/ur-robot-tcp-server/30424/1 "2020-07-20T22:07:21Z")

</div>

Hi,

I am trying to set a TCP(server/client) connection between an UR robot and red-node but it seems that I don't know what I'm doing.

The robot routine is fairly simple. It opens a socket (TCP client) and checks that there is someone listing (it this case SocketTest Server application). If there is someone listening, the data is sent. If there is nobody listening is loop until someone is.

**ie:robot routine:**  
open≔socket\_open("127.0.0.1",21)  
Loop open≟ False  
open≔socket\_open("127.0.0.1",21)  
socket\_send\_string(DATA)

(see [https://www.universal-robots.com/articles/ur-articles/tcpip-socket-communication-via-urscript/](https://www.universal-robots.com/articles/ur-articles/tcpip-socket-communication-via-urscript/))

This works well with SocketTest (server); but when I try to use node-red's TCP nodes I have no luck establishing connection--and I really don't know why. I tried several of the online examples, but maybe I'm missing something. Any help would be great!

THX

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [21 July 2020 08:06 UTC](https://discourse.nodered.org/t/ur-robot-tcp-server/30424/2 "2020-07-21T08:06:21Z")

</div>

what have you tried. a tcp in node set to connect should work - but sometimes you may need root privileges to connect to low order ports (under 1024). If you have control over the far end you may want to try setting the tcp up on a higher port.

---

<div class="post-metadata">

### Author: ![rowen826](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@rowen826](https://discourse.nodered.org/u/rowen826)
#### Post date: [21 July 2020 13:27 UTC](https://discourse.nodered.org/t/ur-robot-tcp-server/30424/3 "2020-07-21T13:27:08Z")

</div>

That worked--I have no idea about the low priority ports.  
Thanks for the help.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [19 September 2020 13:27 UTC](https://discourse.nodered.org/t/ur-robot-tcp-server/30424/4 "2020-09-19T13:27:11Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
