Hi... Can you teach me how to create a program from vb8 that reads and write to plc5 or plc500 without connecting rs232..??? i have a rslinx classic but i dont know how to link it to vb8... there are to many errors when i try to program it... Dim OpcServer As New RsiOPCAut
PCServer
Dim OpcGroup As RsiOPCAut
PCGroup
Dim OpcItem As RsiOPCAut
PCItem
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)
it does not work....
the errors are
Error 1 Type 'RsiOPCAut
PCServer' is not defined.
Error 2 Type 'RsiOPCAut
PCGroup' is not defined.
Error 3 Type 'RsiOPCAut
PCItem' is not defined.
hope you can help me..thanks.....