# \[Bug-16808\]Error writing to tag - Result Code: \[Bad\] Bad; unspecified

**URL:** <https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [July 16, 2020, 6:17am UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746 "2020-07-16T06:17:10Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 16, 2020, 6:17am UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/1 "2020-07-16T06:17:10Z")

</div>

v7.9.14

I’m trying to write to an integer tag in an AB PLC, however I’m getting the error below. It doesn’t appear to be affecting any other tag. The tag has read/write external access.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/a/3aff01b4a52566dbd6468616a7fc2d63274e2413.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/c/0c0c5841d47abcb82a41854cb83d91a8e1a6d944.png)

---

<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 16, 2020, 11:35am UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/2 "2020-07-16T11:35:36Z")

</div>

Find the logix logger for WriteTagsRequest and turn it to TRACE before attempting the write again. Should get some more info in the gateway logs.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 16, 2020, 11:52am UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/3 "2020-07-16T11:52:42Z")

</div>

Thanks Kevin.

This is what I get:

```auto
WriteTagsRequest	16Jul2020 21:20:50	Error writing item Line1.TankSelect: status=0x13 [not enough data] , additional=[]
com.digitalpetri.enip.cip.CipResponseException: status=0x13 [not enough data] , additional=[]
at com.digitalpetri.enip.logix.services.WriteTagService.decodeResponse(WriteTagService.java:59)
at com.digitalpetri.enip.logix.services.WriteTagService.decodeResponse(WriteTagService.java:11)
at com.digitalpetri.enip.cip.services.MultipleServicePacketService.decodeResponse(MultipleServicePacketService.java:70)
at com.digitalpetri.enip.cip.services.MultipleServicePacketService.decodeResponse(MultipleServicePacketService.java:18)
at com.digitalpetri.enip.cip.CipClient.lambda$invokeConnected$0(CipClient.java:70)
at java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source)
at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)
at java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
at java.util.concurrent.CompletableFuture.complete(Unknown Source)
at com.digitalpetri.enip.cip.CipClient$ConnectedDataHandler.itemsReceived(CipClient.java:263)
at com.digitalpetri.enip.cip.CipClient.onUnitDataReceived(CipClient.java:232)
at com.digitalpetri.enip.EtherNetIpClient.onChannelRead(EtherNetIpClient.java:194)
at com.digitalpetri.enip.EtherNetIpClient.access$800(EtherNetIpClient.java:49)
at com.digitalpetri.enip.EtherNetIpClient$EtherNetIpClientHandler.lambda$channelRead0$0(EtherNetIpClient.java:319)
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source)
at java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source)
at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

```

---

<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 16, 2020, 11:55am UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/4 "2020-07-16T11:55:52Z")

</div>

Can you try the Logix driver from the 7.9.15 nightly/weekly page?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 16, 2020, 11:57am UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/5 "2020-07-16T11:57:50Z")

</div>

Doesn’t appear to be one in there:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/2/72e99fe5c089ce68f50eaf2f450bf317c1b75b13.png)

---

<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 16, 2020, 12:00pm UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/6 "2020-07-16T12:00:23Z")

</div>

Hmm. If you download the zip distribution maybe there’s one in there?

Few hours away from anyone being online to look into this.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 16, 2020, 12:02pm UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/7 "2020-07-16T12:02:54Z")

</div>

Wow, I didn’t realise it was 5am over there. I thought I was crazy when I started work yesterday at 4:30am…

The zip is downloading. 30s to go

---

<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 16, 2020, 12:03pm UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/8 "2020-07-16T12:03:37Z")

</div>

I keep a weird schedule. I often check the forums over my first cup of coffee at some stupid hour like this.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 16, 2020, 12:10pm UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/9 "2020-07-16T12:10:19Z")

</div>

I got the same error:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/5/756662111405b14c82a06d7fdbdf1a00f5193792.png)

```auto
WriteTagsRequest	16Jul2020 21:38:07	Error writing item Line1.TankSelect: status=0x13 [not enough data] , additional=[]
com.digitalpetri.enip.cip.CipResponseException: status=0x13 [not enough data] , additional=[]
at com.digitalpetri.enip.logix.services.WriteTagService.decodeResponse(WriteTagService.java:59)
at com.digitalpetri.enip.logix.services.WriteTagService.decodeResponse(WriteTagService.java:11)
at com.digitalpetri.enip.cip.services.MultipleServicePacketService.decodeResponse(MultipleServicePacketService.java:70)
at com.digitalpetri.enip.cip.services.MultipleServicePacketService.decodeResponse(MultipleServicePacketService.java:18)
at com.digitalpetri.enip.cip.CipClient.lambda$invokeConnected$0(CipClient.java:70)
at java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source)
at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)
at java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
at java.util.concurrent.CompletableFuture.complete(Unknown Source)
at com.digitalpetri.enip.cip.CipClient$ConnectedDataHandler.itemsReceived(CipClient.java:263)
at com.digitalpetri.enip.cip.CipClient.onUnitDataReceived(CipClient.java:232)
at com.digitalpetri.enip.EtherNetIpClient.onChannelRead(EtherNetIpClient.java:194)
at com.digitalpetri.enip.EtherNetIpClient.access$800(EtherNetIpClient.java:49)
at com.digitalpetri.enip.EtherNetIpClient$EtherNetIpClientHandler.lambda$channelRead0$0(EtherNetIpClient.java:319)
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source)
at java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source)
at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

```

---

<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 16, 2020, 12:12pm UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/10 "2020-07-16T12:12:19Z")

</div>

Okay, someone else will look into this later today. I’m not gonna be around.

I _think_ this is something we fixed, but maybe it’s not back ported into 7.9 for some reason.

It may help if you can get a Wireshark capture of this or at least let me know what the Logix datatype of that tag you’re trying to write is.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 16, 2020, 12:35pm UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/11 "2020-07-16T12:35:42Z")

</div>

Cheers!  
Datatype in AB is INT part of a UDT:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/8/18ed3e41f52bb11aab4cc115e14659f9b24c4837.png)

Ignition Console error:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/a/ba4ddf6207f17d01774b90c153eae658b7044490.png)  
Corresponding Wireshark capture:  
[Failure Writing to PLC Tag.zip](https://forum.inductiveautomation.com/uploads/short-url/w5mtuWqj54rhW4Bc08PaLdwXB9W.zip) (304.9 KB)

Interestingly, if I create a new device and only add that one tag, I can successfully write to it

---

<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 16, 2020, 12:36pm UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/12 "2020-07-16T12:36:42Z")

</div>

And the Ignition tag is also an int, and not a bit within that int?

Did the data type in the PLC change recently, perhaps going from a smaller type to a larger type?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 16, 2020, 12:43pm UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/13 "2020-07-16T12:43:55Z")

</div>

I was looking at an old program (only a week older), I’ll double check if the data type changed in the meantime but I doubt it. There _have_ been some tags added into the UDT in the PLC though.  
I just dragged on the tag from the OPC browser into the tag browser in Ignition for testing, and it dragged in as a Short. I changed to an Int with also no success writing.

EDIT: Might be worth noting that the UDT instance is an alias for an array element as well. I can successfully write to the array element’s version of the tag

EDIT2: Yes, the data type was changed from an INT to a DINT

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [July 16, 2020, 3:48pm UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/14 "2020-07-16T15:48:32Z")

</div>

We can duplicate this issue in-house. The change from a INT to a DINT looks to be what caused it. Internally, a restart of the OPC UA module looks to be resolve the issue. I am opening a ticket for us to fix this in a future version of 7.9.

Garth

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 16, 2020, 9:24pm UTC](https://forum.inductiveautomation.com/t/bug-16808-error-writing-to-tag-result-code-bad-bad-unspecified/36746/15 "2020-07-16T21:24:26Z")

</div>

Awesome, thanks guys.
