# Wait command for thread

**URL:** <https://forum.universal-robots.com/t/wait-command-for-thread/20671>\
**Category:** Technical Questions\
**Created:** [April 19, 2022, 10:45am UTC](https://forum.universal-robots.com/t/wait-command-for-thread/20671 "2022-04-19T10:45:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon31463126](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@anon31463126](https://forum.universal-robots.com/u/anon31463126)\
**Post date:** [April 19, 2022, 10:45am UTC](https://forum.universal-robots.com/t/wait-command-for-thread/20671/1 "2022-04-19T10:45:58Z")

</div>

Hi,

Currently attempting to add a wait command to a thread to better manage the timing.

Ideally, the high level logic would be Wait ‘Robot at Conveyor\_Pounce’

‘Conveyor\_Pounce’ is a programmed pose which is selectable as such. I just can’t seem to rack my brain around the function required to run this ‘compare’ to the live robot pose.

Does anyone have any initial ideas?

Cheers!

Zac

---

<div class="post-metadata">

**Author:** ![cags](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/cags/32/6304_2.png) [@cags](https://forum.universal-robots.com/u/cags)\
**Post date:** [April 19, 2022, 12:24pm UTC](https://forum.universal-robots.com/t/wait-command-for-thread/20671/2 "2022-04-19T12:24:09Z")

</div>

An easy approach would be to have a global boolean variable that you set on your main thread when the robot reaches there.’

```auto
# Before_Start
gobal robot_at_conveyor_pounce = False # init value

# Robot program
gobal robot_at_conveyor_pounce = False # do this if the program runs in a loop
do_stuff()
move_to_conveyor
  - Waypoint_1
  - Waypoint_2
  - Conveyor_Pounce
gobal robot_at_conveyor_pounce = True

# Thread_1
wait while (not robot_at_conveyor_pounce)

```

Hope this helps
