SungjuNewPrime/OPC Server Setting/OPC Client sample(DotNet to Delphi13)/Delphi13_VCL/test.vbs
jhw 6516e4a8f0 first upload
OPC test program upload
2026-09-04 11:41:21 +09:00

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)