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?
OPC Item Paths are bindable, so it won't be truly dynamic like you're hoping, but two ideas:
- use
system.tag.configure
to edit the OPC Item Paths as needed - 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
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.