22 lines
509 B
Plaintext
22 lines
509 B
Plaintext
|
|
Dim OPCServer
|
|
Set OPCServer = CreateObject("OPC.Automation.1")
|
|
OPCServer.Connect "Takebishi.Dxp.7"
|
|
Dim OPCGroup
|
|
Set OPCGroup = OPCServer.OPCGroups.Add("Group1")
|
|
OPCGroup.IsActive = True
|
|
OPCGroup.IsSubscribed = False
|
|
|
|
Dim ItemIDs(8)
|
|
Dim ClientHandles(8)
|
|
For i = 1 To 8
|
|
ItemIDs(i) = "Device1.D" & (i-1)
|
|
ClientHandles(i) = i
|
|
Next
|
|
|
|
Dim ServerHandles
|
|
Dim Errors
|
|
OPCGroup.OPCItems.AddItems 8, ItemIDs, ClientHandles, ServerHandles, Errors
|
|
WScript.Echo "Success! ServerHandles count: " & UBound(ServerHandles)
|
|
|