# Activate a digital output when any popup is displayed

**URL:** https://forum.universal-robots.com/t/activate-a-digital-output-when-any-popup-is-displayed/20746
**Category:** Technical Questions
**Created:** [April 21, 2022, 12:41pm UTC](https://forum.universal-robots.com/t/activate-a-digital-output-when-any-popup-is-displayed/20746 "2022-04-21T12:41:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![scott.carlson](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@scott.carlson](https://forum.universal-robots.com/u/scott.carlson)
#### Post date: [April 21, 2022, 12:41pm UTC](https://forum.universal-robots.com/t/activate-a-digital-output-when-any-popup-is-displayed/20746/1 "2022-04-21T12:41:35Z")

</div>

Hello,

I am wondering if anyone can tell me if script exists to detect when a pop-up is being shown on the display? I would like to trigger an audible alarm attached to one of the digital outputs when any pop-up appears. There are quite a few pop-ups scattered throughout the code, so I’m looking for something that can be coded once in a separate thread instead of hard-coding the output actions around each pop-up.

Thanks,  
Scott

---

<div class="post-metadata">

### Author: ![MikeM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mikem/32/3114_2.png) [@MikeM](https://forum.universal-robots.com/u/MikeM)
#### Post date: [April 22, 2022, 2:54am UTC](https://forum.universal-robots.com/t/activate-a-digital-output-when-any-popup-is-displayed/20746/2 "2022-04-22T02:54:07Z")

</div>

Welcome to the community!

You could try creating a Subprogram within your Main Program that calls for an I/O trigger & popup. You would then just call the subprogram whenever you need to notify operator, see below:

```auto
SubProgram_1 - NotifyOperator()
   // Turn Alarm On
   set_digital_out(0,True)
   // Show Popup
   popup(“Hello World!”,”Popup Title”, warning=False, error=False, blocking=True)
   // blocking above halts program execution at this line until Continue in popup is pressed
   // Turn Alarm Off
   set_digital_out(0,False)

```

I can think of a few ways but you don’t have to use URscript (shown above, use SET and SUBPROGRAM nodes in Polyscope). Someone else may have a better solution but hope this helps and best of luck!

---

<div class="post-metadata">

### Author: ![scott.carlson](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@scott.carlson](https://forum.universal-robots.com/u/scott.carlson)
#### Post date: [April 22, 2022, 11:30am UTC](https://forum.universal-robots.com/t/activate-a-digital-output-when-any-popup-is-displayed/20746/3 "2022-04-22T11:30:20Z")

</div>

Hi Michael,

Thank you for your response.

While I agree this approach would work, I have a number of different pop-ups throughout a decently large block of code, so I’m hoping to find a solution that does not require modifying each instance.

I know some languages have a function call that will return a boolean to tell if a window is open or not, but haven’t been able to find any information if that is an option here.

Thanks,  
Scott

---

<div class="post-metadata">

### Author: ![anon43903668](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@anon43903668](https://forum.universal-robots.com/u/anon43903668)
#### Post date: [April 28, 2022, 10:20pm UTC](https://forum.universal-robots.com/t/activate-a-digital-output-when-any-popup-is-displayed/20746/4 "2022-04-28T22:20:33Z")

</div>

I will have to try this on a real robot. I only have my emulator right now. Could you change the digital output function to “high when running” ???

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

---

<div class="post-metadata">

### Author: ![anon43903668](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@anon43903668](https://forum.universal-robots.com/u/anon43903668)
#### Post date: [April 28, 2022, 10:43pm UTC](https://forum.universal-robots.com/t/activate-a-digital-output-when-any-popup-is-displayed/20746/5 "2022-04-28T22:43:43Z")

</div>

I wish there were better options for this. you could check the “halt program execution” box at the bottom of your popup commands and designate an output to “Prog running” like I showed above. You could also set a configurable output to “robot moving”.  
The other option would be to buy a PLC with profinet or ethernet and just use it to pull information. You can get one for under $1k which may or may not be cost effective.

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