# Blocking option of Popup function only suspend the calling thread

**URL:** <https://forum.universal-robots.com/t/blocking-option-of-popup-function-only-suspend-the-calling-thread/3217>\
**Category:** URScript\
**Created:** [November 30, 2018, 4:02pm UTC](https://forum.universal-robots.com/t/blocking-option-of-popup-function-only-suspend-the-calling-thread/3217 "2018-11-30T16:02:33Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [November 30, 2018, 4:02pm UTC](https://forum.universal-robots.com/t/blocking-option-of-popup-function-only-suspend-the-calling-thread/3217/1 "2018-11-30T16:02:34Z")

</div>

In URScript API Reference, Popup function has a parameter to suspend the program but it seems to only suspend the calling thread. In this example, variable t1 stop while t2 still increase, so the program is not suspended.

> def test():
> 
> &nbsp;global t1 = 0  
> &nbsp;global t2 = 0
> 
> &nbsp;thread timer():  
> &nbsp;&nbsp;&nbsp;while True:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t1 = t1+1  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if t1 \> 2000:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;popup(“popup”, “test”, False, False, True)  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t1 = 0  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sync()  
> &nbsp;&nbsp;&nbsp;end  
> &nbsp;end
> 
> &nbsp;run timer()
> 
> &nbsp;while True:  
> &nbsp;&nbsp;&nbsp;t2 = t2+1  
> &nbsp;&nbsp;&nbsp;sync()  
> &nbsp;end
> 
> end

If it is the desired behavior, I think documentation should be modify.

---

<div class="post-metadata">

**Author:** ![inu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/inu/32/732_2.png) [@inu](https://forum.universal-robots.com/u/inu)\
**Post date:** [December 3, 2018, 7:13pm UTC](https://forum.universal-robots.com/t/blocking-option-of-popup-function-only-suspend-the-calling-thread/3217/2 "2018-12-03T19:13:07Z")

</div>

Hello,

This is the desired functionality, how you have defined the function above would be the equivalent of using a popup feature in a thread on polyscope, which would show the popup but not interrupt the main program:

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

Where as if the main had a popup the theard below will keep executing even though the main program has been ‘blocked’:

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

I agree the wording is a bit misleading. I’ll check in with our team and see what modifications can be made. Thank you for the heads up!

---

<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:** [December 3, 2018, 7:27pm UTC](https://forum.universal-robots.com/t/blocking-option-of-popup-function-only-suspend-the-calling-thread/3217/3 "2018-12-03T19:27:37Z")

</div>

thanks for the reply!
