'Declaration
<ExtensionAttribute()> Public Overloads Shared Function SubscribeItem( _ ByVal client As IEasyDAClient, _ ByVal machineName As String, _ ByVal serverClass As String, _ ByVal itemId As String, _ ByVal dataType As VarType, _ ByVal requestedUpdateRate As Integer, _ ByVal percentDeadband As Single, _ ByVal callback As EasyDAItemChangedEventHandler, _ ByVal state As Object _ ) As Integer
'Usage
Dim client As IEasyDAClient Dim machineName As String Dim serverClass As String Dim itemId As String Dim dataType As VarType Dim requestedUpdateRate As Integer Dim percentDeadband As Single Dim callback As EasyDAItemChangedEventHandler Dim state As Object Dim value As Integer value = IEasyDAClientExtension.SubscribeItem(client, machineName, serverClass, itemId, dataType, requestedUpdateRate, percentDeadband, callback, state)
[Extension()] public static int SubscribeItem( IEasyDAClient client, string machineName, string serverClass, string itemId, VarType dataType, int requestedUpdateRate, float percentDeadband, EasyDAItemChangedEventHandler callback, object state )
[Extension()] public: static int SubscribeItem( IEasyDAClient^ client, String^ machineName, String^ serverClass, String^ itemId, VarType^ dataType, int requestedUpdateRate, float percentDeadband, EasyDAItemChangedEventHandler^ callback, Object^ state )
Parameters
- client
- The client object that will perform the operation.
- machineName
- Name of the machine (empty string for local computer).
- serverClass
- Contains ProgID of the OPC server.
- itemId
- ID of the item that will be subscribed to.
- dataType
- Specifies the data type requested. Passing OpcLabs.BaseLib.ComInterop.VarTypes.Empty means that the server's canonical data type should be used.
- requestedUpdateRate
- How often should the updates be received (number of milliseconds)
- percentDeadband
- The percent change in an item value that will cause an update
- callback
- A callback method to be invoked for each significant item change.
- state
- The state object (can be any object supplied by your code); available in event notifications.
Return Value
The method returns an integer handle that uniquely identifies the item subscription.