# Error writing "True" to tag

**URL:** <https://forum.inductiveautomation.com/t/error-writing-true-to-tag/29582>\
**Category:** Ignition\
**Created:** [October 31, 2019, 8:23pm UTC](https://forum.inductiveautomation.com/t/error-writing-true-to-tag/29582 "2019-10-31T20:23:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmcallister](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bmcallister](https://forum.inductiveautomation.com/u/bmcallister)\
**Post date:** [October 31, 2019, 8:23pm UTC](https://forum.inductiveautomation.com/t/error-writing-true-to-tag/29582/1 "2019-10-31T20:23:08Z")

</div>

I have a template repeater that I use for unlocking gates on a work cell. I am using this template repeater on 11 different work cells and each cell has 2 to 6 gates. I have one button on one cell that when pressed, it unlocks the door, but I get a popup that says “Error writing “True” to tag…” Even though I get this error, the button does the required action and the gate unlocks. I have checked that the tag is configured correctly. I have also renamed a known working tag to this tag name and still get the same error.

I am using Version 8.0.5

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [October 31, 2019, 8:27pm UTC](https://forum.inductiveautomation.com/t/error-writing-true-to-tag/29582/2 "2019-10-31T20:27:57Z")

</div>

Is it possible the script run when you press the button is writing to more than one tag and it’s successful writing to the one that unlocks the gate, but not to some other tag?

---

<div class="post-metadata">

**Author:** ![bmcallister](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bmcallister](https://forum.inductiveautomation.com/u/bmcallister)\
**Post date:** [October 31, 2019, 9:24pm UTC](https://forum.inductiveautomation.com/t/error-writing-true-to-tag/29582/3 "2019-10-31T21:24:21Z")

</div>

I have only one tag in Ignition with that name and only one in the PLC.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [October 31, 2019, 9:38pm UTC](https://forum.inductiveautomation.com/t/error-writing-true-to-tag/29582/4 "2019-10-31T21:38:24Z")

</div>

I didn’t mean two tags with the same name (not possible, at least not at the same path), but rather that if your button writes more than one tag, perhaps the one failing to write is not the one that opens the gate (which is obviously succeeding). That said, this is just a guess as you haven’t shared whether the name of the tag in the error message is the tag that unlocks the gate or whether your script(s) write more than one tag or not when the button is pressed. If the name of the tag that is successfully writing is the name in the error message, this would appear to be a bug.

---

<div class="post-metadata">

**Author:** ![bmcallister](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bmcallister](https://forum.inductiveautomation.com/u/bmcallister)\
**Post date:** [November 1, 2019, 5:28pm UTC](https://forum.inductiveautomation.com/t/error-writing-true-to-tag/29582/5 "2019-11-01T17:28:41Z")

</div>

I have uploaded some screen shots. There are 7 gates on this particular cell. FrontLeftGate is the only one that gives me the error when pressed. Since I am using a template and template repeater, all should act the same. I have also provided the tag structure. I am leaning toward this being a bug.

![Gate%20Dataset](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b121ca7f592cde39c31e9a892fd305a16ab957f0.jpeg)

 ![Gate%20Script](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/66459e1ee84d8da9b84cd127a394235b033678fe.jpeg) ![Gate%20Tags](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6a9d00954b196bcf4982a778dcea4d55a6c6f2f5.jpeg) ![Gate%20Template%20Repeater](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/717bb6bf674c9431cfa99f16b4b5a78d1f0db5c5.jpeg) ![Gate%20Template](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6ac687568b84b90363e78864f9062bc518340c58.jpeg)

---

<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 1, 2019, 5:41pm UTC](https://forum.inductiveautomation.com/t/error-writing-true-to-tag/29582/6 "2019-11-01T17:41:27Z")

</div>

Move to the ‘script editor’ tab, and see if it’s doing something like `system.tag.write(<tagname>, "True")` - and if it is, try changing that to `system.tag.write(<tagname>, True)` (with no quotes).

---

<div class="post-metadata">

**Author:** ![bmcallister](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bmcallister](https://forum.inductiveautomation.com/u/bmcallister)\
**Post date:** [November 1, 2019, 5:50pm UTC](https://forum.inductiveautomation.com/t/error-writing-true-to-tag/29582/7 "2019-11-01T17:50:58Z")

</div>

This is currently what is in the script editor.

![Gate%20Script%20Editor](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/7d501494e7c595237c179931929c1d320697cbe1.jpeg)

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [November 1, 2019, 6:55pm UTC](https://forum.inductiveautomation.com/t/error-writing-true-to-tag/29582/8 "2019-11-01T18:55:49Z")

</div>

As Paul said, change that

> value = u'True'

to

> value=True

or better yet

> value = 1

---

<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 1, 2019, 7:11pm UTC](https://forum.inductiveautomation.com/t/error-writing-true-to-tag/29582/9 "2019-11-01T19:11:16Z")

</div>

You also probably want to update the template parameters in question to actual booleans, if they aren’t already - right now, the script helper is treating them as strings throughout.

---

<div class="post-metadata">

**Author:** ![bmcallister](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bmcallister](https://forum.inductiveautomation.com/u/bmcallister)\
**Post date:** [November 1, 2019, 7:51pm UTC](https://forum.inductiveautomation.com/t/error-writing-true-to-tag/29582/10 "2019-11-01T19:51:35Z")

</div>

Changing from value = u’True’ to value = True gives me the same error.  
Changing to value = 1 just changes the error to “Error writing 1 to tag A8/Subline/S800/Gates/FrontLeftGate”

Also, this is only happening with one button out of the 7 on this screen and does not happen to any other of the dozens of buttons on the rest of the line.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [November 1, 2019, 7:55pm UTC](https://forum.inductiveautomation.com/t/error-writing-true-to-tag/29582/11 "2019-11-01T19:55:25Z")

</div>

Can you edit the tag directly in the tag browser?  
Something is different with that tag from the others if only that one fails.  
Is it set for External Access Read/Write in the PLC?  
Is it set for Read/Write in the Ignition tag configuration?
