UDT "ReadStructuredTagsRequest" Error

Hello all,

Environment:
Ignition Version: 8.1.47
Device Connection: 1768-L43S CompactLogix Revision 20.13 (Allen-Bradley Logix Driver)

I created a UDT yesterday and all the tags were happy and connected, but one of the instances continually threw the following "drivers.LogixDriver.Requests.ReadStructuredTagsRequest" error to the gateway logs (but only for ONE of the UDT instances):

java.lang.IndexOutOfBoundsException: readerIndex(4) + length(88) exceeds writerIndex(6): CompositeByteBuf(ridx: 4, widx: 6, cap: 6, components=2)

at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1442)

at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1428)

at io.netty.buffer.AbstractByteBuf.readSlice(AbstractByteBuf.java:879)

at io.netty.buffer.SwappedByteBuf.readSlice(SwappedByteBuf.java:631)

at com.inductiveautomation.xopc.drivers.logix.requests.ReadStructuredTagsRequest.readStructuredTag(ReadStructuredTagsRequest.java:439)

at com.inductiveautomation.xopc.drivers.logix.requests.ReadStructuredTagsRequest.readTag(ReadStructuredTagsRequest.java:268)

at com.inductiveautomation.xopc.drivers.logix.requests.ReadStructuredTagsRequest.handleResponse(ReadStructuredTagsRequest.java:186)

at com.inductiveautomation.xopc.drivers.logix.requests.ReadStructuredTagsRequest.lambda$buildMultipleServicePacketService$2(ReadStructuredTagsRequest.java:117)

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:71)

at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source)

at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)

at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)

at java.base/java.util.concurrent.CompletableFuture.complete(Unknown Source)

at com.digitalpetri.enip.cip.CipClient$ConnectedDataHandler.itemsReceived(CipClient.java:270)

at com.digitalpetri.enip.cip.CipClient.onUnitDataReceived(CipClient.java:239)

at com.digitalpetri.enip.EtherNetIpClient.onChannelRead(EtherNetIpClient.java:196)

at com.digitalpetri.enip.EtherNetIpClient.access$900(EtherNetIpClient.java:50)

at com.digitalpetri.enip.EtherNetIpClient$EtherNetIpClientHandler.lambda$channelRead0$0(EtherNetIpClient.java:346)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.base/java.lang.Thread.run(Unknown Source)

I've done some digging and haven't come up with anything that suggested what might be going on, and I don't really understand the error. As I was typing this up, I disabled and re-enabled that device connection and so far the error hasn't come back (but that might just be a fluke).

I'm including the UDT definition JSON below as well in case there might be something misconfigured. All but 2 of the tags are data type Real in the PLC

Thanks in advance for any help :slight_smile:

{
  "name": "Foam Usage Logging",
  "parameters": {
    "includeGlobal": {
      "dataType": "String",
      "value": ""
    },
    "Asset": {
      "dataType": "Integer"
    }
  },
  "tagType": "UdtType",
  "tags": [
    {
      "opcItemPath": {
        "bindType": "parameter",
        "binding": "ns\u003d1;s\u003d[{InstanceName}]{includeGlobal}{TagName}"
      },
      "valueSource": "opc",
      "dataType": "Int4",
      "name": "FoamTrig",
      "tagType": "AtomicTag",
      "enabled": true,
      "opcServer": "IgnitionOPCUA"
    },
    {
      "opcItemPath": {
        "bindType": "parameter",
        "binding": "ns\u003d1;s\u003d[{InstanceName}]{includeGlobal}{TagName}"
      },
      "valueSource": "opc",
      "dataType": "Float4",
      "name": "PolyTotalSftUseageGrams",
      "tagType": "AtomicTag",
      "opcServer": "IgnitionOPCUA"
    },
    {
      "opcItemPath": {
        "bindType": "parameter",
        "binding": "ns\u003d1;s\u003d[{InstanceName}]{includeGlobal}{TagName}"
      },
      "valueSource": "opc",
      "dataType": "Float4",
      "name": "TotsftIsoUseageGrams",
      "tagType": "AtomicTag",
      "opcServer": "IgnitionOPCUA"
    },
    {
      "value": {
        "bindType": "parameter",
        "binding": "{Asset}"
      },
      "valueSource": "memory",
      "name": "Asset",
      "tagType": "AtomicTag"
    },
    {
      "opcItemPath": {
        "bindType": "parameter",
        "binding": "ns\u003d1;s\u003d[{InstanceName}]{includeGlobal}{TagName}"
      },
      "valueSource": "opc",
      "dataType": "Float4",
      "name": "PolyTotalGallonPerSft",
      "tagType": "AtomicTag",
      "opcServer": "IgnitionOPCUA"
    },
    {
      "opcItemPath": {
        "bindType": "parameter",
        "binding": "ns\u003d1;s\u003d[{InstanceName}]{includeGlobal}{TagName}"
      },
      "valueSource": "opc",
      "dataType": "Float4",
      "name": "IsoTotalGallonPerSft",
      "tagType": "AtomicTag",
      "opcServer": "IgnitionOPCUA"
    },
    {
      "opcItemPath": {
        "bindType": "parameter",
        "binding": "ns\u003d1;s\u003d[{InstanceName}]{includeGlobal}{TagName}"
      },
      "valueSource": "opc",
      "dataType": "Float4",
      "name": "TotIsoUseagePounds",
      "tagType": "AtomicTag",
      "opcServer": "IgnitionOPCUA"
    },
    {
      "opcItemPath": {
        "bindType": "parameter",
        "binding": "ns\u003d1;s\u003d[{InstanceName}]{includeGlobal}{TagName}"
      },
      "valueSource": "opc",
      "dataType": "Float4",
      "name": "PolyTotalUseagePounds",
      "tagType": "AtomicTag",
      "opcServer": "IgnitionOPCUA"
    }
  ]
}

You should be using the legacy driver (CompactLogix) for that firmware.

1 Like

Excellent information, thank you! I hadn't read the documentation on the drivers before now.

If I delete the device connection that currently exists and recreate it with the same name using the correct driver, will my tags reconnect properly or will it break more in my system?

Unfortunately, the legacy drivers have slightly different OPC Item Path syntax--you'll have to fix them all.

Exporting to json and using regexp in a text editor can do the trick.

Dang...

Do you have any example of what might change? Is it predictable?

I think I'll recreate the connection in my sandbox gateway and see what paths are different.

Non-program tags all need global. as a prefix. Arrays repeat the base name in an extra hierarchy level.

1 Like

Thanks again for your help, Phil!

Cough

Um, no.

Whoops, please accept my apology from one Phil to another. :rofl:

1 Like

Wait, you're not Pete???