# Correct way to approch Siemens UDT's and big data structures

**URL:** <https://forum.inductiveautomation.com/t/correct-way-to-approch-siemens-udts-and-big-data-structures/87505>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [March 18, 2024, 5:03pm UTC](https://forum.inductiveautomation.com/t/correct-way-to-approch-siemens-udts-and-big-data-structures/87505 "2024-03-18T17:03:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Leech](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alex_leech/32/39391_2.png) [@Alex\_Leech](https://forum.inductiveautomation.com/u/Alex_Leech)\
**Post date:** [March 18, 2024, 5:03pm UTC](https://forum.inductiveautomation.com/t/correct-way-to-approch-siemens-udts-and-big-data-structures/87505/1 "2024-03-18T17:03:30Z")

</div>

Hi all,

I'm looking for a steer on what the best/ correct way to approach reading / writing big data structures on Siemens OPC UA servers (Apart from don't!). Quite often I have an issue that I can read, but cannot write due to getting errors.

As an example:  
I have the following data in a PLC UDT:

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

If I create this as a document tag, and drag to a custom property, all is groovy. I can read it fine.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/8/88e3205945ca6aa702db8c3223752afdc5185211.png)

However if I try and change any of the values I get the following:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/9/696d15cc6e75787d820c3a57fb60d75e650a6349.png)

It doesnt seeem to matter what I try and change, its always this error.  
Using the methods described in [this forum post](https://forum.inductiveautomation.com/t/siemens-reading-array-from-a-whole-structure/70450) I can write the data structure, however @Kevin.Herron has kindly redirected me to this fresh new page 🙂

So questions are:

1. Is the way I'm reading the structure 'Correct'?

2. Is there a better more efficient way of doing it?

3. Why do I get the error above on a bidirectional write?

4. Whats the best solution to work around it?

Thanks all!  
Alex

---

<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 18, 2024, 5:07pm UTC](https://forum.inductiveautomation.com/t/correct-way-to-approch-siemens-udts-and-big-data-structures/87505/2 "2024-03-18T17:07:20Z")

</div>

Hmm, I have no idea if this "drag to a custom property" thing is supposed to work. I honestly don't know what that does on the backend and what happens when you modify that property.

The traditional setup for structures from OPC UA servers is to create a set of matching derived tags that use `jsonGet`/`jsonSet` expressions for each of the members, and then write to the derived tags, which in turn write to the document tag for the base structure.

> [@OPC UA struct data type?](https://forum.inductiveautomation.com/t/opc-ua-struct-data-type/26905/2):
>
> You can take advantage of reading whole structs in OPC UA servers as of Ignition 7.9.12 and 8.0.0. When you bring the tag in you’ll notice Ignition presents a JSON value. The strategy here is a little involved but it works. For each of the UDTs you’ll be subscribing to in the PLC you make a corresponding UDT in Ignition. It should have a “Source” OPC tag member that will correspond to the Node with the struct value in the server and as a result have a JSON value in Ignition. Then for each memb…

---

<div class="post-metadata">

**Author:** ![Alex\_Leech](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alex_leech/32/39391_2.png) [@Alex\_Leech](https://forum.inductiveautomation.com/u/Alex_Leech)\
**Post date:** [March 18, 2024, 5:15pm UTC](https://forum.inductiveautomation.com/t/correct-way-to-approch-siemens-udts-and-big-data-structures/87505/3 "2024-03-18T17:15:23Z")

</div>

Ah, so basically I'm cheating the system! ☺

Having an array of 100 UDT's is going to be a proper headache to setup with all the jsonGet and jsonSet expressions in a UDT - Am I correct in saying ignition cant reference UDT's inside UDT's yet? as that would make this much easier!

---

<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 18, 2024, 5:23pm UTC](https://forum.inductiveautomation.com/t/correct-way-to-approch-siemens-udts-and-big-data-structures/87505/4 "2024-03-18T17:23:03Z")

</div>

UDTs inside of UDTs work fine in this hare-brained derived tag scheme.

It's all definitely a pain in the ass, though.

I'm going to look at this property binding stuff and see if that should work or could work.

---

<div class="post-metadata">

**Author:** ![Alex\_Leech](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alex_leech/32/39391_2.png) [@Alex\_Leech](https://forum.inductiveautomation.com/u/Alex_Leech)\
**Post date:** [March 18, 2024, 5:32pm UTC](https://forum.inductiveautomation.com/t/correct-way-to-approch-siemens-udts-and-big-data-structures/87505/5 "2024-03-18T17:32:57Z")

</div>

Thanks Kevin - Hare-brained definitely describes the whole project I'm on! 🤣
