OPC Studio User's Guide and Reference
PullDataChangeNotificationQueueCapacity Property (_EasyUAClient)
Example 



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA.ComTypes Namespace > _EasyUAClient Interface : PullDataChangeNotificationQueueCapacity Property
Capacity of the event pull queue for data change notifications.
Syntax
'Declaration
 
Property PullDataChangeNotificationQueueCapacity As Integer
'Usage
 
Dim instance As _EasyUAClient
Dim value As Integer
 
instance.PullDataChangeNotificationQueueCapacity = value
 
value = instance.PullDataChangeNotificationQueueCapacity
int PullDataChangeNotificationQueueCapacity {get; set;}
property int PullDataChangeNotificationQueueCapacity {
   int get();
   void set (    int value);
}

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

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

COM

// This example shows how to subscribe to changes of a single monitored item, pull events, and display each change.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
// 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.

var Client = new ActiveXObject("OpcLabs.EasyOpc.UA.EasyUAClient");
// In order to use event pull, you must set a non-zero queue capacity upfront.
Client.PullDataChangeNotificationQueueCapacity = 1000;

WScript.Echo("Subscribing...");
Client.SubscribeDataChange(
    //"http://opcua.demo-this.com:51211/UA/SampleServer",
    "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer",
    "nsu=http://test.org/UA/Data/ ;i=10853", 1000);

WScript.Echo("Processing data change events for 1 minute...");
var endTime = new Date().getTime() + 60*1000
do {
    var EventArgs = Client.PullDataChangeNotification(2*1000);
    if (EventArgs !== null) {
        //  Handle the notification event
        WScript.Echo(EventArgs);
    }
} while(new Date().getTime() < endTime);
// This example shows how to subscribe to changes of a single monitored item, pull events, and display each change.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
// 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 PullDataChangeNotification.Main;
var
  Client: EasyUAClient;
  EndTick: Cardinal;
  EventArgs: _EasyUADataChangeNotificationEventArgs;
begin
  // Instantiate the client object
  Client := CoEasyUAClient.Create;
  // In order to use event pull, you must set a non-zero queue capacity upfront.
  Client.PullDataChangeNotificationQueueCapacity := 1000;

  WriteLn('Subscribing...');
  Client.SubscribeDataChange(
    //'http://opcua.demo-this.com:51211/UA/SampleServer',
    'opc.tcp://opcua.demo-this.com:51210/UA/SampleServer',
    'nsu=http://test.org/UA/Data/ ;i=10853',
    1000);

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

  WriteLn('Unsubscribing...');
  Client.UnsubscribeAllMonitoredItems;

  WriteLn('Finished.');
end;
// This example shows how to subscribe to changes of a single monitored item, pull events, and display each change.
//
// 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 PullDataChangeNotification.Main;
var
  Client: OpcLabs_EasyOpcUA_TLB._EasyUAClient;
  EndTick: Cardinal;
  EventArgs: _EasyUADataChangeNotificationEventArgs;
begin
  // Instantiate the client object
  Client := CoEasyUAClient.Create;
  // In order to use event pull, you must set a non-zero queue capacity upfront.
  Client.PullDataChangeNotificationQueueCapacity := 1000;

  WriteLn('Subscribing...');
  Client.SubscribeDataChange(
      //'http://opcua.demo-this.com:51211/UA/SampleServer',
      //'https://opcua.demo-this.com:51212/UA/SampleServer/',
      'opc.tcp://opcua.demo-this.com:51210/UA/SampleServer',
    'nsu=http://test.org/UA/Data/ ;i=10853',
    1000);

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

  WriteLn('Unsubscribing...');
  Client.UnsubscribeAllMonitoredItems;

  WriteLn('Finished.');
end;
// This example shows how to subscribe to changes of a single monitored item, pull events, and display each change.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
// OPC client and subscriber examples in PHP on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-PHP .
// 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.

$Client = new COM("OpcLabs.EasyOpc.UA.EasyUAClient");
// In order to use event pull, you must set a non-zero queue capacity upfront.
$Client->PullDataChangeNotificationQueueCapacity = 1000;

print "Subscribing...\n";
$Client->SubscribeDataChange(
    //"http://opcua.demo-this.com:51211/UA/SampleServer", 
    "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer", 
    "nsu=http://test.org/UA/Data/ ;i=10853", 
    1000);

print "Processing data change events for 1 minute...\n";
$endTime = time() + 60;
do {
    $EventArgs = $Client->PullDataChangeNotification(2*1000);
    if (!is_null($EventArgs)) {
        // Handle the notification event
        print $EventArgs->ToString();
        print "\n";
    }
} while (time() < $endTime);
# This example shows how to subscribe to changes of a single monitored item, pull events, and display each change.
#
# The Python for Windows (pywin32) extensions package is needed. Install it using "pip install pypiwin32".
# CAUTION: We now recommend using Python.NET package instead. Full set of examples with Python.NET is available!
#
# Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
import time
import win32com.client

# Instantiate the client object
client = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.EasyUAClient') 
# In order to use event pull, you must set a non-zero queue capacity upfront.
client.PullDataChangeNotificationQueueCapacity = 1000

print('Subscribing...')
client.SubscribeDataChange('opc.tcp://opcua.demo-this.com:51210/UA/SampleServer', 'nsu=http://test.org/UA/Data/ ;i=10853', 1000)

print('Processing data change events for 1 minute...')
endTime = time.time() + 60
while time.time() < endTime:
    eventArgs = client.PullDataChangeNotification(2*1000)
    if eventArgs is not None:
        # Handle the notification event
        print(eventArgs)
REM This example shows how to subscribe to changes of a single monitored item, pull events, and display each change.
REM
REM Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
REM OPC client and subscriber examples in Visual Basic on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-VB .
REM Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own
REM a commercial license in order to use Online Forums, and we reply to every post.

Public Sub PullDataChangeNotification_Main_Command_Click()
    OutputText = ""
    
    Dim eventArgs As EasyUADataChangeNotificationEventArgs
    
    ' Instantiate the client object
    Dim Client As New EasyUAClient
    
    ' In order to use event pull, you must set a non-zero queue capacity upfront.
    Client.PullDataChangeNotificationQueueCapacity = 1000
    
    OutputText = OutputText & "Subscribing..." & vbCrLf
    Call Client.SubscribeDataChange("opc.tcp://opcua.demo-this.com:51210/UA/SampleServer", "nsu=http://test.org/UA/Data/ ;i=10853", 1000)

    OutputText = OutputText & "Processing data changed notification events for 1 minute..." & vbCrLf
    
    Dim EndTick As Long
    EndTick = GetTickCount + 60000
    While GetTickCount < EndTick
        Set eventArgs = Client.PullDataChangeNotification(2 * 1000)
        If Not eventArgs Is Nothing Then
            ' Handle the notification event
            OutputText = OutputText & eventArgs & vbCrLf
        End If
    Wend
    
    OutputText = OutputText & "Unsubscribing..." & vbCrLf
    Client.UnsubscribeAllMonitoredItems

    OutputText = OutputText & "Finished." & vbCrLf
End Sub
Rem This example shows how to subscribe to changes of a single monitored item, pull events, and display each change.
Rem
Rem Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
Rem OPC client and subscriber examples in VBScript on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-VBScript .
Rem Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own
Rem a commercial license in order to use Online Forums, and we reply to every post.

Option Explicit

' Instantiate the client object
Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.UA.EasyUAClient")
' In order to use event pull, you must set a non-zero queue capacity upfront.
Client.PullDataChangeNotificationQueueCapacity = 1000

WScript.Echo "Subscribing..."
Client.SubscribeDataChange "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer", "nsu=http://test.org/UA/Data/ ;i=10853", 1000

WScript.Echo "Processing data change events for 1 minute..."
Dim endTime: endTime = Now() + 60*(1/24/60/60)
Do
    Dim EventArgs: Set EventArgs = Client.PullDataChangeNotification(2*1000)
    If Not (EventArgs Is Nothing) Then
        ' Handle the notification event
        WScript.Echo EventArgs
    End If    
Loop While Now() < endTime
# This example shows how to subscribe to changes of multiple monitored items, pull events, and display each change.
#
# The Python for Windows (pywin32) extensions package is needed. Install it using "pip install pypiwin32".
# CAUTION: We now recommend using Python.NET package instead. Full set of examples with Python.NET is available!
#
# Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
import time
import win32com.client

# Instantiate the client object
client = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.EasyUAClient') 
# In order to use event pull, you must set a non-zero queue capacity upfront.
client.PullDataChangeNotificationQueueCapacity = 1000

print('Subscribing...')
monitoringParameters = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.UAMonitoringParameters')
monitoringParameters.SamplingInterval = 1000

monitoredItemArguments1 = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.OperationModel.EasyUAMonitoredItemArguments')
monitoredItemArguments1.EndpointDescriptor.UrlString = 'opc.tcp://opcua.demo-this.com:51210/UA/SampleServer'
monitoredItemArguments1.NodeDescriptor.NodeId.ExpandedText = 'nsu=http://test.org/UA/Data/ ;i=10845'
monitoredItemArguments1.MonitoringParameters = monitoringParameters

monitoredItemArguments2 = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.OperationModel.EasyUAMonitoredItemArguments')
monitoredItemArguments2.EndpointDescriptor.UrlString = 'opc.tcp://opcua.demo-this.com:51210/UA/SampleServer'
monitoredItemArguments2.NodeDescriptor.NodeId.ExpandedText = 'nsu=http://test.org/UA/Data/ ;i=10853'
monitoredItemArguments2.MonitoringParameters = monitoringParameters

monitoredItemArguments3 = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.OperationModel.EasyUAMonitoredItemArguments')
monitoredItemArguments3.EndpointDescriptor.UrlString = 'opc.tcp://opcua.demo-this.com:51210/UA/SampleServer'
monitoredItemArguments3.NodeDescriptor.NodeId.ExpandedText = 'nsu=http://test.org/UA/Data/ ;i=10855'
monitoredItemArguments3.MonitoringParameters = monitoringParameters

arguments = [
    monitoredItemArguments1,
    monitoredItemArguments2,
    monitoredItemArguments3
    ]
client.SubscribeMultipleMonitoredItems(arguments)

print('Processing data change events for 1 minute...')
endTime = time.time() + 60
while time.time() < endTime:
    eventArgs = client.PullDataChangeNotification(2*1000)
    if eventArgs is not None:
        # Handle the notification event
        print(eventArgs)
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