UDT instance counter from alarm script

Hi all,

I am have a project with a machine UDT that has alarms and I need to total 5 of those alarms and reset the count at midnight everyday.

each instance uses a parameter called machineName which would be ATX0504 in the picture below. I have added the tag that would increment the count tag when it goes active. The read- and writeblocking works when I use the exact same syntax with the direct tag, I am not certain how to pass the instance parameter into the UDT alarm script.

thanks.

For anyone wanting to do something similar. the script below works using tag directory and paths.