Connects the instances of the Controller class to the Allen-Bradley device
ResultCode.SUCCESS if successful, else error. ResultCode for list of possible failures
Your application does not need to explicitly call Connect. Calling ReadTag, WriteTag, GroupRead or GroupWrite will automatically establish a connection if the Controller class is not already connected.
VB ' ******************************** ' * initialize controller class Dim MyPLC as New ABLink.Controller() ' ******************************** ' * set the IP Address MyPLC.IPAddress = "192.168.1.33" ' ******************************** ' * set the CPU Type MyPLC.CPUType = CPU.PLC ' ******************************** ' * set the Driver Type MyPLC.DriverType = Driver.ENET ' ******************************** ' * connect to the PLC MyPLC.Connect() ' ******************************** ' * report connection status Console.WriteLine(MyPLC.ErrorString)
C# ////////////////////////////////// // initialize controller ABLink.Controller MyPLC = new ABLink.Controller() ////////////////////////////////// // set the IP address MyPLC.IPAddress = "192.168.1.33"; ////////////////////////////////// // set the cpu type MyPLC.CPUType = CPU.PLC; ////////////////////////////////// // set the driver type MyPLC.DriverType = Driver.ENET; ////////////////////////////////// // connect to the PLC MyPLC.Connect(); ////////////////////////////////// // report connection status Console.WriteLine (MyPLC.ErrorString);
Controller Class | ABLink Namespace | IPAddress | CPUType | DriverType | Path | IsConnected