# How to tell if a process is running?

**URL:** <https://forum.inductiveautomation.com/t/how-to-tell-if-a-process-is-running/41833>\
**Category:** Ignition\
**Tags:** vision, scripting, ignition80\
**Created:** [December 29, 2020, 10:13am UTC](https://forum.inductiveautomation.com/t/how-to-tell-if-a-process-is-running/41833 "2020-12-29T10:13:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esn](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@Esn](https://forum.inductiveautomation.com/u/Esn)\
**Post date:** [December 29, 2020, 10:13am UTC](https://forum.inductiveautomation.com/t/how-to-tell-if-a-process-is-running/41833/1 "2020-12-29T10:13:08Z")

</div>

Hi,

We have a button that if pressed some tags are browsed, read and then displayed in a table component.  
This process takes a few moments and while it runs I’d like to display fx. in a label that the the process is running / working.  
When the process is done I’d like to display done / ready.

How would I go about doing this?

Thanks

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 29, 2020, 12:28pm UTC](https://forum.inductiveautomation.com/t/how-to-tell-if-a-process-is-running/41833/2 "2020-12-29T12:28:49Z")

</div>

Write your label text to “processing” or whatever you want, then call the rest of your stuff inside a function that’s called by system.util.invokeLater. Your gui will be locked up until the script finishes, unless you ask part of it to run after its finished executing (by using invokeLater)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 29, 2020, 6:29pm UTC](https://forum.inductiveautomation.com/t/how-to-tell-if-a-process-is-running/41833/3 "2020-12-29T18:29:57Z")

</div>

No, not invokeLater. That runs a function on the gui thread, too. See this topic:

> [@Update GUI via Asynchronous thread](http://forum.inductiveautomation.com/t/update-gui-via-asynchronous-thread/9666):
>
> I’ve got a script I am experimenting with that can take a lot of time to execute, so I now use the system.util.invokeAsynchronous to run the script in a separate thread to keep the GUI from locking up. I am using the asynchronous thread to copy files from one place to another, and I would like to show the progress of the file copy with a progress bar. How would I go about this? I am importing a few python libraries to do this. import shutil def fileTransfer(): path = system.file.openFile() …

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 29, 2020, 8:58pm UTC](https://forum.inductiveautomation.com/t/how-to-tell-if-a-process-is-running/41833/4 "2020-12-29T20:58:22Z")

</div>

If you just want to display “running” and then “finished” text though, invokeLater is fine, as you can set the text to “running” before calling invokeLater, and “finished” at the the of the function called by invokeLater. Obviously if you want to keep updating the text with a percentage, then you’ll need an async thread

---

<div class="post-metadata">

**Author:** ![Esn](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@Esn](https://forum.inductiveautomation.com/u/Esn)\
**Post date:** [January 8, 2021, 6:24am UTC](https://forum.inductiveautomation.com/t/how-to-tell-if-a-process-is-running/41833/5 "2021-01-08T06:24:21Z")

</div>

Thanks
