# Modbus TCP error writing to tag

**URL:** <https://forum.inductiveautomation.com/t/modbus-tcp-error-writing-to-tag/24912>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [May 11, 2019, 3:13pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-error-writing-to-tag/24912 "2019-05-11T15:13:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew.cox](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@andrew.cox](https://forum.inductiveautomation.com/u/andrew.cox)\
**Post date:** [May 11, 2019, 3:13pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-error-writing-to-tag/24912/1 "2019-05-11T15:13:38Z")

</div>

Hello, I have am trying to commission a system using Ignition 8.0.1 that connects to an AD Productivity 3000 using the Modbus TCP driver. It seems to read the tags fine, but does not write to tags. I get the error message: “Error writing “value” to tag (tagname) Bad”. I also cannot seem to find any error messages to this in the logs, any suggestions? A few other posts suggested to ensure that the PLC is setup for external write access, to my knowledge this is enabled. AD tech support is out on the weekends so i’m at a loss

---

<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:** [May 11, 2019, 3:27pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-error-writing-to-tag/24912/2 "2019-05-11T15:27:11Z")

</div>

What’s the address of the tag you’re trying to write to?

---

<div class="post-metadata">

**Author:** ![andrew.cox](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@andrew.cox](https://forum.inductiveautomation.com/u/andrew.cox)\
**Post date:** [May 11, 2019, 3:38pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-error-writing-to-tag/24912/3 "2019-05-11T15:38:25Z")

</div>

I have my tags mapped as INT range 1 to 100, type Holding register(Int16), unitid 0, modbus address 1.

Its not just one specific tag but one is INT3 and another is INT21.1

---

<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:** [May 11, 2019, 3:40pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-error-writing-to-tag/24912/4 "2019-05-11T15:40:39Z")

</div>

Are you sure there’s not an error like the one in [this post](http://forum.inductiveautomation.com/t/writing-a-bit-integer-tag/24409/6) in your gateway logs?

---

<div class="post-metadata">

**Author:** ![andrew.cox](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@andrew.cox](https://forum.inductiveautomation.com/u/andrew.cox)\
**Post date:** [May 11, 2019, 3:46pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-error-writing-to-tag/24912/5 "2019-05-11T15:46:52Z")

</div>

I was able to capture that error in the logs just now. Thank you for the post link, I will check it out.

---

<div class="post-metadata">

**Author:** ![andrew.cox](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@andrew.cox](https://forum.inductiveautomation.com/u/andrew.cox)\
**Post date:** [May 11, 2019, 3:49pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-error-writing-to-tag/24912/6 "2019-05-11T15:49:16Z")

</div>

The post suggests using a script workaround, are there no other ways to write data into the PLC?

---

<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:** [May 11, 2019, 3:51pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-error-writing-to-tag/24912/7 "2019-05-11T15:51:00Z")

</div>

That error occurs when you’re trying to write to a bit within a register word but the PLC doesn’t support the MaskWriteRegister function.

You should hopefully be able to write to whole registers without a script.

---

<div class="post-metadata">

**Author:** ![andrew.cox](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@andrew.cox](https://forum.inductiveautomation.com/u/andrew.cox)\
**Post date:** [May 11, 2019, 3:56pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-error-writing-to-tag/24912/8 "2019-05-11T15:56:46Z")

</div>

Yes, I tested this and it looks like it will work. Are modbus coils written in the same way?

---

<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:** [May 11, 2019, 4:01pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-error-writing-to-tag/24912/9 "2019-05-11T16:01:32Z")

</div>

No coils are already bits, there shouldn’t be any issues writing to them unless the PLC didn’t support it for some reason.

---

<div class="post-metadata">

**Author:** ![andrew.cox](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@andrew.cox](https://forum.inductiveautomation.com/u/andrew.cox)\
**Post date:** [May 11, 2019, 4:05pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-error-writing-to-tag/24912/10 "2019-05-11T16:05:58Z")

</div>

Thank you for your help. I will try it this way
