# Bad\_DecodingError reading S7-1500 struct

**URL:** <https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000>\
**Category:** Ignition\
**Created:** [November 11, 2021, 11:23pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000 "2021-11-11T23:23:04Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krzysztof\_Lesiak](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Krzysztof\_Lesiak](https://forum.inductiveautomation.com/u/Krzysztof_Lesiak)\
**Post date:** [November 11, 2021, 11:23pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/1 "2021-11-11T23:23:04Z")

</div>

Hello,  
I’m trying to do same thing and It’s not working. So I have 1500 running as a OPC UA Server with OPC UA 1.03 spec checked. I have data block with simple Structs and I can see them in Ignition:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/2/22b4370f730e8a572d9736767ae584bd025324ca.png)  
Source Tag is OPC Tag Document pointing that:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/c/ec13c6c12eddff107a04fff92c2d1b5fae226d5b.png)  
This is how it looks in Tag Browser:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/a/3a28f444c4f2ba9b927e246c68f3e4f35ab3f2f1.png)  
Both variables - ControlWord and Status have “Error ExpressionEval” Error. This is how they look like:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/965cb6d77104d24761d88cf34872346a55cef7e2.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/b/2b38e28b55716b4fcc0ea998eb30e4df835a7f10.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/6/46cb8577078a485be8d80f19b6e9b8f1dcef6e4f.png)

Can someone tell me what I’m doing wrong please?  
Thank you  
Krzysztof

---

<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:** [November 11, 2021, 11:30pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/2 "2021-11-11T23:30:36Z")

</div>

It doesn’t look like you’re successfully pulling in the source Document tag, so it might be too soon to expect the expression tags to work. I see a Bad\_DecodingError in that screenshot. This probably means the dictionary either wasn’t read successfully or didn’t contain the struct definition.

Have you fully recompiled/downloaded/restarted the S7-1500 OPC UA server yet?

---

<div class="post-metadata">

**Author:** ![Krzysztof\_Lesiak](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Krzysztof\_Lesiak](https://forum.inductiveautomation.com/u/Krzysztof_Lesiak)\
**Post date:** [November 11, 2021, 11:36pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/3 "2021-11-11T23:36:13Z")

</div>

Thank’s for quick reply.  
Yes I did it multiple times. I can connect to single tags without any problems and read/write them.

---

<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:** [November 11, 2021, 11:37pm UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/4 "2021-11-11T23:37:43Z")

</div>

That’s not surprising, they don’t require the structure definition to be read successfully.

Turn the logger you find searching “DataTypeDictionaryReader” to TRACE and then edit/save the OPC UA connection to the 1500. Once it has fully reconnected get the Ignition gateway logs and upload them.

I’ll need to know some info about the structure you’ve created. Its name and contents would be useful, and I see that you’ve created a custom namespace as well. We may also need to poke around in the server using a 3rd party client like UaExpert at some point.

[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:** ![Krzysztof\_Lesiak](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Krzysztof\_Lesiak](https://forum.inductiveautomation.com/u/Krzysztof_Lesiak)\
**Post date:** [November 12, 2021, 12:44am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/5 "2021-11-12T00:44:29Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/f/0f9be1c939e7b88aaf11fb3af8e4238103021df7.png)  
I can’t download log as it has 14mb.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/5/253880f482675badd7773795f24aa68976a29959.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:** [November 12, 2021, 12:55am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/6 "2021-11-12T00:55:54Z")

</div>

I’ll DM you a dropbox link.

---

<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:** [November 12, 2021, 1:12am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/7 "2021-11-12T01:12:25Z")

</div>

What version of Ignition are you using? I see some older errors while reading the dictionary, but also not seeing some logs I would expect.

---

<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:** [November 12, 2021, 1:14am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/8 "2021-11-12T01:14:12Z")

</div>

Eh, nevermind, I see 8.1.9. And the logs I’m expecting aren’t there because there doesn’t appear to be any additional datatype dictionaries showing up when Ignition browses.

---

<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:** [November 12, 2021, 1:16am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/9 "2021-11-12T01:16:05Z")

</div>

I’m going to need you to use UaExpert or another client to connect to this server and browse the following path and tell me what you see:

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

(under the `OPC Binary` Node in the tree)

---

<div class="post-metadata">

**Author:** ![Krzysztof\_Lesiak](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Krzysztof\_Lesiak](https://forum.inductiveautomation.com/u/Krzysztof_Lesiak)\
**Post date:** [November 12, 2021, 1:20am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/10 "2021-11-12T01:20:26Z")

</div>

![Capture](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/1/b1a88dc9643b69fa0d5b6aee99bd647364f8055c.png)

---

<div class="post-metadata">

**Author:** ![Krzysztof\_Lesiak](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Krzysztof\_Lesiak](https://forum.inductiveautomation.com/u/Krzysztof_Lesiak)\
**Post date:** [November 12, 2021, 1:26am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/11 "2021-11-12T01:26:01Z")

</div>

Interesting - I connected to that DB not through OPCUA Server Interface but straight directly from PLC1 object…

---

<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:** [November 12, 2021, 1:27am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/12 "2021-11-12T01:27:49Z")

</div>

Would it be possible to get a Wireshark capture of the traffic between Ignition and the PLC? From what I can tell in the logs the server is returning some identical browse results, but that’s not something I’ve seen before…

```auto
2021/11/11 16:46:07:142 | DEBUG | [DataTypeDictionaryReader] structCodecs.size()=235
2021/11/11 16:46:07:142 | DEBUG | [DataTypeDictionaryReader] enumCodecs.size()=26
2021/11/11 16:46:07:071 | DEBUG | [DataTypeDictionaryReader] Reading DataTypeDictionary nodeId=NodeId{ns=0, id=7617}
2021/11/11 16:46:07:071 | DEBUG | [DataTypeDictionaryReader] Browse finished with 3 references
2021/11/11 16:45:33:477 | DEBUG | [DataTypeDictionaryReader] structCodecs.size()=235
2021/11/11 16:45:33:477 | DEBUG | [DataTypeDictionaryReader] enumCodecs.size()=26
2021/11/11 16:45:33:431 | DEBUG | [DataTypeDictionaryReader] Reading DataTypeDictionary nodeId=NodeId{ns=0, id=7617}
2021/11/11 16:45:33:431 | DEBUG | [DataTypeDictionaryReader] Browse finished with 3 references
2021/11/11 16:41:53:992 | DEBUG | [DataTypeDictionaryReader] structCodecs.size()=235
2021/11/11 16:41:53:992 | DEBUG | [DataTypeDictionaryReader] enumCodecs.size()=26
2021/11/11 16:41:53:868 | DEBUG | [DataTypeDictionaryReader] Reading DataTypeDictionary nodeId=NodeId{ns=0, id=7617}
2021/11/11 16:41:53:868 | DEBUG | [DataTypeDictionaryReader] Browse finished with 3 references

```

You would need to ensure there is no security for the connection, then start the Wireshark capture, then edit/save the connection in Ignition, and once it has fully connected you can stop the capture.

---

<div class="post-metadata">

**Author:** ![Krzysztof\_Lesiak](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Krzysztof\_Lesiak](https://forum.inductiveautomation.com/u/Krzysztof_Lesiak)\
**Post date:** [November 12, 2021, 1:31am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/13 "2021-11-12T01:31:55Z")

</div>

With that all is working well… Before I created Server Interface in TIA now I’m connected to DB directly

 ![Capture](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/d/7d554b15b5dd868ddcac01488f01f08d4f17fa0c.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:** [November 12, 2021, 1:32am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/14 "2021-11-12T01:32:57Z")

</div>

and you can get a value from those?

---

<div class="post-metadata">

**Author:** ![Krzysztof\_Lesiak](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Krzysztof\_Lesiak](https://forum.inductiveautomation.com/u/Krzysztof_Lesiak)\
**Post date:** [November 12, 2021, 1:34am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/15 "2021-11-12T01:34:33Z")

</div>

Yes and Read/Write is working well

---

<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:** [November 12, 2021, 1:35am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/16 "2021-11-12T01:35:31Z")

</div>

Well I am very confused but okay 👍

---

<div class="post-metadata">

**Author:** ![Krzysztof\_Lesiak](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Krzysztof\_Lesiak](https://forum.inductiveautomation.com/u/Krzysztof_Lesiak)\
**Post date:** [November 12, 2021, 1:37am UTC](https://forum.inductiveautomation.com/t/bad-decodingerror-reading-s7-1500-struct/53000/17 "2021-11-12T01:37:53Z")

</div>

It’s first time I’m using 1500 as a server and I thought that I should use Server Interfaces. Looks like it is working bit different way and Ignition is not happy with that. Direct connection is even better for me so thanks for help
