QuickOPC User's Guide and Reference
ChangeItemSubscription Method (_EasyDAClient)
Example 



OpcLabs.EasyOpcClassic Assembly > OpcLabs.EasyOpc.DataAccess.ComTypes Namespace > _EasyDAClient Interface : ChangeItemSubscription Method
Item subscription handle as returned by the SubscribeItem method
The new requested update rate.
Changes parameters of a subscription. Specify handle, and requested update rate.
Syntax
'Declaration
 
Sub ChangeItemSubscription( _
   ByVal handle As Integer, _
   ByVal requestedUpdateRate As Integer _
) 
'Usage
 
Dim instance As _EasyDAClient
Dim handle As Integer
Dim requestedUpdateRate As Integer
 
instance.ChangeItemSubscription(handle, requestedUpdateRate)
void ChangeItemSubscription( 
   int handle,
   int requestedUpdateRate
)
void ChangeItemSubscription( 
   int handle,
   int requestedUpdateRate
) 

Parameters

handle
Item subscription handle as returned by the SubscribeItem method
requestedUpdateRate
The new requested update rate.
Remarks

It is more efficient to change multiple subscriptions using ChangeMultipleItemSubscriptions method.

Example

COM

Rem This example shows how change the update rate of an existing subscription.

Option Explicit

Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.DataAccess.EasyDAClient")
WScript.ConnectObject Client, "Client_"

WScript.Echo "Subscribing..."
Dim handle: handle = Client.SubscribeItem("", "OPCLabs.KitServer.2", "Simulation.Random", 1000)

WScript.Echo "Waiting for 10 seconds..."
WScript.Sleep 10*1000

WScript.Echo "Changing subscription..."
Client.ChangeItemSubscription handle, 100

WScript.Echo "Waiting for 10 seconds..."
WScript.Sleep 10*1000

WScript.Echo "Unsubscribing..."
Client.UnsubscribeAllItems

WScript.Echo "Waiting for 10 seconds..."
WScript.Sleep 10*1000

WScript.DisconnectObject Client
Set Client = Nothing



Sub Client_ItemChanged(Sender, e)
    If Not (e.Succeeded) Then
        WScript.Echo "*** Failure: " & e.ErrorMessageBrief
        Exit Sub
    End If

    WScript.Echo e.Vtq
End Sub
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