# Problem writing array elements to PLC using OPC UA

**URL:** <https://forum.inductiveautomation.com/t/problem-writing-array-elements-to-plc-using-opc-ua/103853>\
**Category:** Ignition\
**Created:** [March 19, 2025, 12:54am UTC](https://forum.inductiveautomation.com/t/problem-writing-array-elements-to-plc-using-opc-ua/103853 "2025-03-19T00:54:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_doe1](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@john\_doe1](https://forum.inductiveautomation.com/u/john_doe1)\
**Post date:** [March 19, 2025, 12:54am UTC](https://forum.inductiveautomation.com/t/problem-writing-array-elements-to-plc-using-opc-ua/103853/1 "2025-03-19T00:54:39Z")

</div>

Hello,

I'm using an Omron NJ-502 processor with Ignition Edge, using the OPC-UA connection. I'm reading an array (2 dimensional) with a Polled group. The tags read from the PLC correctly, but when I link one of the elements to an Input block and try to enter a value, it either just accepts the value in the Ignition and does NOT change it in the PLC, or it throws an error Error writing "hg" to tag. Bad\_Failure.

I had read that some PLC's want you to write the WHOLE array at one time, but I'm not sure if that's the issue, or if it is, how to correct it. I'm already having to create a fake array because the OPC driver will not pick up 3 dimensional arrays...it only reads single or two dimensional arrays.

Again, all of the elements in the array when changed in the PLC display correctly on the Ignition display or data entry items. The data just doesn't go back down to the PLC. I do have it set for bi-directional communications, both on the top of the developer AND in the tag binding window.

Thank you!

---

<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 19, 2025, 12:59am UTC](https://forum.inductiveautomation.com/t/problem-writing-array-elements-to-plc-using-opc-ua/103853/2 "2025-03-19T00:59:06Z")

</div>

> [@john\_doe1](#):
>
> reading an array (2 dimensional) with a Polled group

Ignition doesn't support multi-dimensional array tags, so this must be multiple tags in Ignition. Does each tag point at a one-dimensional row/column, or does each Ignition tag point at one primitive element of the array?

Can you edit values in the array from the designer tag browser?

---

<div class="post-metadata">

**Author:** ![john\_doe1](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@john\_doe1](https://forum.inductiveautomation.com/u/john_doe1)\
**Post date:** [March 19, 2025, 1:16am UTC](https://forum.inductiveautomation.com/t/problem-writing-array-elements-to-plc-using-opc-ua/103853/3 "2025-03-19T01:16:41Z")

</div>

Hello!

The tags are displayed in the tag browser, with the values from the PLC, but you cannot type in a value there...you get the same error. The two dimensional array comes in "stacked", so you just have to count out the elements to find the correct two dimensional part of the array.

---

<div class="post-metadata">

**Author:** ![john\_doe1](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@john\_doe1](https://forum.inductiveautomation.com/u/john_doe1)\
**Post date:** [March 19, 2025, 1:17am UTC](https://forum.inductiveautomation.com/t/problem-writing-array-elements-to-plc-using-opc-ua/103853/4 "2025-03-19T01:17:51Z")

</div>

So, for instance, in an array (2,2), the (0,0) is element 0 in ignition. (0,1) is element 1, (0,2) is element 2, (1,0) is element 3, and so on and so forth...

---

<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 19, 2025, 11:50am UTC](https://forum.inductiveautomation.com/t/problem-writing-array-elements-to-plc-using-opc-ua/103853/5 "2025-03-19T11:50:47Z")

</div>

> [@john\_doe1](#):
>
> The two dimensional array comes in "stacked"

Show a screen shot of this. (If each Ignition tag has multiple array elements, then no, you cannot write to the individual elements.)

---

<div class="post-metadata">

**Author:** ![john\_doe1](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@john\_doe1](https://forum.inductiveautomation.com/u/john_doe1)\
**Post date:** [March 20, 2025, 6:01pm UTC](https://forum.inductiveautomation.com/t/problem-writing-array-elements-to-plc-using-opc-ua/103853/6 "2025-03-20T18:01:55Z")

</div>

Hello,  
Sorry for the delay. I did some testing and I've found the problem. Apparently you cannot write directly to an element in an array, as suggested in the Ignition manual. So I had to create an Ignition Single DImension Array memory tag, populate that will the data from the PLC, modify the memory tag, and the write the ENTIRE ARRAY to the PLC in order to change the values in the PLC.

This is the script I used to write a DINT[0..1,0..5] array to the PLC:

tagValue = system.tag.readBlocking('[edge]TestMemoryTag')[0].value  
value = list(tagValue)  
system.tag.writeBlocking('[edge]GlobalVars/AATestArray', [value])

The same code worked for both 1 dimensional arrays in the PLC and 2 dimensional arrays. 3 Dimensional arrays aren't even recognized by the OPC-UA driver, so I couldn't even test that.

Thank you!
