# OPC writeValues Async

**URL:** <https://forum.inductiveautomation.com/t/opc-writevalues-async/111910>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [November 3, 2025, 8:14pm UTC](https://forum.inductiveautomation.com/t/opc-writevalues-async/111910 "2025-11-03T20:14:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![seth](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@seth](https://forum.inductiveautomation.com/u/seth)\
**Post date:** [November 3, 2025, 8:14pm UTC](https://forum.inductiveautomation.com/t/opc-writevalues-async/111910/1 "2025-11-03T20:14:06Z")

</div>

Hi,

I am looking to use the system.opc.writeValues function, but I would like it to be asynchronous like the system.tag.writeAsync function. Is there an easy way to do this in Ignition?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 3, 2025, 8:25pm UTC](https://forum.inductiveautomation.com/t/opc-writevalues-async/111910/2 "2025-11-03T20:25:19Z")

</div>

No, the closest thing would be to fire off the writes inside `system.util.invokeAsynchronous`, but you need to be careful with that kind of thing.

---

<div class="post-metadata">

**Author:** ![seth](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@seth](https://forum.inductiveautomation.com/u/seth)\
**Post date:** [November 3, 2025, 8:40pm UTC](https://forum.inductiveautomation.com/t/opc-writevalues-async/111910/3 "2025-11-03T20:40:09Z")

</div>

What precautions would you recommend? I have a large number of OPC tags to write (in an array) so it currently freezes the GUI for an unacceptably long time, so this seems to be the only solution

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 3, 2025, 8:41pm UTC](https://forum.inductiveautomation.com/t/opc-writevalues-async/111910/4 "2025-11-03T20:41:46Z")

</div>

That might be an okay place to use it, especially since it's being invoked from the GUI instead of e.g. in response to events or in a loop where it might happen more than you think.

What you need to be careful of is making sure that you don't end up with more and more of these threads running in the background.

---

<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:** [November 3, 2025, 8:49pm UTC](https://forum.inductiveautomation.com/t/opc-writevalues-async/111910/5 "2025-11-03T20:49:17Z")

</div>

Sounds like Vision? If so, also be sure to **not** write to any UI properties or call any UI methods from such a background thread. Use `system.util.invokeLater()` and friends to send information/progress back to the foreground. Failure to follow this rule will eventually yield mysterious client crashes or unending freezes.

More info:

> [@Update GUI via Asynchronous thread](https://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() …

(Still relevant for Vision.)

---

<div class="post-metadata">

**Author:** ![seth](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@seth](https://forum.inductiveautomation.com/u/seth)\
**Post date:** [November 3, 2025, 9:36pm UTC](https://forum.inductiveautomation.com/t/opc-writevalues-async/111910/6 "2025-11-03T21:36:05Z")

</div>

> What you need to be careful of is making sure that you don't end up with more and more of these threads running in the background.

Is there a way to check if the process is running already? I know with the Qt threading libraries you can name the threads and then query the system to see if they are running to make sure you don’t double up, is that possible in a similar way here?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 3, 2025, 10:22pm UTC](https://forum.inductiveautomation.com/t/opc-writevalues-async/111910/7 "2025-11-03T22:22:50Z")

</div>

It is possible but somewhat expensive to query threads yourself.

If this within Vision scope, you could use `system.util.getGlobals` to store the actual `Thread` instance returned by `system.util.invokeAsynchronous`, and check the state of that thread object before your next execution; it'll be an instance of `java.lang.Thread` and expose all the methods described here:

> **[Thread (Java SE 17 & JDK 17)](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Thread.html)**
>
> declaration: module: java.base, package: java.lang, class: Thread

Another option would be a global sentinel like a tag (possibly a client tag, if Vision scoped) but there's no true support for locking around tags so it's somewhat more fragile.
