There is a gateway tag for OPC connection status. I am highlighting the ones you should care about.
I would make a expression tag that compares the current time stamp vs the timestamp of the the Connection status and if the connection status is False. Something like
secondsBetween(now(10000), {[System]Gateway/OPC/Connections/Ignition OPC UA Server/Connected.Timestamp}) > 30 && !{[System]Gateway/OPC/Connections/Ignition OPC UA Server/Connected}
This would see - is the current time 30 seconds more than the last time the OPC UA Connectected status value was changed and the value of the status is False aka it’s been 30 seconds since connection status was turned to False.
Then do a gateway tag change event on this expression tag to do whatever logic you need.
If you don’t want to do the expression / gateway tag change event it’s more or less eqiuvalent to do a gateway timer script to look at these tags every X seconds and make your decision on what to do.
I would definitely not bother going down the road of trying to figure out windows event logs from within ignition gateway.
