# Send Data From PC to Robot

**URL:** <https://forum.universal-robots.com/t/send-data-from-pc-to-robot/19371>\
**Category:** Robot Communication\
**Created:** [February 18, 2022, 6:00pm UTC](https://forum.universal-robots.com/t/send-data-from-pc-to-robot/19371 "2022-02-18T18:00:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon11284580](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@anon11284580](https://forum.universal-robots.com/u/anon11284580)\
**Post date:** [February 18, 2022, 6:00pm UTC](https://forum.universal-robots.com/t/send-data-from-pc-to-robot/19371/1 "2022-02-18T18:00:16Z")

</div>

Hello,

I do some Computer Vision on PC. Then, I want to send the location of the objects to the robot for picking up. Which communication protocol suits best to this use case?

---

<div class="post-metadata">

**Author:** ![fujikit](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/fujikit/32/6042_2.png) [@fujikit](https://forum.universal-robots.com/u/fujikit)\
**Post date:** [February 19, 2022, 4:08am UTC](https://forum.universal-robots.com/t/send-data-from-pc-to-robot/19371/2 "2022-02-19T04:08:57Z")

</div>

You can use the socket communication.  
After building the socket server on your pc, the command “socket\_open” can be used on robot program as client.

---

<div class="post-metadata">

**Author:** ![androidflorent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/androidflorent/32/3314_2.png) [@androidflorent](https://forum.universal-robots.com/u/androidflorent)\
**Post date:** [February 19, 2022, 8:10am UTC](https://forum.universal-robots.com/t/send-data-from-pc-to-robot/19371/3 "2022-02-19T08:10:06Z")

</div>

Check out this page which details all the ways you can communicate with your robot: [Overview of client interfaces - 21744](https://www.universal-robots.com/articles/ur/interface-communication/overview-of-client-interfaces/)

To send a position, I advise you either :

- Implement your own TCP socket protocol by creating a socket listener in your PC application and using `socket_open()` in your robot script
- You can also use XML-RPC, which allows you to call from your robot a remote method implemented on your PC that returns the position. The advantage is that you get a position variable in your robot.
- You can also use Primary Interface to ask to move your robot to a certain position by executing a movej via TCP

The articles on the UR website offer simple implementations in Python.

In addition, industrial libraries implement all these protocols and many others. Take a look at this one: [UR+ | Communication & Toolkit Software Library for Universal Robots](https://www.universal-robots.com/plus/products/underautomation/communication-toolkit-software-library/)

> **[Universal Robots Software Library - UnderAutomation](https://underautomation.com)**
>
> Software library that implements for you the various UR communication protocols in .NET, Python, LabVIEW and Matlab. With few software development, your application can synchronize or remote control the cobot.

---

<div class="post-metadata">

**Author:** ![anon11284580](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@anon11284580](https://forum.universal-robots.com/u/anon11284580)\
**Post date:** [February 21, 2022, 1:33am UTC](https://forum.universal-robots.com/t/send-data-from-pc-to-robot/19371/4 "2022-02-21T01:33:00Z")

</div>

Where can I a Python sample for sending a move command to the robot over TCP socket?
