# Python ur-e get/set signals

**URL:** https://forum.universal-robots.com/t/python-ur-e-get-set-signals/4312
**Category:** URScript
**Created:** [May 17, 2019, 3:30pm UTC](https://forum.universal-robots.com/t/python-ur-e-get-set-signals/4312 "2019-05-17T15:30:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![anon959368](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@anon959368](https://forum.universal-robots.com/u/anon959368)
#### Post date: [May 17, 2019, 3:30pm UTC](https://forum.universal-robots.com/t/python-ur-e-get-set-signals/4312/1 "2019-05-17T15:30:05Z")

</div>

hi,  
how I can read a signal , set the signal on / off and (if it was possible to) set a point or a variable, Through a python script.  
if you can i need a deep explaination of the procedure if external libraryes are needed.

thanks a lot!

---

<div class="post-metadata">

### Author: ![ajp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ajp/32/471_2.png) [@ajp](https://forum.universal-robots.com/u/ajp)
#### Post date: [May 20, 2019, 3:12am UTC](https://forum.universal-robots.com/t/python-ur-e-get-set-signals/4312/2 "2019-05-20T03:12:10Z")

</div>

Hi @anon959368, the RTDE interface is the preferred method for this kind of interaction with the robot. Check out the python samples at the bottom of this page:

[https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/](https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/)

---

<div class="post-metadata">

### Author: ![anon959368](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@anon959368](https://forum.universal-robots.com/u/anon959368)
#### Post date: [May 20, 2019, 7:00am UTC](https://forum.universal-robots.com/t/python-ur-e-get-set-signals/4312/3 "2019-05-20T07:00:22Z")

</div>

the example of rtde communication is really dispersive and the examples are not very clear to me. I was wondering if it was possible to have an example of how to switch on / off a bit, check the status of a bit and set the coordinates of a pick point

---

<div class="post-metadata">

### Author: ![anpl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/anpl/32/4494_2.png) [@anpl](https://forum.universal-robots.com/u/anpl)
#### Post date: [May 23, 2019, 8:21am UTC](https://forum.universal-robots.com/t/python-ur-e-get-set-signals/4312/4 "2019-05-23T08:21:08Z")

</div>

Hey @anon959368 I have recently released an interface where you can do this over RTDE. See this forum post [Universal Robots RTDE C++/Python Interface](https://forum.universal-robots.com/t/universal-robots-rtde-c-python-interface/4228)

An example of your use case in python would be something like:

```
import rtde_receive
import rtde_control 
rtde_r = rtde_receive.RTDEReceiveInterface("127.0.0.1")
rtde_c = rtde_control.RTDEControlInterface("127.0.0.1")

# Set standard digital out 
rtde_c.setStandardDigitalOut(0, True)
# Get standard digital output bits, returns current state of the digital outputs. 0-7: Standard, 8-15: Configurable, 16-17: Tool
rtde_r.getActualDigitalOutputBits()
# Mask the bits you want.

# Go to a pick point 
pick_point = [-0.143, -0.435, 0.20, -0.001, 3.12, 0.04]
speed = 0.5
acceleration = 0.3
rtde_c.moveL(pick_point, speed, acceleration)

```

Checkout the documentation with examples and API here: [Universal Robots RTDE C++ Interface — ur\_rtde 1.5.5 documentation](https://sdurobotics.gitlab.io/ur_rtde/index.html)
