# Bad\_DecodingError

**URL:** <https://forum.inductiveautomation.com/t/bad-decodingerror/57055>\
**Category:** Ignition\
**Created:** [March 10, 2022, 9:34am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055 "2022-03-10T09:34:06Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![mootez\_bh](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@mootez\_bh](https://forum.inductiveautomation.com/u/mootez_bh)\
**Post date:** [March 10, 2022, 9:34am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/1 "2022-03-10T09:34:06Z")

</div>

i’m currently having a problem with an opc ua tag with a quality “bad” and a diagnostic of “Bad\_DecodingError”. any idea cloud help me a lot .

---

<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:** [March 10, 2022, 1:09pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/2 "2022-03-10T13:09:27Z")

</div>

Details could help us help you. At the very least:

- Ignition Version
- PLC Type
- PLC Driver or OPC Connection type
- OPC Item path in the affected tag
- Gateway log entries that look like they might apply.

---

<div class="post-metadata">

**Author:** ![mootez\_bh](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@mootez\_bh](https://forum.inductiveautomation.com/u/mootez_bh)\
**Post date:** [March 10, 2022, 1:41pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/3 "2022-03-10T13:41:12Z")

</div>

- Ignition Version: 8.1
- PLC Type: seimens
- PLC Driver or OPC Connection type : OPC UA
- OPC Item path in the affected tag : nsu=urn:A1230E0148:TRUMPF:UAInterfaces/[http://trumpf.com/TRUMPF-Interfaces/;s=98](http://trumpf.com/TRUMPF-Interfaces/;s=98)

---

<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:** [March 10, 2022, 1:41pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/4 "2022-03-10T13:41:27Z")

</div>

Yes, need more info, but my guess is a 3rd party OPC UA Server and you’re trying to read a tag with a structure value.

So at the very least we’ll need to know what server it is and if that’s true.

---

<div class="post-metadata">

**Author:** ![mootez\_bh](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@mootez\_bh](https://forum.inductiveautomation.com/u/mootez_bh)\
**Post date:** [March 10, 2022, 1:42pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/5 "2022-03-10T13:42:18Z")

</div>

yes i’m using a 3rd party opc ua server

---

<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:** [March 10, 2022, 1:42pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/6 "2022-03-10T13:42:57Z")

</div>

Ah good timing. Is this an S7-1500 or S7-1200? There’s some recent threads about this, but it seems you will need to both enable “legacy DataType dictionaries” in the server and if it’s a 1200 you can’t use the “Server Interfaces” to define an address space.

> [@Ignition 8.1 Siemens UDT via OPC UA trouble](https://forum.inductiveautomation.com/t/ignition-8-1-siemens-udt-via-opc-ua-trouble/54865/20):
>
> To make the Solution concrete in case anyone else comes across this issue: 1200 PLCs have a different OPC structure from 1500 PLCs due to the setup necessary on the PLC side. On the 1500 PLC the checkbox “Standard server interface (SIMATIC namespace)” has to be enabled. “Legacy data type definitions” should be enabled on the OPC. Do not use the “Server Interface” method when communicating datatypes and structures on 1500 PLCs

---

<div class="post-metadata">

**Author:** ![mootez\_bh](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@mootez\_bh](https://forum.inductiveautomation.com/u/mootez_bh)\
**Post date:** [March 10, 2022, 1:57pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/7 "2022-03-10T13:57:59Z")

</div>

sorry but after checking with my team the PLC is a BECKHOFF IPC C6930

---

<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:** [March 10, 2022, 2:13pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/8 "2022-03-10T14:13:12Z")

</div>

In that case, change the log level for the logger you find searching for “DataTypeDictionaryReader” to TRACE and then edit/save the OPC UA connection to this PLC.

Once it has reconnected export your logs and upload them. If possible it would be helpful to know the datatype of the tag you’re trying to read. This can be pretty easily obtained using a 3rd party OPC UA client like UaExpert to navigate to the Node and look at its attributes.

[https://docs.inductiveautomation.com/display/DOC81/Diagnostics+-+Logs#DiagnosticsLogs-ChangingLoggingLevels](https://docs.inductiveautomation.com/display/DOC81/Diagnostics+-+Logs#DiagnosticsLogs-ChangingLoggingLevels)

---

<div class="post-metadata">

**Author:** ![mootez\_bh](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@mootez\_bh](https://forum.inductiveautomation.com/u/mootez_bh)\
**Post date:** [March 10, 2022, 2:27pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/9 "2022-03-10T14:27:59Z")

</div>

i cant upload the file. it size is too big .

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/1/71a0da0f5b38319701f5afd4e80dfa1f7e2b6267.png)  
here a screen shot

---

<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:** [March 10, 2022, 2:31pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/10 "2022-03-10T14:31:10Z")

</div>

Well, that certainly might be the cause. It looks like the server is not responding while we’re reading the dictionary.

You should probably call support and open a case. They’ll give you a place to upload the logs and help you take a Wireshark capture. There may be nothing we can do on our side and you might end up having to work with Beckhoff support instead, but I don’t want to jump to that yet.

---

<div class="post-metadata">

**Author:** ![mootez\_bh](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@mootez\_bh](https://forum.inductiveautomation.com/u/mootez_bh)\
**Post date:** [March 10, 2022, 2:36pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/11 "2022-03-10T14:36:10Z")

</div>

thanks for the help and infos.

---

<div class="post-metadata">

**Author:** ![Andreas\_Mann](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Andreas\_Mann](https://forum.inductiveautomation.com/u/Andreas_Mann)\
**Post date:** [February 1, 2023, 2:56pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/12 "2023-02-01T14:56:40Z")

</div>

Hello mootez\_bh,  
following your posts, it looks like you solved the up mentioned issue.  
We are facing here something similar. Also a Trumpf Laser, but a L59.  
All the tags are working properly except two or three Messages.  
Can you please update this post with the solution, if it's a Ignition setting?  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Zachary\_Wenrick](https://avatars.discourse-cdn.com/v4/letter/z/e9a140/32.png) [@Zachary\_Wenrick](https://forum.inductiveautomation.com/u/Zachary_Wenrick)\
**Post date:** [July 18, 2024, 6:26pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/13 "2024-07-18T18:26:38Z")

</div>

I'm also having a decoding error, two to be specific. A few cursory details:

PLC: Opto22 grv\_epic  
OPC server: Codesys 3.5.19.10 symbol configuration with OPC features enabled  
Ignition Edge version: 8.1.21

1st issue:  
I'm reading a 1 level structured data type; I've browsed the OPC tags in the server and added to the tag viewer. The quality error: Bad("Bad\_DecodingError: Decoding halted because of invalid data in the stream")

CanRead/Write = Enabled, the tag is enabled  
The item path: nsu=CODESYSSPV3/3S/IecVarAccess;s=|var|Opto22-Coretex-Linux-Application.Tuning\_Values.SoCParams

What doesn't make sense to me is that i have another, 1 level DUT that has good quality in the same parent path, which has all of the same datatypes (e.g. LREAL):  
The item path: nsu=CODESYSSPV3/3S/IecVarAccess;s=|var|Opto22-Coretex-Linux-Application.Tuning\_Values.Ratings

The second error:  
The second error is occurring on a multilevel DUT, a struct of structs if you will:

it's generating the following quality error:  
Error\_Configuration("Bad\_DataUnavailable: Expected data is unavailable for the requested time range due to an un-mounted volume.")

For path: nsu=CODESYSSPV3/3S/IecVarAccess;s=|var|Opto22-Coretex-Linux-Application.Tuning\_Values.Tuning

I've checked in the groov epics standard in-built OPC client and it is reading the tags correctly.

Thanks,  
Zach

---

<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 18, 2024, 8:19pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/14 "2024-07-18T20:19:00Z")

</div>

Is there somewhere in the Codesys software you can get some screenshots or details about the definition of these structures?

---

<div class="post-metadata">

**Author:** ![Zachary\_Wenrick](https://avatars.discourse-cdn.com/v4/letter/z/e9a140/32.png) [@Zachary\_Wenrick](https://forum.inductiveautomation.com/u/Zachary_Wenrick)\
**Post date:** [July 19, 2024, 7:19pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror/57055/15 "2024-07-19T19:19:19Z")

</div>

Yes

This first example is from the exact GVL that is the source of what is being served by OPC UA:

Here, shows the definition and declaration of a working struct:

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

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

Here is the def and declaration of the struct that is not working  
Def:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/1/514129824368c64652e69f08c7aaac85623f0527.png)

Decl:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/1/f19ee95b30bdd27cd106f739eac85f098d82c356.png)

For a second case, the struct of structs

Def:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/8/984dc6b5cb8a3786cf9d35e11cdaed3aedfea646.png)

There are many structs within that so here is what it looks like in expansion:

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