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

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.

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.

Thanks Kevin.

This is what I get:

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)

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

Doesn’t appear to be one in there:

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

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

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

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

1 Like

I got the same error:
image

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)

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.

Cheers!
Datatype in AB is INT part of a UDT:
image

Ignition Console error:


Corresponding Wireshark capture:
Failure Writing to PLC Tag.zip (304.9 KB)

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

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?

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

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

Awesome, thanks guys.