# Updating Output registers LIVE

**URL:** <https://forum.universal-robots.com/t/updating-output-registers-live/39105>\
**Category:** Technical Questions\
**Created:** [March 19, 2025, 7:35am UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105 "2025-03-19T07:35:12Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ali.mohammadijou\_1](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ali.mohammadijou\_1](https://forum.universal-robots.com/u/ali.mohammadijou_1)\
**Post date:** [March 19, 2025, 7:35am UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/1 "2025-03-19T07:35:12Z")

</div>

Dear Forum,

I am working with a UR5. I have defined a custom feature plane called “display”.  
I would like to convert the pose wrt Base to the Posewrt Feature and write the X, Y and Z of the result to Output\_Float\_Registers [0], [1] and [2]. and then read these values back in real time via **RTDE**.  
**Solution I came up with** : Add a thread within the programs which does this. Output\_Float\_Registers get updated. Please see photo.  
**But** what if I run a MoveL command via scripting ( **NOT** a program) and want the values get updated the same way ?  
Is there a way to globally define values of Output\_Registers and let them be updated automatically without the need for assigning them each time ?

 ![ThreadSolution](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/9/98b61c009c9661d1babcf26d78b38266c39cc78b.jpeg)

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [March 19, 2025, 12:36pm UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/2 "2025-03-19T12:36:47Z")

</div>

You can name the Register in the IO section of the Installation. This can at least allow you to use a basic Set command to do the assignment. But you still have to assign values to the output registers if you want them to change. Otherwise I reckon you’d have to use something like a Python Daemon that utilizes the RTDE to just read the actual TCP value and do the (probably) complicated math of transforming the pose outside of URScript.

What exactly is wrong with how you’re currently doing it?

---

<div class="post-metadata">

**Author:** ![ali.mohammadijou\_1](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ali.mohammadijou\_1](https://forum.universal-robots.com/u/ali.mohammadijou_1)\
**Post date:** [March 19, 2025, 1:02pm UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/3 "2025-03-19T13:02:20Z")

</div>

Hi Eric,

Thanks for the comment. In the I/O section I can only set Digital or Analog OUTs which does not help much to store actual Pose values.

So the best would be to store them in the Output\_Float\_Registers since RTDE has access to them at 500 Hz. The thing is that I want to always know the TCP position wrt my **feature** plane. But get\_actual\_tcp\_pose() will always give you the position wrt Base frame. So some conversion must always take place.

But imagine a scenario in which you use a simple MoveL command via scripting, and throughout your movement, you want to know you current position wrt to **feature** LIVE via RTDE.  
RTDE has access to get\_actual\_tcp\_pose () in Base frame naturally. But I want to use Rtde Output Float Registers to store conversion values wrt feature. But since I am only running the script MoveL, I am not assigning those values LIVE.

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [March 19, 2025, 1:50pm UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/4 "2025-03-19T13:50:24Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/6/65d31673a1c79dd5d17c24c25333d4d634997aaa.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/8/8cd29de794c7e68cc11b5fb3a2ebbb22e66a2a9c.png)

OK so to start, yes you CAN Set the general purpose registers with the Set command, you just have to NAME them something in the IO Setup screen first. Then they show up in the dropdown list of Inputs/Outputs.

EDIT: Reading a little closer, you say not RUNNING a program. I misread that initially as not using Polyscope. So you’re saying you’re controlling the robot by some other method. There’s a lot of other ways to control the robot, so knowing how you’re doing that will help guide an answer

---

<div class="post-metadata">

**Author:** ![ali.mohammadijou\_1](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ali.mohammadijou\_1](https://forum.universal-robots.com/u/ali.mohammadijou_1)\
**Post date:** [March 19, 2025, 2:25pm UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/5 "2025-03-19T14:25:45Z")

</div>

Eric,

Indeed i also misunderstood your approach, initially i thought you means these I/Os:

 ![Media (16)](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/d/dd9d05a38bc394d28b1602a338906a1e21f7061a.jpeg)

But obviously you meant the GP Output Registers. those are exactly the ones which I initially meant 🙂 So I wanna store the Converted pose values in the Float Output registers LIVE, without needing to assign them continuously. And access them LIVE via RTDE. RTDE has access to those output registers.

Some background info: I am using LabVIEW to control the robot. Robot is a small part of our test sequence (which is fully written in LabVIEW). So it should be fully integrated in our LabVIEW framework. For controlling the robot I use the SDK driver provided by UnderAutomation. and for controlling, I use the PrimaryInterface\>Script\>Send module. which simply sends Scripts to the robot, for instance a MoveL command. on a separate LabVIEW VI, I turn on RTDE at 500 Hz and read the registers LIVE. These reading will be my input to control the robot via PrimaryInterface scripting.

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [March 19, 2025, 4:00pm UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/6 "2025-03-19T16:00:26Z")

</div>

Gotcha. Well you’re outside my area of expertise then 😅 I’ve never worked with LabVIEW so can’t offer any solution to that. Is it possible to add the thread and start it running alongside every other script you send it? So like I understand you just want to send a moveL, but could you send the whole script code for that thread at the start, set it running, then send your MoveL? I’m not sure if you can send and run threads over the primary interface. I’ve never tried.

Otherwise I think you’re probably back to what I alluded to at the beginning. If you’re getting the LIVE values in LabView, you might have to create your own routine OUTSIDE the robot to take those values and transform them into the Frame of your feature. You might be able to find some code to do that (whether that be Python, or Labview or something else)

---

<div class="post-metadata">

**Author:** ![mmi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mmi/32/691_2.png) [@mmi](https://forum.universal-robots.com/u/mmi)\
**Post date:** [March 20, 2025, 10:50am UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/7 "2025-03-20T10:50:36Z")

</div>

If you can do the transformation in labview then RTDE is all the time streaming actual TCP pose wrt base - no script needed.  
Otherwise this approach is correct. Note that thread needs to run just once per cycle - add sync() in the thread loop.

---

<div class="post-metadata">

**Author:** ![ali.mohammadijou\_1](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ali.mohammadijou\_1](https://forum.universal-robots.com/u/ali.mohammadijou_1)\
**Post date:** [March 21, 2025, 10:49am UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/8 "2025-03-21T10:49:34Z")

</div>

Hi mmi,

Thanks for your input. So I tried to activate a thread to update the float register as shown in my first post, and execute a MoveL command. So I send this script via Primary Interface.

“thread Thread\_1():  
while (True):  
$ 9 “posewrtfeature?pose\_trans(pose\_inv(display\_const),get\_actual\_tcp\_pose())”  
global posewrtfeature= pose\_trans ( pose\_inv (p[0.5391674406968558,0.2501721015613766,0.3385201982265926,0.7230735002351665,-0.7705353908790852,-1.3823487705853308]), get\_actual\_tcp\_pose ())  
$ 10 “write\_output\_float\_register(0,posewrtfeature[0])”  
write\_output\_float\_register(0,posewrtfeature[0])  
$ 11 “write\_output\_float\_register(1,posewrtfeature[1])”  
write\_output\_float\_register(1,posewrtfeature[1])  
$ 12 “write\_output\_float\_register(2,posewrtfeature[2])”  
write\_output\_float\_register(2,posewrtfeature[2])  
end  
end  
threadId\_Thread\_1 = run Thread\_1()  
movel(pose\_add(get\_target\_waypoint(),pose\_sub(pose\_trans(p[0.5391674406968558,0.2501721015613766,0.3385201982265926,0.7230735002351665,-0.7705353908790852,-1.3823487705853308],p[0.020000000,0.000000000,0.000000000,0,0,0]),p[0.5391674406968558,0.2501721015613766,0.3385201982265926,0.7230735002351665,-0.7705353908790852,-1.3823487705853308])), a=1.0, v=0.03)”

So what I see, The MoveL command get executed and robot moves, but I dont see the Output\_Float\_Register[0,1,2] getting updated on RTDE side. But When I run a program like in my first post, they do get updated. Do I miss something ?

---

<div class="post-metadata">

**Author:** ![mmi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mmi/32/691_2.png) [@mmi](https://forum.universal-robots.com/u/mmi)\
**Post date:** [March 24, 2025, 8:30am UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/9 "2025-03-24T08:30:56Z")

</div>

This thread needs to be a part of the main program.  
Our software can not execute standalone threads.  
Are you also sending “MoveL” program to primary interface?

In this case “move” needs to be wrapped in program together with thread:

```auto
def moving_and_streaming():
  # define reference feature
  display_const=p[...]
  # start thread streaming transformed poses
  thread stream_pose():
     ...
   end
   run stream_pose()
   # execute move
   movel(...)
end

```

---

<div class="post-metadata">

**Author:** ![ali.mohammadijou\_1](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ali.mohammadijou\_1](https://forum.universal-robots.com/u/ali.mohammadijou_1)\
**Post date:** [March 24, 2025, 2:43pm UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/10 "2025-03-24T14:43:31Z")

</div>

So I tried to wrap everything in a program as you suggested, Still i encounter the same behavior, the “MoveL” command works and robot moves, but Output\_Float registers don’t get updated. And yes I use the primary interface to send commands.

This is the command based on your advice:

def moving\_and\_streaming():  
thread stream\_pose():  
while (True):  
global posewrtfeature= pose\_trans ( pose\_inv (p[0.5391674406968558,0.2501721015613766,0.3385201982265926,0.7230735002351665,-0.7705353908790852,-1.3823487705853308]), get\_actual\_tcp\_pose ())  
write\_output\_float\_register(0,posewrtfeature[0])  
write\_output\_float\_register(1,posewrtfeature[1])  
write\_output\_float\_register(2,posewrtfeature[2])  
end  
end  
run stream\_pose()  
movel(pose\_add(get\_target\_waypoint(),pose\_sub(pose\_trans(p[0.5391674406968558,0.2501721015613766,0.3385201982265926,0.7230735002351665,-0.7705353908790852,-1.3823487705853308],p[0.020000000,0.000000000,0.000000000,0,0,0]),p[0.5391674406968558,0.2501721015613766,0.3385201982265926,0.7230735002351665,-0.7705353908790852,-1.3823487705853308])), a=1.0, v=0.03)  
end

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [March 24, 2025, 3:06pm UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/11 "2025-03-24T15:06:44Z")

</div>

This is exactly the script I was imagining you sending the robot. I also feel like I’ve tried something similar and saw the same results you’re seeing now. I just chalked it up as the primary interface being unable to run threads AT ALL and gave up/moved on. I’d be curious to know if there’s something we’re both missing here.

---

<div class="post-metadata">

**Author:** ![mmi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mmi/32/691_2.png) [@mmi](https://forum.universal-robots.com/u/mmi)\
**Post date:** [March 31, 2025, 2:00pm UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/12 "2025-03-31T14:00:28Z")

</div>

I just tried following - slightly simpler script, and it works perfectly.

```auto
def moving_and_streaming():
    thread send_position():
      while(True):
        local position = get_actual_tcp_pose()
        write_output_float_register(0, position[0])
        write_output_float_register(1, position[1])
        write_output_float_register(2, position[2])
        sync()
      end
    end

    # first move to home position
    movej([0, -1.4, -2, -1.57, 1.6, 0], a=1, v=1)

    # start a thread streaming the position, and execute actual motion
    run send_position()
    movel(p[0.5, 0.5, 0.1, 3.15, 0, 0], a=0.1, v=1)
end

```

It’s sent to primary interface. First it moves robot to some known position, and then starts thread and streams xyz tcp pose (not transformed, but hopefully proves the point)

Note that indentations are important in programs sent to primary interface. This is actually mentioned in script manual. First `def moving_and_streaming():` and last `end` must **not** have any leading white space characters.  
All other lines in between must have **at least one** leading white space character. Otherwise primary interface compiles each line individually.

![script-with-thread-primary](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/2/23b5014a1b8a617443a2873779b607f4c91f853d.gif)

---

<div class="post-metadata">

**Author:** ![ali.mohammadijou\_1](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ali.mohammadijou\_1](https://forum.universal-robots.com/u/ali.mohammadijou_1)\
**Post date:** [April 4, 2025, 11:19am UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/13 "2025-04-04T11:19:44Z")

</div>

Deaar mmi,

thanks for your reply,  
I tried it and it worked for me as well, indeed the trick was in the leading whitespaces.

Regards,  
Ali

---

<div class="post-metadata">

**Author:** ![ali.mohammadijou\_1](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ali.mohammadijou\_1](https://forum.universal-robots.com/u/ali.mohammadijou_1)\
**Post date:** [June 4, 2025, 12:26pm UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/14 "2025-06-04T12:26:44Z")

</div>

Hi mmi,

I send the following script to create a MoveL action and at the same time stream converted positions to Double Output Regsiters.

“def moving\_and\_streaming():  
thread send\_position():  
while(True):  
local position = pose\_trans(pose\_inv(p[0.4885084332082746,0.22652484714191604,0.3729249328877672,0.7542408940800382,-0.7560928630197719,-1.439516258072408]),get\_actual\_tcp\_pose())  
write\_output\_float\_register(0, position[0])  
write\_output\_float\_register(1, position[1])  
write\_output\_float\_register(2, position[2])  
write\_output\_float\_register(3, position[3])  
write\_output\_float\_register(4, position[4])  
write\_output\_float\_register(5, position[5])  
sync()  
end  
end  
run send\_position()  
movel(pose\_add(get\_target\_waypoint(),pose\_sub(pose\_trans(p[0.4885084332082746,0.22652484714191604,0.3729249328877672,0.7542408940800382,-0.7560928630197719,-1.439516258072408],p[0.010000000,0.000000000,0.000000000,0,0,0]),p[0.4885084332082746,0.22652484714191604,0.3729249328877672,0.7542408940800382,-0.7560928630197719,-1.439516258072408])), a=1, v=0.030)  
end”

**Both parts of this command (Streaming and Moving) work fine. the issue is that once the Robot stops moving, I have to wait minimum 200 ms before sending the next MoveL command. Otherwise the robot will go into a maniac state until it hits a wall.**

Can you spot any issues in here ? Do I cause some race conditions or something ? Because I need the robot to perform consecutive MoveL commands almost without delay.

Thanks a lot

---

<div class="post-metadata">

**Author:** ![mmi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mmi/32/691_2.png) [@mmi](https://forum.universal-robots.com/u/mmi)\
**Post date:** [June 5, 2025, 3:18pm UTC](https://forum.universal-robots.com/t/updating-output-registers-live/39105/15 "2025-06-05T15:18:59Z")

</div>

I guess that get\_target\_waypoint() is used incorrectly. This is mostly useful when robot is during the motion, not before starting.  
Is it your intention to use current pose instead (get\_target\_tcp\_pose())?
