Bind an OPC server item to an element of a control. The meaning of the index parameter depends on the control. In most cases it's the index of an array element, such as an Item[] element in a ListBox control.
The created Subscription object is returned to the user as an argument of the completion handler. The Subscription object allows the user to access properties of the Subscription and call methods of the underlaying classes. NOTE: It is not recommended to use the methods of the Subscription objects. Such calls is handled in the calling thread and may block the user thread for possibly long timeout intervals.
Visual Basic (Declaration) | |
---|---|
Public Overloads Sub Subscribe( _ ByVal itemID As String, _ ByVal updControl As Object, _ ByVal index As Integer, _ ByVal tag As Object, _ ByVal onCompleted As OnBGSubscribe _ ) |
C# | |
---|---|
public void Subscribe( string itemID, object updControl, int index, object tag, OnBGSubscribe onCompleted ) |
Parameters
- itemID
- Fully qualified item ID
- updControl
- Windows control object or callback handler
- index
- The meaning of this parameter depends on the control. In most cases it's the index of an array element, such as an Item[] element in a ListBox control.
- tag
- The object is passed to the competion handler and allows the user to pass any information that may be needed in the completion handler. null (nothing) can be specified if the application does not require to pass any information.
- onCompleted
- Competion notification handler. void xxx( BGException ex, Subscription odbSubscr, object tag ){}