# Siemens S7-1200 OPC UDT error

**URL:** <https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756>\
**Category:** Ignition\
**Created:** [March 3, 2022, 1:29am UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756 "2022-03-03T01:29:49Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![eichler-eng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/eichler-eng/32/21259_2.png) [@eichler-eng](https://forum.inductiveautomation.com/u/eichler-eng)\
**Post date:** [March 3, 2022, 1:29am UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/1 "2022-03-03T01:29:49Z")

</div>

I have a S7-1200 PLC with a data block containing several UDTs.

OPC communications to the PLC are working and I can read individual elements from any UDT or other data point. I have re-created the UDT in ignition, ready to be populated.

When I drag the UDT from the OPC browser into the Tag browser, I get a new tag with the “document” data type as expected. However, ignition reports a value of “Error\_Configuration”. I had expected a text string (dictionary?) that I could query for data to populate the elements of the UDT.

I have read several related posts on this forum, but I have not found the answer. What am I doing wrong? Any help would be great.

Thanks.

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

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/7/575053482b08eb69a7e02734be856f4275064c6e.png)

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

---

<div class="post-metadata">

**Author:** ![eichler-eng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/eichler-eng/32/21259_2.png) [@eichler-eng](https://forum.inductiveautomation.com/u/eichler-eng)\
**Post date:** [March 3, 2022, 1:42am UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/2 "2022-03-03T01:42:33Z")

</div>

I have just tried re-configuring the OPC server without the “data block 1” object, only VFD001 and VFD002. The result is the same.

---

<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 3, 2022, 1:45am UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/3 "2022-03-03T01:45:24Z")

</div>

As we discovered in [this post](https://forum.inductiveautomation.com/t/ignition-8-1-siemens-udt-via-opc-ua-trouble/54865/20) the Server Interface method cannot be used, I think because the server does not include datatype definitions in the datatype dictionary for this area.

I have reached out to a contact I have at Siemens to confirm.

---

<div class="post-metadata">

**Author:** ![eichler-eng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/eichler-eng/32/21259_2.png) [@eichler-eng](https://forum.inductiveautomation.com/u/eichler-eng)\
**Post date:** [March 3, 2022, 2:15am UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/4 "2022-03-03T02:15:01Z")

</div>

Ok - This makes sense. I will have a go using the “Companion specification” method and report back. If this doesn’t work, I will have to revert to using the Siemens driver which works very well with UDTs as long as the data blocks are not “optimized”.

Thanks for the rapid reply.

---

<div class="post-metadata">

**Author:** ![eichler-eng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/eichler-eng/32/21259_2.png) [@eichler-eng](https://forum.inductiveautomation.com/u/eichler-eng)\
**Post date:** [March 3, 2022, 3:16am UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/5 "2022-03-03T03:16:27Z")

</div>

I have just upgraded my S7-1200 to firmware V4.5.2. I then set the PLC up with TIA V17.

I repeated the test and I am now getting a different result. “Decoding error”.

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

---

<div class="post-metadata">

**Author:** ![eichler-eng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/eichler-eng/32/21259_2.png) [@eichler-eng](https://forum.inductiveautomation.com/u/eichler-eng)\
**Post date:** [March 3, 2022, 3:43am UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/6 "2022-03-03T03:43:56Z")

</div>

I have just tested the new OPC UA interface using the free client from Integration Objects.

The client is able to read data from the UDT. It returns a value of Byte[42].

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

---

<div class="post-metadata">

**Author:** ![Matthew\_Hunt](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Matthew\_Hunt](https://forum.inductiveautomation.com/u/Matthew_Hunt)\
**Post date:** [March 3, 2022, 7:15am UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/7 "2022-03-03T07:15:32Z")

</div>

From the testing ive done on S7-1200 PLCs it seems like UDTs added to the Server instance always has the same NS offset so in theory it should be possible to build the complete UDT object with a parameter where you define the “base NS address” and the tag paths in the UDT have an expression where it just increases the NS value by X depending on the position of the tag in the UDT on the controller.

I can’t confirm 100% that it works like that, but from what ive seen it looks like thats how it works on the 1200 server side.

---

<div class="post-metadata">

**Author:** ![eichler-eng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/eichler-eng/32/21259_2.png) [@eichler-eng](https://forum.inductiveautomation.com/u/eichler-eng)\
**Post date:** [March 3, 2022, 10:58am UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/8 "2022-03-03T10:58:50Z")

</div>

Thanks. That is pretty much my plan once I am able to read the UDT using ignition.

I have updated Ignition and I am still unable to read UDTs or structs as a document datatype. I can read arrays. I tested the setup again, this time with the OPC UA client from UaExpert. I can read and write UDTs, arrays and struct data types on the S7-1200.

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

Any idea why ignition doesn’t seem to be working?

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

See last post here. Another user confirms that the S7-1200 OPC UA server on V4.5 firmware works with UDTs.  
[S7-1200 OPC UA problem - Entries - Forum - Industry Support - Siemens](https://support.industry.siemens.com/tf/ww/en/posts/s7-1200-opc-ua-problem/265824)

---

<div class="post-metadata">

**Author:** ![Matthew\_Hunt](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Matthew\_Hunt](https://forum.inductiveautomation.com/u/Matthew_Hunt)\
**Post date:** [March 3, 2022, 11:14am UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/9 "2022-03-03T11:14:53Z")

</div>

When using the Server Interface option in the 1200 you are unable to read the entire object in ignition from my understanding, but if you as a test create a for example an integer in an UDT and point it directly to the integer value inside of the UDT in the PLC the tag will be populated. This means that if you point the 1st tag in your ignition UDT to the 1st tag in the PLC UDT you get the root NS address of the object and can calculate the offset from that.

I dont know if I explained this well enough but as you can see in the “OPC Item Path” it ends with i=4 in your screenshot. Replacing the 4 with a property you create called “RootAddress” or something similar you should be able to create an expression on the other tags inside your Ignition UDT for example “nsu=http://Server interface\_1;i={RootAddress} + 1” or something similar.  
I don’t remember the context exactly, but something like this should be possible as the addresses will keep the same offset in the PLC as long as you use the same UDT structure.

---

<div class="post-metadata">

**Author:** ![eichler-eng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/eichler-eng/32/21259_2.png) [@eichler-eng](https://forum.inductiveautomation.com/u/eichler-eng)\
**Post date:** [March 3, 2022, 11:20am UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/10 "2022-03-03T11:20:28Z")

</div>

Thanks. I can read the entire UDT object, just not with ignition.

If I have to, I will resort to the addressing approach that you have described.

---

<div class="post-metadata">

**Author:** ![Matthew\_Hunt](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Matthew\_Hunt](https://forum.inductiveautomation.com/u/Matthew_Hunt)\
**Post date:** [March 3, 2022, 11:23am UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/11 "2022-03-03T11:23:53Z")

</div>

I am not sure why reading the entire UDT object doesn’t work in ignition on the 1200 PLC.  
I struggled with the same problem. It seems like the Server Interface OPC method used in the 1200 and that is an option on the 1500 just has issues in general.

Ignition is able to read the entire UDT object from a 1500 PLC when using the other OPC server method built into the hardware, but this option is not available on 1200 PLCs sadly

---

<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 3, 2022, 1:56pm UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/12 "2022-03-03T13:56:59Z")

</div>

My contact confirmed that Nodes created under the “Server Interfaces” are custom address spaces and on the S7-1200 the structures are only defined using a new attribute introduced in OPC UA 1.04 and are not defined by the presence of the legacy datatype dictionary mechanism in the address space.

This is why Ignition cannot read these structures as a whole on the S7-1200.

AFAIK if you don’t create custom address spaces and create the Nodes directly in the device (is this possible on the 1200?), while ensuring the “Legacy data type definitions” OPC option is enabled, you will be able to read whole strutures.

---

<div class="post-metadata">

**Author:** ![eichler-eng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/eichler-eng/32/21259_2.png) [@eichler-eng](https://forum.inductiveautomation.com/u/eichler-eng)\
**Post date:** [March 3, 2022, 7:02pm UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/13 "2022-03-03T19:02:36Z")

</div>

Thanks for investigating Kevin. As per Matthew’s post, I think that what you have described is only currently possible with the S7-1500 which has more OPC-UA options.

Is there a plan for adding the custom address space functionality/new attribute to ignition? I have only tested 2 free OPC-UA clients but they were both able to read the whole structures from the S7-1200.

Cheers

---

<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 3, 2022, 7:09pm UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/14 "2022-03-03T19:09:51Z")

</div>

It’s part of a long term plan to implement OPC UA 1.04 support (or probably 1.05 by the time we start) on a timeline that will likely be Ignition 8.2.

Ignition is currently OPC UA 1.03, which is why you can’t read these structures and even on the S7-1500 the “legacy datatype dictionary” option needs to be enabled.

---

<div class="post-metadata">

**Author:** ![eichler-eng](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/eichler-eng/32/21259_2.png) [@eichler-eng](https://forum.inductiveautomation.com/u/eichler-eng)\
**Post date:** [March 15, 2022, 4:52am UTC](https://forum.inductiveautomation.com/t/siemens-s7-1200-opc-udt-error/56756/15 "2022-03-15T04:52:05Z")

</div>

Thanks @Kevin.Herron and @Matthew_Hunt. I will have to wait for Ignition 8.2!
