Remove method
Description | Removes one or more items from the OPCItems collection. |
Syntax | Remove (NumItems As Long, ServerHandles() As Long, Errors() As Long)NumItems — Number of items being removed.ServerHandles — Server assigned handle of affected items to be removed.Errors — Array of values indicating the success/failure of the individual items operation. |
Example | Dim arServerHandles() As Long Dim arErrors() As Long Dim i As Long Dim lNumitems As Long '/* Remove existing OPC items if they exist lNumitems = MyOPCGroup.OPCItems.Count '/* Dimension array for handles ReDim arServerHandles(1 To lNumitems) For i = 1 To lNumitems arServerHandles(i) = MyOPCGroup.OPCItems(i).ServerHandle Next 'I '/* Remove items MyOPCGroup.OPCItems.Remove lNumitems, arServerHandles, arErrors '/* Check for errors For i = LBound(arErrors) To UBound(arErrors) If arErrors(i) <> 0 Then txtStatus = MyOPCServer.GetErrorString(arErrors(i)) End If Next 'I |
Provide Feedback