uaPLUS Reference
CreateEventSubscription Method
See Also  Send Feedback
NSPlugin Namespace > AlarmEventServer Class : CreateEventSubscription Method

active
FALSE if the Event Subscription is to be created inactive. TRUE if the Event Subscriptions is to be created as active. If the subscription is inactive, then the server will not send event notifications to the client based on the subscription, and has no responsibility to buffer or maintain the event notifications. Thus event notifications may be lost.
bufferTime
The requested buffer time. The buffer time is in milliseconds and tells the server how often to send event notifications. This is a minimum time - do not send event notifications any faster that this UNLESS dwMaxSize is greater than 0, in which case the server will send an event notification sooner to obey the dwMaxSize parameter. A value of 0 for dwBufferTime means that the server should send event notifications as soon as it gets them. This parameter along with the dwMaxSize parameter are used to improve communications efficiency between client and server. This parameter is a recommendation from the client, and the server is allowed to ignore the parameter. The server will return the buffer time it is actually providing in pdwRevisedBufferTime. If the revised buffer time does not equal the requested buffer time, then the server must return OPC_S_INVALIDBUFFERTIME, unless dwMaxSize is also invalid in which case the server must return OPC_S_INVALIDMAXSIZE.
maxSize
The requested maximum number of events that will be sent in a single OnEvent callback. A value of 0 means that there is no limit to the number of events that will be sent in a single callback. Note that a value of dwMaxSize greater than 0, may cause the server to call the OnEvent callback more frequently than specified in the dwBufferTime parameter when a large number of events are being generated in order to limit the number of events to the dwMaxSize. This parameter is a recommendation from the client and the server is allowed to ignore this parameter. The server will return the actual number of events it is actually providing in pdwRevisedMaxSize. If the requested MaxSize does not equal the revised MaxSize then the Server must return OPC_S_INVALIDMAXSIZE.
clientSubscription
Client provided handle for this event subscription. This handle is passed back in the OnEvent callback to identify the subscription object that is calling back. The client should assign a unique value of hClientSubscription for each subscription object in order to detect the source of the callback information.
revisedBufferTime
The buffer time that the server is actually providing, which may differ from dwBufferTime.
revisedMaxSize
The maximum number of events that the server will actually be sending in a single OnEvent callback, which may differ from dwMaxSize.
evs
returns the created EventSubscription object.

Glossary Item Box

Add an Event Subscription object to an Event Server. Create an OPCEventSubcription object on behalf of this client and return an interface to the Client. This object will support at least IUnknown, IOPCEventSubscriptionMgt and IConnectionPointContainer. The client can manage the state of this interface including the filter and can create subscriptions to it via ConnectionPoints as described later.

Syntax

Visual Basic (Declaration) 
Public Function CreateEventSubscription( _
   ByVal active As Boolean, _
   ByVal bufferTime As Integer, _
   ByVal maxSize As Integer, _
   ByVal clientSubscription As Integer, _
   ByRef revisedBufferTime As Integer, _
   ByRef revisedMaxSize As Integer, _
   ByRef evs As EventSubscription _
) As Integer
C# 
public int CreateEventSubscription( 
   bool active,
   int bufferTime,
   int maxSize,
   int clientSubscription,
   out int revisedBufferTime,
   out int revisedMaxSize,
   out EventSubscription evs
)

Parameters

active
FALSE if the Event Subscription is to be created inactive. TRUE if the Event Subscriptions is to be created as active. If the subscription is inactive, then the server will not send event notifications to the client based on the subscription, and has no responsibility to buffer or maintain the event notifications. Thus event notifications may be lost.
bufferTime
The requested buffer time. The buffer time is in milliseconds and tells the server how often to send event notifications. This is a minimum time - do not send event notifications any faster that this UNLESS dwMaxSize is greater than 0, in which case the server will send an event notification sooner to obey the dwMaxSize parameter. A value of 0 for dwBufferTime means that the server should send event notifications as soon as it gets them. This parameter along with the dwMaxSize parameter are used to improve communications efficiency between client and server. This parameter is a recommendation from the client, and the server is allowed to ignore the parameter. The server will return the buffer time it is actually providing in pdwRevisedBufferTime. If the revised buffer time does not equal the requested buffer time, then the server must return OPC_S_INVALIDBUFFERTIME, unless dwMaxSize is also invalid in which case the server must return OPC_S_INVALIDMAXSIZE.
maxSize
The requested maximum number of events that will be sent in a single OnEvent callback. A value of 0 means that there is no limit to the number of events that will be sent in a single callback. Note that a value of dwMaxSize greater than 0, may cause the server to call the OnEvent callback more frequently than specified in the dwBufferTime parameter when a large number of events are being generated in order to limit the number of events to the dwMaxSize. This parameter is a recommendation from the client and the server is allowed to ignore this parameter. The server will return the actual number of events it is actually providing in pdwRevisedMaxSize. If the requested MaxSize does not equal the revised MaxSize then the Server must return OPC_S_INVALIDMAXSIZE.
clientSubscription
Client provided handle for this event subscription. This handle is passed back in the OnEvent callback to identify the subscription object that is calling back. The client should assign a unique value of hClientSubscription for each subscription object in order to detect the source of the callback information.
revisedBufferTime
The buffer time that the server is actually providing, which may differ from dwBufferTime.
revisedMaxSize
The maximum number of events that the server will actually be sending in a single OnEvent callback, which may differ from dwMaxSize.
evs
returns the created EventSubscription object.

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows 7, Windows Server 2008 family

See Also

© 2010-2018 Copyright Advosol Inc. All Rights Reserved.