# Program state from RTDE

**URL:** <https://forum.universal-robots.com/t/program-state-from-rtde/279>\
**Category:** Robot Communication\
**Created:** [October 6, 2016, 1:56pm UTC](https://forum.universal-robots.com/t/program-state-from-rtde/279 "2016-10-06T13:56:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbush](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mbush/32/76_2.png) [@mbush](https://forum.universal-robots.com/u/mbush)\
**Post date:** [October 6, 2016, 1:56pm UTC](https://forum.universal-robots.com/t/program-state-from-rtde/279/1 "2016-10-06T13:56:15Z")

</div>

We are trying to use the program state in some of our data collection and want to know if its possible to get the states that correspond to the decoded values. I have looked at the RTDE documentation as well as the client\_interfaces.xls document and cannot seem to find the states in either location.

Matt

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [October 7, 2016, 9:46am UTC](https://forum.universal-robots.com/t/program-state-from-rtde/279/2 "2016-10-07T09:46:44Z")

</div>

Are you looking for whether a program is running or not?

Using the **Primary** or **Secondary** client interfaces, check out the value `bool isProgramRunning` in the Robot Mode data package. (Message type 16, package type 0)

Using **Realtime** client, check out `ProgramState` which has Gnuplot col. 132 in 3.2/3.3.

Using **RTDE** , check out `runtime_state` which shows program state.

---

<div class="post-metadata">

**Author:** ![mbush](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mbush/32/76_2.png) [@mbush](https://forum.universal-robots.com/u/mbush)\
**Post date:** [October 7, 2016, 12:14pm UTC](https://forum.universal-robots.com/t/program-state-from-rtde/279/3 "2016-10-07T12:14:20Z")

</div>

Jacob,

I already use the program state from the realtime client (we display in our mobile app whether the program is running, paused or stopped in real time to the user), there is nothing in the documentation though telling me what the various states actually mean, we have figured out a couple of them by trial and error but would like to know officially all of the states. I am trying to switch to the RTDE and there is nothing in the documentation there either. We would just like official documentation on what the various states of the program actually mean. For example runtime\_state has no definition while other UINT32 states tell us what the bits actually mean:

 ![](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/37a4f480caf17a4f9bf5a8f873205eebaafbf1dd.png)

You can see the green “Play” button beside robot names for the robots that are currently playing programs in the field. The other robots are showing as powered off currently (some of these are demo robots for testing purposes, some are in Florida and powered down due to the hurricane)

 ![](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/172cfb21f7f4e9ed27f7d29a7c52b6ed1e4db26c.PNG)

As we go through the states in either realtime client or RTDE when we hit the states that we do not know we just pass a null value, it would be nice to know what they were actually.

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [October 19, 2016, 8:57am UTC](https://forum.universal-robots.com/t/program-state-from-rtde/279/4 "2016-10-19T08:57:02Z")

</div>

The `runtime_state` register might change in future releases, and is mainly used internally by the controller.  
Hence documenting this might not be consistent with future releases.

You are welcome to share what you have found with “trial and error” for these bits.

---

<div class="post-metadata">

**Author:** ![malacasse](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/malacasse/32/56_2.png) [@malacasse](https://forum.universal-robots.com/u/malacasse)\
**Post date:** [August 20, 2018, 7:45pm UTC](https://forum.universal-robots.com/t/program-state-from-rtde/279/5 "2018-08-20T19:45:31Z")

</div>

My guest for run\_state values :

Bits 0-2: is program stopped | is program running | is program paused

But why not just give the actual meaning in documentation ?

---

<div class="post-metadata">

**Author:** ![anon61863589](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon61863589](https://forum.universal-robots.com/u/anon61863589)\
**Post date:** [October 27, 2018, 6:43pm UTC](https://forum.universal-robots.com/t/program-state-from-rtde/279/6 "2018-10-27T18:43:30Z")

</div>

I agree. Still no documentation for ProgramState or runtime\_state? If the meanings for the values change, document those changes. At least that way developers using the state will know when things break. Right now it is in limbo.

---

<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:** [March 25, 2020, 12:57pm UTC](https://forum.universal-robots.com/t/program-state-from-rtde/279/7 "2020-03-25T12:57:39Z")

</div>

Currently, I create and operate this enumeration.  
Please refer to this.

![runtime2](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/6/66daab046f863833ea9c082150a71876e5ce948e.png)

---

<div class="post-metadata">

**Author:** ![highouse1990](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@highouse1990](https://forum.universal-robots.com/u/highouse1990)\
**Post date:** [November 30, 2020, 6:02am UTC](https://forum.universal-robots.com/t/program-state-from-rtde/279/8 "2020-11-30T06:02:39Z")

</div>

new runtime\_state added  
RUNTIME\_STATE\_RETRACTING(6).

---

<div class="post-metadata">

**Author:** ![jonas.winter](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jonas.winter/32/2374_2.png) [@jonas.winter](https://forum.universal-robots.com/u/jonas.winter)\
**Post date:** [July 7, 2022, 7:23am UTC](https://forum.universal-robots.com/t/program-state-from-rtde/279/9 "2022-07-07T07:23:01Z")

</div>

A small observation to the `runtime_state`:

The value also changes to 2 (“playing” in the enum above) when the robot position callback is opened:

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

The `is_program_running` flag in the `robot_status` does not show this behavior. As far as I observed this flag is only set after the play button was pressed.
