VB 2008 & Allen Bradley PLC
VB 2008 & Allen Bradley PLC
(OP)
How do you get Vb 2008 to talk to a Allen Bradley PLC, using RSLinx? I have tried the link data and such that is in the FAQ, and it doesn't recognize the language. Some help please.





RE: VB 2008 & Allen Bradley PLC
CODE
Dim OpcServer As New RsiOPCAuto.OPCServer
Dim OpcGroup As RsiOPCAuto.OPCGroup
Dim OpcItem As RsiOPCAuto.OPCItem
Dim vItem As String = ""
Try
OpcServer.Connect("RSLinx OPC Server")
' Add this group to the shared topic
OpcGroup = OpcServer.OPCGroups.Add(MY_GROUP)
OpcGroup.IsSubscribed = False
OpcGroup.IsActive = False
OpcGroup.UpdateRate = 250
OpcGroup.OPCItems.DefaultAccessPath = OPC_SHARE
OpcGroup.OPCItems.AddItem(strAddress, 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
Return vItem
End Function
RE: VB 2008 & Allen Bradley PLC
RE: VB 2008 & Allen Bradley PLC
Not sure of what else is needed.