# Tag write verify

**URL:** <https://forum.inductiveautomation.com/t/tag-write-verify/42230>\
**Category:** Ignition\
**Tags:** vision, scripting, ignition80\
**Created:** [January 13, 2021, 10:36pm UTC](https://forum.inductiveautomation.com/t/tag-write-verify/42230 "2021-01-13T22:36:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [January 13, 2021, 10:36pm UTC](https://forum.inductiveautomation.com/t/tag-write-verify/42230/1 "2021-01-13T22:36:16Z")

</div>

I’m dealing with another PLC system and I need to send tag values (from HMI) and then set a bit that tells this system to use those tag values. My question, what’s the best way to know for sure that Ignition has written the values before I set this bit. Is system.opc.write the best way, or do I need to do a read on all tags to verify and be 100% sure?

---

<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:** [January 13, 2021, 10:57pm UTC](https://forum.inductiveautomation.com/t/tag-write-verify/42230/2 "2021-01-13T22:57:01Z")

</div>

I suppose you’ll have to read the values back and verify them.

Even that’s not 100% though. You have no idea if in between reading the value to verify it and writing to this other bit that something didn’t again change those values… even if that’s unlikely 🙂

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [January 13, 2021, 11:38pm UTC](https://forum.inductiveautomation.com/t/tag-write-verify/42230/3 "2021-01-13T23:38:21Z")

</div>

Thanks @Kevin.Herron

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [January 13, 2021, 11:55pm UTC](https://forum.inductiveautomation.com/t/tag-write-verify/42230/4 "2021-01-13T23:55:14Z")

</div>

Does the order in which I perform the write(s) or define the paths if doing writeBlock matter? Meaning, if I do a writeBlock, can I simply use the last path to do the verify? What if I do a bunch of OPC writes, by using the last one would that “guarantee” anything? These would be fired from within a script, most likely on a button.

---

<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:** [January 14, 2021, 12:03am UTC](https://forum.inductiveautomation.com/t/tag-write-verify/42230/5 "2021-01-14T00:03:36Z")

</div>

There’s only 2 levels of trust here:

1. the tag write didn’t throw exception or return bad quality codes, it must have worked.

2. I read every value I wrote back and verified it is what I expect it to be, it must have worked.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [January 14, 2021, 12:19am UTC](https://forum.inductiveautomation.com/t/tag-write-verify/42230/6 "2021-01-14T00:19:52Z")

</div>

My confusion is I have tested for about 15 minutes and it’s working where all values are updated when I do my bit set. These tags are in the default tag group.

```auto
system.tag.writeBlocking(paths, values)
system.tag.write("[default]MyBitTag",1)

```

I’ve tried to simulate the best I know how for normal conditions, and it hasn’t failed once. Since there are only a handful of tags I think I will still do a read just to make sure.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [January 14, 2021, 5:55am UTC](https://forum.inductiveautomation.com/t/tag-write-verify/42230/7 "2021-01-14T05:55:08Z")

</div>

Couldn’t you verify the timestamp of the last write to the tag is after some other timestamp?

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [January 14, 2021, 5:25pm UTC](https://forum.inductiveautomation.com/t/tag-write-verify/42230/8 "2021-01-14T17:25:46Z")

</div>

Is the timestamp foolproof? Meaning, if I get a timestamp does that actually mean the write was successful, or assumed?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [January 14, 2021, 6:00pm UTC](https://forum.inductiveautomation.com/t/tag-write-verify/42230/9 "2021-01-14T18:00:29Z")

</div>

It’s my understanding and experience that the timestamp indicates the last time the value was updated, whether it was the same value as it held previously or not. I’m not a Tag expert though, so perhaps someone else could weigh-in.
