# Efficient method for fetching subset of large array from OPC UA

**URL:** <https://forum.inductiveautomation.com/t/efficient-method-for-fetching-subset-of-large-array-from-opc-ua/94300>\
**Category:** Ignition\
**Tags:** opcua\
**Created:** [August 7, 2024, 3:18pm UTC](https://forum.inductiveautomation.com/t/efficient-method-for-fetching-subset-of-large-array-from-opc-ua/94300 "2024-08-07T15:18:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FCTN08](https://avatars.discourse-cdn.com/v4/letter/f/8797f3/32.png) [@FCTN08](https://forum.inductiveautomation.com/u/FCTN08)\
**Post date:** [August 7, 2024, 3:18pm UTC](https://forum.inductiveautomation.com/t/efficient-method-for-fetching-subset-of-large-array-from-opc-ua/94300/1 "2024-08-07T15:18:20Z")

</div>

For reasons outside of my control, I need to create a custom alarm banner and alarm history. I'm using OPC UA and a Beckhoff PLC. I'm stuck on the alarm history. The PLC currently keeps track of the last 1000 alarms and I was hoping to pull 50-100 elements at a time and display them in a table. I could add buttons to shift the array subset to fetch the next 50-100 elements. The PLC alarm array could easily grow to 2000 or 3000 if deemed necessary so I only want to pull a piece of it. Does anyone have a good method for pulling a subset of an array without fetching the whole array from the PLC? I was hoping to use like 50 memory tags that were indexes into the array. I could feed these into dynamic array element tags but that doesn't seem possible. Anyone have some suggestions or things to try?

---

<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:** [August 7, 2024, 3:21pm UTC](https://forum.inductiveautomation.com/t/efficient-method-for-fetching-subset-of-large-array-from-opc-ua/94300/2 "2024-08-07T15:21:43Z")

</div>

OPC Item Paths are bindable, so it won't be truly dynamic like you're hoping, but two ideas:

1. use `system.tag.configure` to _edit_ the OPC Item Paths as needed
2. create 50 memory tags, but use a timer script or something to read the elements and write them to those tags. the script can be as dynamic as you want

---

<div class="post-metadata">

**Author:** ![Benjamin\_Furlani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/benjamin_furlani/32/66084_2.png) [@Benjamin\_Furlani](https://forum.inductiveautomation.com/u/Benjamin_Furlani)\
**Post date:** [August 8, 2024, 2:16pm UTC](https://forum.inductiveautomation.com/t/efficient-method-for-fetching-subset-of-large-array-from-opc-ua/94300/3 "2024-08-08T14:16:28Z")

</div>

Maybe a UDT with 50 memory tags and a parameter for offset?

bind would be something like:  
{offset}  
{offset +1}  
{offset +2}  
{offset +3}  
etc...

then you would set offset to 0 for the first 50 and set offset for that specific udt instance each change. I believe you can edit params for UDTs programmatically.
