OPC Studio User's Guide and Reference
PullNotificationQueueCapacity Property (_EasyAEClient)
Example 



View with Navigation Tools
OpcLabs.EasyOpcClassic Assembly > OpcLabs.EasyOpc.AlarmsAndEvents.ComTypes Namespace > _EasyAEClient Interface : PullNotificationQueueCapacity Property
Capacity of the event pull queue for notifications.
Syntax
'Declaration
 
Property PullNotificationQueueCapacity As Integer
 
'Usage
 
Dim instance As _EasyAEClient
Dim value As Integer
 
instance.PullNotificationQueueCapacity = value
 
value = instance.PullNotificationQueueCapacity

Property Value

Valid values of this property are in the range from 0 to 2147483647 (Int32.MaxValue).

The default value of this property is 0.

Exceptions
ExceptionDescription

The value of an argument is outside the allowable range of values as defined by the invoked method.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

Remarks

The getter method of this property is pure, i.e. it does not have observable side effects.

This member or type is for use from COM. It is not meant to be used from .NET or Python. Refer to the corresponding .NET member or type instead, if you are developing in .NET or Python.

Example

COM

// This example shows how to subscribe to events and obtain the notification events by pulling them.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
// OPC client and subscriber examples in Object Pascal (Delphi) on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-OP .
// Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own
// a commercial license in order to use Online Forums, and we reply to every post.

class procedure PullNotification.Main;
var
  Client: OpcLabs_EasyOpcClassic_TLB._EasyAEClient;
  EndTick: Cardinal;
  EventArgs: _EasyAENotificationEventArgs;
  Handle: Integer;
  ServerDescriptor: _ServerDescriptor;
  State: OleVariant;
  SubscriptionParameters: _AESubscriptionParameters;
begin
  ServerDescriptor := CoServerDescriptor.Create;
  ServerDescriptor.ServerClass := 'OPCLabs.KitEventServer.2';

  // Instantiate the client object
  Client := CoEasyAEClient.Create;
  // In order to use event pull, you must set a non-zero queue capacity upfront.
  Client.PullNotificationQueueCapacity := 1000;

  WriteLn('Subscribing events...');
  SubscriptionParameters := CoAESubscriptionParameters.Create;
  SubscriptionParameters.NotificationRate := 1000;
  Handle := Client.SubscribeEvents(ServerDescriptor, SubscriptionParameters, true, State);

  WriteLn('Processing event notifications for 1 minute...');
  EndTick := Ticks + 60*1000;
  while Ticks < EndTick do
  begin
    EventArgs := Client.PullNotification(2*1000);
    if EventArgs <> nil then
      // Handle the notification event
      WriteLn(EventArgs.ToString);
  end;

  WriteLn('Unsubscribing events...');
  Client.UnsubscribeEvents(Handle);

  WriteLn('Finished.');
end;
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also