# Tag Write Failing Intermittently

**URL:** <https://forum.inductiveautomation.com/t/tag-write-failing-intermittently/77690>\
**Category:** Ignition\
**Created:** [August 10, 2023, 12:04pm UTC](https://forum.inductiveautomation.com/t/tag-write-failing-intermittently/77690 "2023-08-10T12:04:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cnevalga](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@cnevalga](https://forum.inductiveautomation.com/u/cnevalga)\
**Post date:** [August 10, 2023, 12:04pm UTC](https://forum.inductiveautomation.com/t/tag-write-failing-intermittently/77690/1 "2023-08-10T12:04:47Z")

</div>

Good day. We are encountering an issue when writing tag values using script. We are using system.tag.writeBlocking to write values to specific tags. What happens is the value that we are trying to write to particular tag doesn't get written to a specified tag path. But when we re-run the same script, it will then work without any issues.

As we add more equipment tags, the issue gets more frequent. We are wondering on how we can be able to resolve this issue.

---

<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:** [August 10, 2023, 12:06pm UTC](https://forum.inductiveautomation.com/t/tag-write-failing-intermittently/77690/2 "2023-08-10T12:06:16Z")

</div>

Are you examining the list of returned quality codes from `writeBlocking`? Any that are not good would let you capture the issue on the spot.

---

<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:** [August 10, 2023, 12:08pm UTC](https://forum.inductiveautomation.com/t/tag-write-failing-intermittently/77690/3 "2023-08-10T12:08:55Z")

</div>

> [@cnevalga](#):
>
> What happens is the value that we are trying to write to particular tag doesn't get written to a specified tag path. But when we re-run the same script, it will then work without any issues.

Are you sure it isn’t writing to the path? Is this an OPC tag? Is anything else possibly writing to it?

---

<div class="post-metadata">

**Author:** ![cnevalga](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@cnevalga](https://forum.inductiveautomation.com/u/cnevalga)\
**Post date:** [August 10, 2023, 12:11pm UTC](https://forum.inductiveautomation.com/t/tag-write-failing-intermittently/77690/4 "2023-08-10T12:11:43Z")

</div>

Tag writes are happening on different places within the project. Example, there are instances where we are writing tags from Gateway Message Timer script so we are not seeing the returned quality codes. Is there a way to check this without setting up a gateway logger?

---

<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:** [August 10, 2023, 12:34pm UTC](https://forum.inductiveautomation.com/t/tag-write-failing-intermittently/77690/5 "2023-08-10T12:34:46Z")

</div>

Probably not. You have to deliberately assign the return value to a local variable at the point of the call, and examine it right there. If you are using fire-and-forget messaging, only a logger will let you see what's happening. (I wouldn't log if all returned qualities are good.)
