# Error writing to tag

**URL:** <https://forum.inductiveautomation.com/t/error-writing-to-tag/11963>\
**Category:** Ignition\
**Created:** [July 22, 2016, 5:13pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag/11963 "2016-07-22T17:13:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisDac](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@ChrisDac](https://forum.inductiveautomation.com/u/ChrisDac)\
**Post date:** [July 22, 2016, 5:13pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag/11963/1 "2016-07-22T17:13:53Z")

</div>

I get the same error message as thread: [inductiveautomation.com/forum/v … +attribute](https://inductiveautomation.com/forum/viewtopic.php?f=72&t=14614&start=0&st=0&sk=t&sd=a&hilit=value+supplied+for+attribute)

Only, in my case, the data types are indeed the same. I just upgraded from 7.7.6 to 7.8.3.

Error reads:  
Error writing to tag… (tag path omitted).  
The value supplied for the attribute is not of the same type as the attribute’s value.

Thank you.

---

<div class="post-metadata">

**Author:** ![ChrisDac](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@ChrisDac](https://forum.inductiveautomation.com/u/ChrisDac)\
**Post date:** [July 22, 2016, 5:14pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag/11963/2 "2016-07-22T17:14:29Z")

</div>

Additionally, I’m NOT using Kepware

---

<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:** [July 22, 2016, 5:38pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag/11963/3 "2016-07-22T17:38:49Z")

</div>

Is it the Ignition UA server? What datatype is the tag in the server? In Ignition? How are you writing to the tag?

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [July 27, 2016, 1:59pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag/11963/4 "2016-07-27T13:59:32Z")

</div>

Hi Kevin,

The issue is that NULL values are read from the database and written to tags, prior to version 7.8.3 this wasn’t an issue.

Now when a NULL value is put into a system.tag.write or in a transaction group, it fails with the error “The value supplied for the attribute is not of the same type as the attribute’s value.”

The scripting is an easy fix using some case statements, etc… but I have read on the forums that the best way to tackle the transaction group error would be to create a run always expression that checks the DB column with an If statement and use a zero if its NULL. Is that still recommended?

Thanks

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [July 29, 2016, 5:43pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag/11963/5 "2016-07-29T17:43:23Z")

</div>

SO the error has to do with OPC tags, I guess the OPC-UA spec was updated in version 7.8.3 and NULL values are no longer acceptable. Using memory tags the transaction group works fine.

---

<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:** [July 29, 2016, 5:59pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag/11963/6 "2016-07-29T17:59:41Z")

</div>

What I think is going on is that the logic in the 7.7 UA client code would end up converting null values into some kind of initial/default value for whatever type it was. The new client in 7.8 does not do this.

Our UA server has not ever allowed you to write null values to nodes, so that’s why in 7.8 you’re now finally seeing a Bad\_TypeMismatch error rather than the write succeeding because it used a default value.
