在用VB.NET编写OPC读写西门子S7400程序时候,碰到以上句柄问题,请问该问题如何解决?
Public Shared MyItemServerHandles2 As System.Array
Private Sub PLC_AsyncWrite(ByVal NumItemsW As Integer, ByRef ItemValuesW() As System.Object, ByRef MyErrors As System.Array)
Dim lHandle(U_NUMITEMS) As System.Array
Dim i As Integer
If MyGroup2 Is Nothing Then
Exit Sub
End If
If MyGroup2.OPCItems.Count > 0 Then
lTransID_Rd2 = lTransID_Rd2 + 1
For i = 1 To 30
lHandle(i) = MyItemServerHandles2(NumItemsW)
MyGroup2.AsyncWrite(1, lHandle(i), ItemValuesW,
MyErrors, lTransID_Rd2, lCancelID_Rd2)
Next
End If
End Sub