# system.tag.writeBlocking VS system.tag.write, When should I use writeBlocking?

**URL:** <https://forum.inductiveautomation.com/t/system-tag-writeblocking-vs-system-tag-write-when-should-i-use-writeblocking/101248>\
**Category:** General Discussion\
**Created:** [January 22, 2025, 6:52pm UTC](https://forum.inductiveautomation.com/t/system-tag-writeblocking-vs-system-tag-write-when-should-i-use-writeblocking/101248 "2025-01-22T18:52:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Reed](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@Robert\_Reed](https://forum.inductiveautomation.com/u/Robert_Reed)\
**Post date:** [January 22, 2025, 6:52pm UTC](https://forum.inductiveautomation.com/t/system-tag-writeblocking-vs-system-tag-write-when-should-i-use-writeblocking/101248/1 "2025-01-22T18:52:10Z")

</div>

All of the examples given to me from prior projects have scripts using system.tag.write. Seems to work well. But when I use the scripting helper, for example on a button, Select "Set Tag Value", the result is writeblocking. Is there anything negative about a writeBlocking that I should avoid by changing the button scripts to nonblocking?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [January 22, 2025, 7:08pm UTC](https://forum.inductiveautomation.com/t/system-tag-writeblocking-vs-system-tag-write-when-should-i-use-writeblocking/101248/2 "2025-01-22T19:08:52Z")

</div>

System.tag.write is deprecated, but kept around to not break scripts on the upgrade from V7.x to V8.x of Ignition. If you are developing new projects, you should be using `writeBlocking` or `writeAsync`.

`writeBlocking` also is more efficient when passed a list of tags and values instead of multiple calls to writing single to tags. Consolidating all of your write calls to a single call of `system.tag.writeblocking` at the end of the script is the preferred approach. There are obviously cases where this is not possible.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 22, 2025, 7:20pm UTC](https://forum.inductiveautomation.com/t/system-tag-writeblocking-vs-system-tag-write-when-should-i-use-writeblocking/101248/3 "2025-01-22T19:20:47Z")

</div>

A difference between the two functions is whether or not the script waits for the write to finish.

Depreciated functions: [system.tag.write | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/deprecated/system-functions/system-tag-deprecated/system-tag-write)

> Writes a value to a tag. Note that this function writes asynchronously. This means that the function does not wait for the write to occur before returning - the write occurs sometime later on a different thread.

Meanwhile, [system.tag.writeBlocking | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-writeBlocking)

> Writes values to tags at the given paths. This function will "block" until the write operation is complete or times out. Meaning, execution of the calling script will pause until this function finishes. This is useful in cases where the tag write must complete before further lines in the same script should execute.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [January 22, 2025, 8:05pm UTC](https://forum.inductiveautomation.com/t/system-tag-writeblocking-vs-system-tag-write-when-should-i-use-writeblocking/101248/4 "2025-01-22T20:05:28Z")

</div>

Technically the closest thing to `system.tag.write` would be [`system.tag.writeAsync`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-writeAsync) as it will not block the script waiting for the write to finish.
