# Error writing to 'tag'. value bad

**URL:** <https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [November 17, 2023, 9:05pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076 "2023-11-17T21:05:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diego\_Cantu](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@Diego\_Cantu](https://forum.inductiveautomation.com/u/Diego_Cantu)\
**Post date:** [November 17, 2023, 9:05pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076/1 "2023-11-17T21:05:37Z")

</div>

Hello everyone, I'm trying to write a tag from the designer, and I'm encountering this error. The connection to the PLC is good, and there don't seem to be any issues with that. Any suggestions for a fix? Thanks.

 ![error](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/1/d1b531306733a3a3bfe07855eef94e4ea2a6cd88.jpeg)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [November 17, 2023, 9:12pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076/2 "2023-11-17T21:12:42Z")

</div>

1. What makes you think there are no issues with the PLC connection?
2. What type of tag? OPC?
3. Can you read the tag in Tag Browser?
4. What is the tag's Quality value?
5. Can you write to the tag in Designer's Tag Browser? (You need Full read/write gateway communication allowed" on the Designer toolbar.)
6. When you got the error was it as a result of trying to write to the tag in the Tag Browser or was it generated by a script?

Tip: screengrabs are usually better than screen photos. Crop them properly!

---

<div class="post-metadata">

**Author:** ![Diego\_Cantu](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@Diego\_Cantu](https://forum.inductiveautomation.com/u/Diego_Cantu)\
**Post date:** [November 17, 2023, 9:20pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076/3 "2023-11-17T21:20:15Z")

</div>

OPC Tag  
i can read the tag in tag browser  
the quality is good  
im in read/write mode  
it is result of trying to write to the tag from tag browser  
thanks!!

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [November 17, 2023, 9:34pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076/4 "2023-11-17T21:34:12Z")

</div>

1. Is the tag's CanWrite property enabled?
2. What type of PLC.
3. What is the datatype in the PLC?
4. What is the OPC tag datatype?
5. What value are you trying to write?
6. Does the PLC have a configuration to enable/disable tag writes?

---

<div class="post-metadata">

**Author:** ![Diego\_Cantu](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@Diego\_Cantu](https://forum.inductiveautomation.com/u/Diego_Cantu)\
**Post date:** [November 21, 2023, 5:47pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076/5 "2023-11-21T17:47:05Z")

</div>

1. Is enabled
2. AllenBradley ControlLogix L72
3. Boolean
4. Ignition OPC-UA Server
5. True  
In previous days, this error didnt appear; the error persists

---

<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:** [November 21, 2023, 5:51pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076/6 "2023-11-21T17:51:24Z")

</div>

1. Show the OPC Item Path in Ignition.

2. Show that location in the PLC's Controller Tags, expanding the tree as needed, and showing the External Access column.

---

<div class="post-metadata">

**Author:** ![matt.eaton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matt.eaton/32/72046_2.png) [@matt.eaton](https://forum.inductiveautomation.com/u/matt.eaton)\
**Post date:** [December 3, 2024, 6:55pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076/7 "2024-12-03T18:55:36Z")

</div>

Damn I'm having the same issue but how did this one end!

hey Phil, you mean on the PLC software right? there's no external access on the Ignition side?

---

<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:** [December 3, 2024, 8:29pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076/8 "2024-12-03T20:29:30Z")

</div>

Yes, plc side.

---

<div class="post-metadata">

**Author:** ![matt.eaton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matt.eaton/32/72046_2.png) [@matt.eaton](https://forum.inductiveautomation.com/u/matt.eaton)\
**Post date:** [December 3, 2024, 8:33pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076/9 "2024-12-03T20:33:52Z")

</div>

1. _What makes you think there are no issues with the PLC connection?_ - All tags from this have good read quality, we can even write to a different tag but not the two we are targetting.
2. _What type of tag? OPC?_ - UDT, then tested with simple OPC
3. _Can you read the tag in Tag Browser?_ - Yes
4. _What is the tag's Quality value?_ - Good
5. _Can you write to the tag in Designer's Tag Browser? (You need Full read/write gateway communication allowed" on the Designer toolbar.)_ - No
6. _When you got the error was it as a result of trying to write to the tag in the Tag Browser or was it generated by a script?_ - Bad from tag browser, script and perspective control
7. _Is the tag's CanWrite property enabled?_ - ReadOnly is false
8. _What type of PLC_ - CompactLogix 1769-L35E
9. _What is the datatype in the PLC?_ - INT - 16 bits - tried writing to the bits, same result
10. _What is the OPC tag datatype?_ - Float4
11. _What value are you trying to write?_ - 2
12. _Does the PLC have a configuration to enable/disable tag writes?_ - Unknown, but Wonderware legacy system writes to these values and Ignition can write to other values on the same PLC
13. _Show the OPC Item Path in Ignition._ - ns=1;s=[main\_ip2a]Global.InfPumpAlt.Lead
14. _Show that location in the PLC's Controller Tags, expanding the tree as needed, and showing the External Access column._ - External access is Read/Write

---

<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:** [December 3, 2024, 8:43pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076/10 "2024-12-03T20:43:04Z")

</div>

You will likely need a Wireshark capture of the failing write.

Also, consider testing with my alternate driver.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [December 3, 2024, 8:43pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076/11 "2024-12-03T20:43:22Z")

</div>

> [@matt.eaton](#):
>
> - _What is the datatype in the PLC?_ - INT - 16 bits - tried writing to the bits, same result
> - _What is the OPC tag datatype?_ - Float4

What happens if you change the OPC tag to a datatype of Integer?

IIRC Floats on Compact Logix are 32bit, so it might be complaining that its receiving a command to put a 32 bit float into a 16 bit int. I guess its partly up to how the driver handles that.

---

<div class="post-metadata">

**Author:** ![matt.eaton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matt.eaton/32/72046_2.png) [@matt.eaton](https://forum.inductiveautomation.com/u/matt.eaton)\
**Post date:** [December 3, 2024, 8:46pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076/12 "2024-12-03T20:46:09Z")

</div>

I'll double check but I played with the OPC tag type to Int, short, long and then boolean when I was trying to write to the bit.

Also the working (non-target tag) works with Float4 and appears the same on the PLC side.

_Confirmed, no difference with different data types_

@pturmel - Seen, I'll try those options.

---

<div class="post-metadata">

**Author:** ![matt.eaton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matt.eaton/32/72046_2.png) [@matt.eaton](https://forum.inductiveautomation.com/u/matt.eaton)\
**Post date:** [December 11, 2024, 5:21pm UTC](https://forum.inductiveautomation.com/t/error-writing-to-tag-value-bad/82076/14 "2024-12-11T17:21:52Z")

</div>

I'm a firm believer in closing out these issues.  
So after reading these points I went to the Edge (where our PLC connection is to install wireshark) and took a look at the logs.

We got back status code 15 and I passed that along to the client.  
End result was a different set of registers to write to
