5 Service Sets ToC Previous Next

5.13 Subscription Service Set ToC Previous Next

5.13.2 CreateSubscription ToC Previous Next

5.13.2.1 Description ToC

This Service is used to create a Subscription. Subscriptions monitor a set of MonitoredItems for Notifications and return them to the Client in response to Publish requests.

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

5.13.2.2 Parameters ToC

Table 88 defines the parameters for the Service.

Table 88 – CreateSubscription Service Parameters

Name Type Description
Request    
   requestHeader Request Header Common request parameters (see 7.28 for RequestHeader definition).
   requestedPublishing
   Interval
Duration This interval defines the cyclic rate that the Subscription is being requested to return Notifications to the Client. This interval is expressed in milliseconds. This interval is represented by the publishing timer in the Subscription state table (see 5.13.1.2).
The negotiated value for this parameter returned in the response is used as the default sampling interval for MonitoredItems assigned to this Subscription.
If the requested value is 0 or negative, the Server shall revise with the fastest supported publishing interval.
   requestedLifetimeCount Counter Requested lifetime count (see 7.5 for Counter definition). 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 Publish request being available to send a NotificationMessage, then the Subscription shall be deleted by the Server.
   requestedMaxKeepAlive
   Count
Counter Requested maximum keep-alive count (see 7.5 for Counter definition). When the publishing timer has expired this number of times without requiring any NotificationMessage to be sent, the Subscription sends a keep-alive Message to the Client.
The negotiated value for this parameter is returned in the response.
If the requested value is 0, the Server shall revise with the smallest supported keep-alive count.
   maxNotificationsPerPublish Counter The maximum number of notifications that the Client wishes to receive in a single Publish response. A value of zero indicates that there is no limit.
The number of notifications per Publish is the sum of monitoredItems in the DataChangeNotification and events in the EventNotificationList.
   publishingEnabled Boolean A Boolean parameter with the following values:
   TRUE publishing is enabled for the Subscription.
   FALSE publishing is disabled for the Subscription.
The value of this parameter does not affect the value of the monitoring mode Attribute of MonitoredItems.
   priority Byte Indicates the relative priority of the Subscription. When more than one Subscription needs to send Notifications, the Server should de-queue a Publish request to the Subscription with the highest priority number. For Subscriptions with equal priority the Server should de-queue Publish requests in a round-robin fashion.
A Client that does not require special priority settings should set this value to zero.
       
Response    
   responseHeader Response Header Common response parameters (see 7.29 for ResponseHeader definition).
   subscriptionId IntegerId The Server-assigned identifier for the Subscription (see 7.14 for IntegerId definition). This identifier shall be unique for the entire Server, not just for the Session, in order to allow the Subscription to be transferred to another Session using the TransferSubscriptions service.
After Server start-up the generation of subscriptionIds should start from a random IntegerId or continue from the point before the restart.
   revisedPublishingInterval Duration The actual publishing interval that the Server will use, expressed in milliseconds. The Server should attempt to honour the Client request for this parameter, but may negotiate this value up or down to meet its own constraints.
   revisedLifetimeCount Counter The lifetime of the Subscription shall be a minimum of three times the keep-alive interval negotiated by the Server.
   revisedMaxKeepAliveCount Counter The actual maximum keep-alive count (see 7.5 for Counter definition). The Server should attempt to honour the Client request for this parameter, but may negotiate this value up or down to meet its own constraints.

5.13.2.3 Service results ToC

Table 89 defines the Service results specific to this Service. Common StatusCodes are defined in Table 177.

Table 89 – CreateSubscription Service Result Codes

Symbolic Id Description
Bad_TooManySubscriptions The Server has reached its maximum number of subscriptions.

Previous Next