Configuration of a Subscription
The WinCC OA OPC UA client is able to sign up for value changes, events and alarms to an OPC UA server for autonomous notifications within one or several subscriptions. The number of subscriptions is not limited. It is admissible to apply either data values, events or alarms & conditions to a subscription. A combination of these three subscription types is not possible.
The reading of input values from an OPC UA server takes places either over subscription (spontaneous) or over poll groups (periodically). The preferred variant is the spontaneous transmission, as here the transmission of values which have not been changed is omitted and thus unnecessary load is avoided. The connection supervision for subscriptions takes place according to OPC UA standard (for further information see connection supervision for subscriptions).
For each subscription the parameters described in the chapter Configuration of Server are stored in the internal data point type _OPCUASubscription and are adjustable in the following subscription configuration panel.
The panel for configuration of a subscription (creation, changing, deleting) can be opened either via the "Manage" button in the OPC UA driver configuration panel or via the "..." button in the OPC UA peripheral address panel.
The subscription configuration panel provides the input/view of the following parameters:
Subscription
- Create
-
- Click on the Create button to specify a name for the subscription an thus to create a new subscription with basic settings. This opens an input dialog:
-
Enter a name for the new subscription in the Datapointname text field.
-
Select a Subscription type. This defines whether this is a subscription to:
-
Data
-
Events
-
Alarms & Conditions
Depending on the subscription type the settings for the monitored items differ. The alarm- and event-specific settings are described in the chapter Alarms and Conditions.
Restriction: The subscription type may not be changed afterwards (after the creation of the subscription). -
-
-
Click on OKto continue the subscription configuration.
-
Click on Apply to create the subscription data point with the set parameters or on OK to create the subscription data point and to close the panel.
-
Click on Cancel to close the configuration panel without the subscription data point has been created if not already done before.
-
Note: If a subscription was created in the panel, then this is not created immediately in the server. It will only be created if a peripheral address is available, which contains this subscription.Note: For changing the settings select the subscription data point in the combo box, change the configuration and click on Apply. As soon as the subscription data point is created this can be used by the driver (no driver restart required).Note: If a subscription is changed at runtime, only the general subscription parameters will be applied but those which relate to the Monitored Items. The monitored items parameter are applied at the next reconnect. - Remove
- Click on the Remove button to remove the selected subscription (and thus also the subscription data point). Note that a subscription is not deleted till the Apply button was not clicked.
- Add unused
-
The button Add unused allows to reassign subscriptions without an existing connection to the current connection.
- Description
- In the Description text field a custom description for the created subscription can be added (or changed) in the corresponding project language. The default description in every project language is "_<subscription_name>" - this is shown after reopening the configuration panel.
Configuration
- Active
- Tick this check box to set the subscription active. A created and configured subscription can be deactivated anytime. The subscription data point will not be deleted and can be reactivated at any time. If a subscription has been deactivated, no notifications about data value changes, events or alarms & conditions are sent to the client. This way it is, for example, possible to avoid alarms during maintenance operations have to be made on the OPC UA server.
- Subscription type
- Shows the subscription type that was selected when creating the subscription (see above). This can not be changed here anymore.
Advanced configuration
- Publishing Interval
- In these intervals in seconds the values are read from the server's queues by the client. The value 0 means that this function is inactive. Default: 500 ms.
- Priority
- Assign a priority to the subscription, whereby critical values will be prioritized. The priority 0 means low priority and 255 means high priority.
- Lifetime count
- Number of publishing intervals until the subscription is deleted by the server, if no publish request has been received.
- Max keep alive count
- When the publishing timer in the server has expired this number of times without data to be sent, the subscription sends a keep-alive Message to the Client.
- Max notification per publish
-
Specifies a limit for notifications the server shall send as response to a Publish request. It can be used to reduce peaks of communication load, when buffered data are transmitted.
The value 0 means that the client specifies no limit and the server will use the maximum number of notifications per publish. The maximum values are server dependent, e.g. the WinCC OA OPC UA server has a maximum value of 65535
Monitored Items
In this area the parameters of the monitored items can be set. The number of Monitored Items in a subscription is unlimited. The parameters for all Monitored Items within one subscription are the same. They are stored in the internal data point type _OPCUASubscription.
The parameters of the Monitored Items are partially fix-coded or predefined in the subscription. That means that a lot of Monitored Items can be summarized to groups with the same parameters.
Depending on the subscription type there are different settings for a subscription that can be set in the Monitored items area.
Subscription Type - Data
- delete oldest of queue on overflow
- Tick this check box when the oldest element shall be deleted from the queue in case of an overrun. Leave this check box unticked when the youngest element shall be deleted from the queue. Normally, the last value is the most important one, thus, this check box is ticked by default.
- use Timestamp from
-
Here can be defined, which timestamp the OPC UA client should use for value change of a node - from the source, the OPC UA server or none of the both (the driver uses the retrieve time of the value change as timestamp).
The settings source and server in input and output addresses may easily lead to an error (the source time is marked as invalid), since the time from the server (or source) may not lie behind the time from the WinCC OA computer. This means that the times on the systems have to run very synchronous. In this case the response on the command is received with an older timestamp than the command's timestamp.
The tolerance can be increased by means of negativeSourceTimeDiff config entry, thus the setting the source time to invalid is prevented.
- Queue Size
-
There is a queue in the server for each monitored item. You can specify the number of value changes per monitored item, which shall be saved up to the next Publish. The value should not be too high. Otherwise the client may be overloaded with value changes (default = 1). If the "publishing interval" of the subscription is higher than the "query interval" this queue might hold several values.
Note: This queue size defined here is NOT the same as the request queue size (defined per config entry "maxRequestQueueSize"). - Sampling Interval
- Specify the interval in milliseconds for the polling of Monitored Items (underlying hardware) executed by the OPC UA server. 0 means "as fast as possible".
- Data change filter
-
In the subscription the trigger and the deadband filter for the monitored items can be set. These settings apply to all monitored items within the subscription.
Note: Neither the WinCC OA OPC UA server nor the WinCC OA OPC UA client do support the filter settings of the type AggregateFilter. - Trigger
-
Select the trigger to which the filter applies. The individual specifications are OR-linked. For example "Status, Value" (default) means that the server sends the value as soon as either the status or the value changes.
- Status
- Status, Value
- Status, Value, Timestamp
- Deadband Type
-
Specifies the deadband type for the value calculation - either none calculation, or the value is denoted absolutely or in percentage notation.
The respective OPC UA variable must be from type AnalogItemType so that the given percentage for the deadband is valid. The percental deadband is not supported for normal variables (BaseDataVariableType). Please note that in general a deadband is only allowed for numeric types (e.g. double, int). In case of items with other types (e.g. bool or string), an error ("BadFilterNotAllowed") occurs when creating the MonitoredItems.
- Deadband value
-
Specify a value in whose range (up from the original value) the deadband shall be valid.
Subscription Type - Events
- Event Type
-
Allows to specific to which type of event the subscription is used.
- Node ID
-
Allows to filter for specific Node IDs. Depending on the selected Event Type the field the filter is automatically set or can be specified manually.
The filter value is written to the DPE
_OPCUASubscription.Config.Alarm.AlarmType
. - Event Fields
-
The Events Fields button opens a dialog in which the event fields to be requested from the server can be selected. The mandatory fields that are required for processing the alarm status are always requested. You can only select event fields for additional value mapping.
- Event Notifier
-
Allows to set an optional event notifier for the configured subscription.
- Event fields as JSON
-
Allows to specify if the Event fields should be returned as JSON string. By default the fields are returned as a concatenated string separated by a pipe symbol ("
FieldA|FieldB
").The string is either written to the fallback event address, see [opcua] eventFallbackAddress, or, in case of an explicitly stated address, to the Event Source Node ID.
Subscription Type - Alarms & Conditions
- Alarm type
- This alarm type determines the mapping of the OPC UA attributes to WinCC OA alarm ranges. The mapping between the state of the OPC UA attribute ActiveState and an alarm range is predefined in the table and depends on the selected alarm type. Depending on the alarm type an additional mapping table between state (Status) and range is available.
- Event Fields
-
The Events Fields button opens a dialog in which the event fields to be requested from the server can be selected. The mandatory fields that are required for processing the alarm status are always requested. You can only select event fields for additional value mapping.
- Event Notifier
-
Allows to set an optional event notifier for the configured subscription.
- UA Severity
- Defines whether the WinCC OA Severity or the Unified Architecture Severity will be used.
- UA Alarm Text
- Defines whether the WinCC OA alert text or the Unified Architecture alert text will be used.
- Event fields as JSON
- Specifies if the event fields of the alarm are mapped as JSON string to the alert additional value (_add_value_5).
See Configuration of a subscription in chapter OPC UA Alarms and Conditions.
State
- Assigned server
- In this field the name of the OPC UA server is displayed the subscription is assigned to.
- ID
- The internal identification number for the selective subscription. This must be unique on each server.
- Publishing Interval
- In this field the actual Publishing Interval in milliseconds is displayed, i.e. in these intervals (which the server is able to meet) the values are read from the queues on the server by the client.
- Lifetime count
- Actual number of publishing intervals until the subscription is deleted by the server, if no publish request has been received.
- Max keep alive count
-
Shows how often the publishing timer in the server may expire without any sent data. After that the subscription sends a keep-alive message to the client.
- Failed Registrations
- Anzahl der Einträge, bei denen die Registrierung für die Subscription fehlgeschlagen ist.
- Queue size
- See opc_ua_c_subscription.html#opcua_subscription__Queue_Gr%C3%B6%C3%9Fe
- Sampling Interval
- See opc_ua_c_subscription.html#opcua_subscription__Abfrageintervall
State Redundancy
Here, the same information is shown like in the State section, but only for the OPC UA client, which is running on the second system of a redundant WinCC OA system.
General Query (GQ)
Click on this button to trigger a general query for the corresponding subscription.
Connection supervision for subscriptions
The connection supervision for subscription takes place according to OPC UA standard. In doing so the client passes a Keep-Alive-Counter to the server with CreateSubscription. If in the subscription for a certain number of Publishing Intervals (the number corresponds to the value of the Keep-Alive-Counter) no notifications are present, the server sends a Keep-Alive message.
If the server does not achieve a certain number of Publish Intervals (3 * Keep-Alive-Counter - OPC UA recommendation) for a selective subscription from the client, the subscription is closed by the server.