我需要与工厂机器接口,在我们的每一家工厂,我们使用RSLinx与该机器进行通信。根据这篇博客文章,从RSLinx读取数据相对容易:
Dim OpcServer As New RsiOPCAuto.OPCServer
Dim OpcGroup As RsiOPCAuto.OPCGroup
Dim OpcItem As RsiOPCAuto.OPCItem
Dim vItem As String = ""
Try
OpcServer.Connect("RSLinx Remote OPC Server", "192.168.195.128")
' Add this group to the shared topic
OpcGroup = OpcServer.OPCGroups.Add("INDEC")
OpcGroup.IsSubscribed = False
OpcGroup.IsActive = False
OpcGroup.UpdateRate = 250
OpcGroup.OPCItems.DefaultAccessPath = "OPC_Test"
OpcGroup.OPCItems.AddItem("OPC_Bit001", 1)
OpcItem = OpcGroup.OPCItems.Item(1)
OpcItem.Read(2, vItem)
OpcItem = Nothing
OpcServer.OPCGroups.RemoveAll()
OpcGroup = Nothing
OpcServer.Disconnect()
OpcServer = Nothing
'Add and Error the list box
Catch ex As PlatformNotSupportedException
MsgBox("Error In Get Plc Data: " & ex.Message)
End Try
MsgBox(vItem)但是..。它说我需要添加对RsiOPCAuto.dll的引用,但我不知道:
特别是,我很好奇是否有人知道我在哪里可以找到那个DLL。
发布于 2013-08-26 00:09:33
此文件RsiOpcAuto.dll位于c/programfiles/commonfiles/Rockwell中,只要您有许可的rslinx或专业版本(网关) 2.54或以下。
https://stackoverflow.com/questions/13846670
复制相似问题