# writeBlocking in a Vision Client

**URL:** <https://forum.inductiveautomation.com/t/writeblocking-in-a-vision-client/62427>\
**Category:** Ignition\
**Tags:** ignition81, scripting, ignition80, vision\
**Created:** [July 28, 2022, 7:53pm UTC](https://forum.inductiveautomation.com/t/writeblocking-in-a-vision-client/62427 "2022-07-28T19:53:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 28, 2022, 8:40pm UTC](https://forum.inductiveautomation.com/t/writeblocking-in-a-vision-client/62427/2 "2022-07-28T20:40:31Z")

</div>

> [@BryanB](#):
>
> Should I be creating bindings that I update and have Ignition automatically update the PLC variable

This. You should use binding (direct or indirect) whenever possible.

In almost all cases tag write functions can, and IMHO should, be replaced by a custom property with a bi-directional binding.

For instance:

```auto
system.tag.write*(['[default]path/to/value1'],[100])

```

Could also be something like:

```auto
event.source.customPropertyValue1 = 100

```

Where `customPropertyValue1` is bound to `[default]path/to/value1`

In the event that you need to write a value to a tag in script and time is not critical then use`system.tag.writeAsync()`

If you need to insure that the values are written prior to continuing with another action, then `system.tag.writeBlocking()` is needed. In this case you can utilize `system.util.invokeAysnchronous()` to run on a background thread. If you need to effect changes to UI components, then you can utilize `system.tag.invokeLater()` to accomplish that.

Here is a discussion on a similar topic, it relates to V7.9 but the concepts still apply. `writeSyncronous()` and `writeAllSyncronous()` have been replaced with `wrtieBlocking()` in V8.

> [@Need help understanding system.tag.writeAllSynchronous()](https://forum.inductiveautomation.com/t/need-help-understanding-system-tag-writeallsynchronous/24316/8):
>
> Why do you want to read the tags immediately after you have written them? writeAll is an asynchronous function, so it moves on to the readAll before the writes have actually completed. Read all on the other hand is not asynchronous. It will read the values of the tags at that time which may or may not be after the write has occurred. What are you expecting to happen to the tag values that you need to read them again after the write? Is the controller modifying them? You could use invokeLate…

---

_[View the full topic](https://forum.inductiveautomation.com/t/writeblocking-in-a-vision-client/62427)._
