A typical OPC UA Server can be configured to fire Events to a Client. OPC UA specifies a wide range of different Events. OPC UA Clients can receive Events when subscribing to an Event Notifier.

In order to monitor an item, a NodeHdl for that specific node is required. Both UA_SubscriptionCreate and UA_NodeGetHandle are to be called before calling UA_EventItemAdd. UA_EventItemAdd is used to add an event item to a subscription mentioned by the SubscriptionHdl. The node of which events are monitored is to be assigned to this FB in form of NodeHdl. UA_EventItemOperate can be used to get information about the incoming events occurred.

Take note to delete the subscription. Release the NodeHdl before you disconnect. If UA_NodeReleaseHandle is called before UA_SubscriptionDelete the Subscription will continue working.

image012.png

Figure 8: Monitor Events sequence