Notification retrieval and synchronization
The probe identifies one or more items in the server address space that it wants to monitor. The OPC Unified Architecture (UA) server regularly polls each item. If there has been a suitable change in the item's value or state, the OPC UA server generates a notification. The probe regularly retrieves these notifications.
The process of retrieving notifications from the OPC UA server has the following stages:
Setting up a subscription
When it has established a connection and session with the OPC UA server, the probe creates a subscription which is used to report notifications to the probe. Later in the process, the probe associates a number of items to monitor with the subscription.
The probe uses the OPC UA service CreateSubscription to set up the subscription. The service has a number of parameters that define the characteristics of the subscription. The probe maintains the values of some parameters as properties.
Property |
Usage |
---|---|
RequestedPublishingInterval |
The frequency (in milliseconds) that the OPC UA server is to gather notifications from the monitored items and queue them ready for transmission to the probe. |
MaxNotificationPerPublish |
The maximum number of notifications that the probe wants to receive in a single response from the OPC UA server. |
RequestedLifetimeCount |
The maximum lifetime counter for the subscription. If this number of publishing intervals occurs without the OPC UA server receiving a request from the probe to send outstanding notifications, the server deletes the subscription. Ensure that the value of this property is at least three times greater than the value of RequestedMaxKeepAliveCount. |
RequestedMaxKeepAliveCount |
The maximum keep-alive counter for the subscription. If this number of publishing intervals occurs without there being any notifications to return to the probe, the OPC UA server sends a keep-alive message to ensure the subscription remains in use. When the server publishing timer has expired this number of times without requiring any NotificationMessage to be sent, the Subscription sends a keep-alive Message to the probe. The negotiated value for this parameter is returned in the response. If the requested value is 0 (zero), the server revises the counter with the smallest supported keep-alive count. |
In response to the request to create a subscription, the OPC UA server returns an identifier for the subscription. The probe retains this for use when telling the server which items to monitor and when asking the EMS to return any outstanding notifications.
Defining the items to monitor
With the subscription in place, the probe can define the set of items that it wants the OPC UA server to monitor. The probe uses the OPC UA CreateMonitoredItem service to create the set of monitored items on the server. The service has a number of parameters, some of which the probe holds in an XML file. There is one probe property that defines the name and location of that file.
Property |
Usage |
---|---|
MonitoredItemsConfigFile |
The full path of a file that defines the items to monitor and any notification filters. The use of a filter is optional. The XML configuration files for event and data change notifications has a detailed description of the file, its structure, and its content. |
Performing the initial synchronization
After
defining the items to monitor, the probe immediately retrieves a list
of all active notifications from the OPC UA server
if the InitialResync property is set to true
.
When the InitialResync property is set to false
,
the probe does not receive the existing notifications.
Retrieving notifications
The probe periodically requests the OPC UA server to return any outstanding notifications. The probe uses the OPC UA Publish service to do this, and the frequency of publishing requests is determined by the value of the ResyncInterval property. In response to each request, the OPC UA server returns any notifications that are waiting on its notification queue.
The probe parses each notification, converts it to an ObjectServer event, and sends that event to the ObjectServer.
Under certain conditions, the OPC UA server may have more notifications to send than the probe can readily handle. Use the MaxNotificationPerPublish property to limit the number of notifications the server can send in response to each Publish request. This helps to ensure that the probe is not overloaded during an event storm.
As stated previously, if the user enables the InitialResync property, the probe retrieves notifications immediately after the monitored items are created. Otherwise, if the user does not enable the InitialResync property, the probe waits until the time specified in the ResyncInterval property expires to initiate the request for the notifications from the OPC UA server.
Acknowledging notifications
A Publish request can include acknowledgments of notifications the probe has received. The AcknowledgeAlarm property controls whether the probe acknowledges notifications. If this property is set to 1, the probe acknowledges notifications. If this property is set to 0, the probe does not acknowledge alarms.