# Polyscope freezes

**URL:** <https://forum.universal-robots.com/t/polyscope-freezes/5215>\
**Category:** URCap Development\
**Created:** [September 27, 2019, 10:06am UTC](https://forum.universal-robots.com/t/polyscope-freezes/5215 "2019-09-27T10:06:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tal](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@tal](https://forum.universal-robots.com/u/tal)\
**Post date:** [September 27, 2019, 10:06am UTC](https://forum.universal-robots.com/t/polyscope-freezes/5215/1 "2019-09-27T10:06:40Z")

</div>

Hi,

We have developed two different UR Cap for two hardware connected to the UR Controller. While hardware is moving and it goes to system emergency stop the polyscope freezes and we have to power off the teach pendant to regain the controller.

What can be the possible reason and solution?

---

<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:** [September 27, 2019, 10:49am UTC](https://forum.universal-robots.com/t/polyscope-freezes/5215/2 "2019-09-27T10:49:18Z")

</div>

Do you use “thread.sleep(x)” in any threads ?  
When I used “thread.sleep(x)”, the polyscope is freezed.

---

<div class="post-metadata">

**Author:** ![tal](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@tal](https://forum.universal-robots.com/u/tal)\
**Post date:** [September 27, 2019, 11:30am UTC](https://forum.universal-robots.com/t/polyscope-freezes/5215/3 "2019-09-27T11:30:01Z")

</div>

I am not using threading in any Cap. Its two UR Cap with two separate daemon with no communication with each other.

---

<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:** [September 27, 2019, 12:08pm UTC](https://forum.universal-robots.com/t/polyscope-freezes/5215/4 "2019-09-27T12:08:56Z")

</div>

Anything you do in your View-class will by default be blocking calls for PolyScope.  
I.e. if the user clicks a button in yout UI, and it waits for a reply that never comes, this may cause entire PolyScope to freeze.  
If you are doing something that requires time like that, it is recommended to use a Timer and “invokeLater” as demonstrated in the [MyDaemon example](https://github.com/UniversalRobots/MyDaemonSwing/blob/f9fabccb96555e5fcb56a01107354229321cb91a/com.ur.urcap.examples.mydaemonswing/src/main/java/com/ur/urcap/examples/mydaemonswing/impl/MyDaemonInstallationNodeContribution.java#L54-L68).
