# Receiving variables from URScript to Pc via RTDE

**URL:** <https://forum.universal-robots.com/t/receiving-variables-from-urscript-to-pc-via-rtde/26272>\
**Category:** Robot Communication\
**Created:** [January 18, 2023, 9:08am UTC](https://forum.universal-robots.com/t/receiving-variables-from-urscript-to-pc-via-rtde/26272 "2023-01-18T09:08:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon11040696](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@anon11040696](https://forum.universal-robots.com/u/anon11040696)\
**Post date:** [January 18, 2023, 9:08am UTC](https://forum.universal-robots.com/t/receiving-variables-from-urscript-to-pc-via-rtde/26272/1 "2023-01-18T09:08:45Z")

</div>

Hello everyone,

I managed to connect my windows Pc with my ur3e and now I can read all kinds of data using the following Python script:

> **[GitHub - UniversalRobots/RTDE\_Python\_Client\_Library: RTDE client library and...](https://github.com/UniversalRobots/RTDE_Python_Client_Library)**
>
> RTDE client library and examples. Contribute to UniversalRobots/RTDE\_Python\_Client\_Library development by creating an account on GitHub.

What I do is, I read the tcp pose and the timestamp and convert it into csv file, while my robot runs a URscript, where it drives from waypoint to waypoint.  
My URScript works perfectly fine, and a local int variable “counter” counts after every loop. Now I want to read the variable the same way I do with the tcp pose and add it into the csv file.

It seams like to achieve my goal I should use the I/O Setup in the installation tab and read the output register, but I’ve only been able to receive 0 and 1 and not my local int variable.

Am I on the right path, or should I try something else.

I would be glad for any kind of help  
Best regards,  
Jemsey

---

<div class="post-metadata">

**Author:** ![claudia](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@claudia](https://forum.universal-robots.com/u/claudia)\
**Post date:** [January 19, 2023, 4:16pm UTC](https://forum.universal-robots.com/t/receiving-variables-from-urscript-to-pc-via-rtde/26272/2 "2023-01-19T16:16:48Z")

</div>

Hi Jemsey,  
I think there is no need to use the I/O Setup in the installation tab.

If from your URscript you write the counter variable in a general purpose output integer register, let’s say register 24:

```auto
write_output_integer_register(24, counter)

```

then you should be able to read it from the RTDE client looking for the rtde output `output_int_register_24`.

I’ve never used the python client but this is what I do with my client written in C++.  
I hope I have correctly understood your question

---

<div class="post-metadata">

**Author:** ![anon11040696](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@anon11040696](https://forum.universal-robots.com/u/anon11040696)\
**Post date:** [January 20, 2023, 6:21am UTC](https://forum.universal-robots.com/t/receiving-variables-from-urscript-to-pc-via-rtde/26272/3 "2023-01-20T06:21:24Z")

</div>

Hi Claudia,  
thanks al lot you really helped me out, this is exactly what I needed. It works all perfectly fine now, thanks again.

Best regards,  
Jemsey

---

<div class="post-metadata">

**Author:** ![1759758523](https://avatars.discourse-cdn.com/v4/letter/1/58f4c7/32.png) [@1759758523](https://forum.universal-robots.com/u/1759758523)\
**Post date:** [June 25, 2024, 11:53am UTC](https://forum.universal-robots.com/t/receiving-variables-from-urscript-to-pc-via-rtde/26272/4 "2024-06-25T11:53:28Z")

</div>

Hi Claudia,  
do you know how to read a double type variable in the same way? Meanwhile, the variable changes in a high frequency because it is the statics got from an F/T sensor. Looking forward to your reply!!! Thanks a lot!!! 🥰 🥰 🥰

---

<div class="post-metadata">

**Author:** ![claudia](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@claudia](https://forum.universal-robots.com/u/claudia)\
**Post date:** [July 1, 2024, 7:18am UTC](https://forum.universal-robots.com/t/receiving-variables-from-urscript-to-pc-via-rtde/26272/5 "2024-07-01T07:18:11Z")

</div>

Hi,  
if the sensor you are using is writing an RTDE input (or output) register, for example register 24 as above , you can read it from URScript using the function read\_input\_float\_register(24), or read\_output\_float\_register(24) if the sensor writes on an output register.

Otherwise from an external RTDE client you should look for the variables input\_double\_register\_24 or output\_double\_register\_24

---

<div class="post-metadata">

**Author:** ![1759758523](https://avatars.discourse-cdn.com/v4/letter/1/58f4c7/32.png) [@1759758523](https://forum.universal-robots.com/u/1759758523)\
**Post date:** [July 1, 2024, 8:08am UTC](https://forum.universal-robots.com/t/receiving-variables-from-urscript-to-pc-via-rtde/26272/6 "2024-07-01T08:08:42Z")

</div>

thank you! I will have a try! 🥰
