This Serviceis used to create a Subscription. Subscriptionsmonitor a set of MonitoredItemsfor Notificationsand return them to the Clientin response to Publishrequests.

Illegal request values for parameters that can be revised do not generate errors. Instead the Serverwill choose default values and indicate them in the corresponding revised parameter.

Table 88defines the parameters for the Service.

Table 88– CreateSubscription Service Parameters

Name

Type

Description

Request

requestHeader

Request Header

Common request parameters (see 7.33for RequestHeaderdefinition).

requestedPublishing

Interval

Duration

This interval defines the cyclic rate that the Subscriptionis being requested to return Notificationsto the Client. This interval is expressed in milliseconds. This interval is represented by the publishing timer in the Subscriptionstate table (see 5.13.1.2).

The negotiated value for this parameter returned in the response is used as the default sampling interval for MonitoredItemsassigned to this Subscription.

If the requested value is 0 or negative, the Servershall revise with the fastest supported publishing interval.

requestedLifetimeCount

Counter

Requested lifetime count (see 7.8for Counterdefinition). The lifetime count shall be a minimum of three times the keep keep-alive count.

When the publishing timer has expired this number of times without a Publishrequest being available to send a NotificationMessage, then the Subscriptionshall be deleted by the Server.

requestedMaxKeepAlive

Count

Counter

Requested maximum keep-alive count (see 7.8for Counterdefinition). When the publishing timer has expired this number of times without requiring any NotificationMessageto be sent, the Subscriptionsends a keep-alive Messageto the Client.

The negotiated value for this parameter is returned in the response.

If the requested value is 0, the Servershall revise with the smallest supported keep-alive count.

maxNotificationsPerPublish

Counter

The maximum number of notifications that the Clientwishes to receive in a single Publishresponse. A value of zero indicates that there is no limit.

The number of notifications per Publishis the sum of monitoredItems in the DataChangeNotification and events in the EventNotificationList.

publishingEnabled

Boolean

A Booleanparameter with the following values:

TRUEpublishing is enabled for the Subscription.

FALSEpublishing is disabled for the Subscription.

The value of this parameter does not affect the value of the monitoring mode Attributeof MonitoredItems.

priority

Byte

Indicates the relative priority of the Subscription. When more than one Subscriptionneeds to send Notifications, the Servershould de-queue a Publish request to the Subscriptionwith the highest prioritynumber. For Subscriptionswith equal prioritythe Servershould de-queue Publish requests in a round-robin fashion.

A Clientthat does not require special priority settings should set this value to zero.

Response

responseHeader

Response Header

Common response parameters (see 7.34for ResponseHeaderdefinition).

subscriptionId

IntegerId

The Server-assigned identifier for the Subscription(see 7.19for IntegerIddefinition). This identifier shall be unique for the entire Server, not just for the Session, in order to allow the Subscriptionto be transferred to another Sessionusing the TransferSubscriptions service.

After Serverstart-up the generation of subscriptionIdsshould start from a random IntegerIdor continue from the point before the restart.

revisedPublishingInterval

Duration

The actual publishing interval that the Serverwill use, expressed in milliseconds. The Servershould attempt to honour the Clientrequest for this parameter, but may negotiate this value up or down to meet its own constraints.

revisedLifetimeCount

Counter

The lifetime of the Subscriptionshall be a minimum of three times the keep-alive interval negotiated by the Server.

revisedMaxKeepAliveCount

Counter

The actual maximum keep-alive count (see 7.8for Counterdefinition). The Servershould attempt to honour the Clientrequest for this parameter, but may negotiate this value up or down to meet its own constraints.

Table 89defines the Serviceresults specific to this Service. Common StatusCodesare defined in Table 182.

Table 89– CreateSubscription Service Result Codes

Symbolic Id

Description

Bad_TooManySubscriptions

The Serverhas reached its maximum number of Subscriptions.