Troubleshooting
Why a ControlLogix OPC UA struct reads Bad_DecodingError in Ignition
Short answer
Bad_DecodingError means the read reached the controller and the structure came back, but the client had no codec to decode it: Ignition 8.1 builds structure codecs from the legacy OPC Binary DataTypeDictionary, while the Logix server describes the UDT through the OPC UA 1.04 DataTypeDefinition attribute. Confirm with one atomic member read and a UaExpert attribute check, then read members over the native Logix driver or test on Ignition 8.3.
On this page
Bad_DecodingError on a Logix user-defined type in Ignition is not a connection fault and not a bad tag path. The controller answered the read and returned the structure; the failure happens inside Ignition's decoder. Ignition 8.1 builds codecs for custom structures from the legacy OPC Binary DataTypeDictionary, while the Logix embedded OPC UA server describes the type through the OPC UA 1.04 DataTypeDefinition attribute. With no codec for the body, the client cannot turn the returned bytes into a Document tag. Confirm the cause with two checks — one atomic member read, and the type attributes in UaExpert — then fix it by reading the members over the native Logix driver, or by decoding one real UDT on an Ignition 8.3 build before you commit the design to it.
Where the read actually fails #
Follow the request path and you can see which step stops:
- The Ignition OPC UA client opens a secure channel and a session to the server on the controller. This step works, because a status comes back at all.
- The client issues a Read or creates a MonitoredItem against the NodeId of the UDT tag. This step works too.
- The server returns a Variant holding an ExtensionObject: an encoding NodeId plus an opaque binary body with the packed member values.
- The client must decode that body into named, typed fields before it can build a Document. This is where it halts, with the client-side status
Bad("Bad_DecodingError: Decoding halted because of invalid data in the stream.").
A custom structure can only be decoded against a type description, and OPC UA publishes that description two ways. The legacy mechanism is a DataTypeDictionary: an OPC Binary schema exposed as a ByteString variable, with description nodes linking each encoding to its entry. The current mechanism is the DataTypeDefinition attribute, introduced with OPC UA 1.04, which sits on the DataType node itself and describes the fields directly. An 8.1 client that reads only the dictionary has nothing to build a codec from when the server publishes only the attribute.
Check the atomic members over the same connection #
Work from the bottom of the stack up before touching type metadata. Browse into the UDT instance and subscribe to one DINT or BOOL member directly as an OPC tag, on the same connection that shows the decoding status.
- Connection faulted or disconnected on the gateway OPC connections page: transport, endpoint or certificate problem. Fix that first; it is not a decoding problem.
- Members read Good while the parent struct shows the decoding status: transport and addressing work and the failure is isolated to structure decoding. Go to the UaExpert check.
- Members also read Bad: the server is rejecting the items, possibly at a node or connection limit. Count your nodes with the example further down, then come back.
This one result already separates the two failure families. A decode failure leaves atomic members Good; a capacity or connection failure does not.
Read the type metadata in UaExpert #
Use UaExpert as a neutral second client against the same endpoint with the same security settings. It isolates server behavior from Ignition behavior.
- Browse to the DataType node for the Logix UDT under the types tree and read its Attributes pane. Note whether DataTypeDefinition is present and populated with the member list.
- Look for an OPC Binary type dictionary in the controller's namespace, and note whether the UDT appears in it.
- Drag the UDT instance into the Data Access view and note whether UaExpert shows decoded fields or a raw ExtensionObject.
Rockwell's OPC UA user manual for Logix controllers, publication 1756-UM023, documents the server's supported data types: atomic types, arrays, STRINGs, and UDTs with up to 20 levels of nesting. The manual documents what the server exposes, not which mechanism your client version consumes — that split is exactly what this check measures. If DataTypeDefinition is populated and the OPC Binary dictionary for the type is absent, an 8.1 client has nothing to decode with. If a dictionary exists but the decode still fails, compare its field list against the real member list: a description that mismatches BOOL packing or omits padding sends the codec off the end of its field list.
Force a dictionary load with DataTypeDictionaryReader at TRACE #
Ignition reads type dictionaries when the connection is established, not on every read, so raising the log level on a running connection shows nothing new.
- On the gateway's logging levels page, find the logger whose name contains DataTypeDictionaryReader and set it to TRACE.
- Open the OPC UA connection to the controller, change nothing, and click Save. This forces a reconnect and a fresh dictionary load.
- Filter the gateway log on that logger immediately after the reconnect.
Nothing logged means the reader found no legacy dictionary to load, which matches a server that exposes only DataTypeDefinition. A loaded dictionary with the UDT missing means the dictionary is incomplete for that type. Parse or field-mismatch errors mean the dictionary exists but disagrees with the encoded body. In the reported case the TRACE log came back empty, which together with a Document workflow that works on an S7-1500 and fails on Logix points squarely at a server publishing only the 1.04 attribute.
Example: counting the OPC nodes one struct design consumes #
Before you rebuild anything, size what the embedded server will carry. Take a pump struct of 20 members — say 4 DINTs and 16 BOOLs. Subscribing to the struct parent plus all members costs 1 + 20 = 21 nodes per instance. A skid with 40 such structs therefore requests 40 × 21 = 840 nodes through the embedded server, before any standalone tags. If you instead read the same 40 structs as whole-structure values over the native Logix driver, the per-struct cost collapses to the single base-path tag, 40 tags total, and the node count question mostly disappears. The same arithmetic tells you how fast you would hit a server-side cap: a 21-node struct means a reported cap in the neighborhood of 600 points is reached at fewer than 30 struct subscriptions. If your design needs hundreds of struct instances, the article on sizing one Ignition gateway for 100,000 OPC UA tags shows how to budget tag counts at the gateway side of the same decision.
Match your symptoms to the fix #
| Symptom | Deciding measurement | Fix path |
|---|---|---|
| Struct shows the decoding status, members Good, DataTypeDictionaryReader TRACE empty | UaExpert shows populated DataTypeDefinition and no OPC Binary dictionary for the type | Read members over the native Logix driver, or decode one real UDT on Ignition 8.3 before committing |
| Decoding status with TRACE parse or field-mismatch errors | Dictionary field list disagrees with the UaExpert member view | Fix the mismatch only if you control the metadata; otherwise use the native driver or read members individually |
| Subscriptions start failing as tag count grows | Node count from the example arithmetic exceeds what the server carries | Cut nodes per struct, or move the volume to the native driver |
| Values come back Good but go slow or stale under load | OPC UA work in the controller runs at low task priority against other traffic | Use the native Logix driver for anything beyond a handful of high-level points |
The decision #
If members read Good and the server publishes only the DataTypeDefinition attribute, the cause is confirmed: the 8.1 decoder has no codec for the body. The decision follows directly. For a working system today, mirror the UDT with a native-driver tag structure in Ignition — the Logix driver handles Logix UDTs natively, and reading the UDT base path already delivers the whole structure as one value — or read the members as individual OPC tags if the point count is small. Treat Ignition 8.3 as a candidate path only after one real UDT from your controller decodes Good on your 8.3 build. For the Document style itself, keep it for display value, not as the wire format.
One safety boundary on the write side: when you do write back, write individual members and interlock the write path against the machine's hazard assessment, never a whole structure at once into a running process. A decoding fault elsewhere in this stack usually shows up as missing browse results rather than a decode failure, which the article on fixing ControlLogix tags missing from an Ignition OPC UA browse covers step by step.
Questions asked
Why does the same struct read fine from an S7-1500 but fail on the Logix controller?
The two servers describe custom structures differently. The Siemens server publishes the legacy OPC Binary DataTypeDictionary that Ignition 8.1 can build a codec from, so the Document tag decodes. The Logix embedded server exposes the type through the OPC UA 1.04 DataTypeDefinition attribute instead, which the 8.1 decoder does not consume. The same client, same workflow, different server metadata: that is why one works and the other returns the decoding status.
How many points can the Logix embedded OPC UA server carry?
Field reports put it at a low cap, often quoted as 600 points across all connections on these controllers, with the exact figure depending on controller family and firmware. Count nodes per structure before you design against it: a 21-node struct instance repeated 40 times is already 840 nodes. The controller user manual for OPC UA lists what contributes to the node count on your exact controller and revision.
What does the Bad_DecodingError status code actually mean?
It is an OPC UA status meaning the decoder halted because of invalid data in the stream. In this case the data is not corrupt: the body is a valid encoded structure, but the client has no type description to decode it with, so the codec treats the bytes as undecodable. That is why the status appears on the structure tag while every atomic member under the same connection reads Good.
Does upgrading to Ignition 8.3 fix it?
Support for the DataTypeDefinition attribute has been reported as implemented for Ignition 8.3, which is the mechanism the Logix server actually publishes. Before you commit a design to that path, decode one real UDT from your controller on your 8.3 build and confirm the Document tag goes Good, because release behavior for a specific server and version is verified by that test, not by the version number alone.
Is subscribing to whole struct Documents a good design?
It has real costs: every internal change resends the entire structure, and writeback of individual members is limited. Reading the UDT base path over the native Logix driver already delivers the whole structure in one value, with the driver's own efficiency. Reserve Document subscriptions for cases where the server metadata actually supports them, and write individual members rather than whole documents to a running machine.