INGEAR.NET.GELink

 

Controller.IPAddress Property

Gets/Sets the current IPAddress of the GE progammable logic controller

[Visual Basic]
NotOverridable Public Property IPAddress As String _
    Implements IController.IPAddress
[C#]
public string IPAddress {get; set;}

Property Value

Dotted-decimal string (e.g "192.168.1.45")

Implements

IController.IPAddress

Remarks

This property can be changed at runtime.

Know Issues on Windows 7

The default behavior is to allow the operating system to allocate the local endpoint ip port number for the Ethernet connection.  Some GE 9030/9070 PLC's have a firmware bug that refuses connections from endpoints that have a high value port number.  This problem occurs on Windows 7 and Windows 7(64-bit) machines.  To work around this 9030/9070 bug, you can specify and optional source port.
Controller.IPAddress = ipaddress<:portnum>

Example

Controller.IPAddress = "192.168.1.45:2235"

The port number 2235 will be bound to the local endpoint.  The user is responsible for port number allocation and management.  Please check with your IT department.  

 

Exceptions

Exception Type Condition
ArgumentNullException Thrown if IPAddress set to a null reference (Nothing in Visual Basic)
ArgumentOutOfRangeException Thrown if IPAddress.Length is less that 6 characters.

Example

VB
Try
    ' *****************************
    ' * initialize Controller class
    Dim MyPLC As New GELink.Controller()


   ' *****************************    ' * set the IP Address    MyPLC.IPAddress = "192.168.1.45"
   ' ****************************    ' * connect to PLC    If False = MyPLC.IsConnected Then        MyPLC.Connect()    End If
   ' ****************************    ' * check for errors    If MyPLC.ErrorCode = ResultCode.E_SUCCESS Then       Console.WriteLine("Connect Success")    Else       Console.WriteLine(MyPLC.ErrorString)    End If
Catch ex As Exception   Console.WriteLine(ex.Message) End Try
C# try {    //////////////////////////////    // initialize Controller    GELink.Controller MyPLC = new GELink.Controller();
   /////////////////////////////    // set IP Address    MyPLC.IPAddress = "192.168.1.45";
   /////////////////////////////    // connect to PLC    if (false == MyPLC.IsConnected)        MyPLC.Connect();
   /////////////////////////////    // check for errors    if (MyPLC.ErrorCode == ResultCode.E_SUCCESS)       Console.WriteLine("Connect Success");    else       Console.WriteLine(MyPLC.ErrorString); }
catch(System.Exception ex) {    Console.WriteLine(ex.Message); }
 

See Also

Controller Class | GELink Namespace | Connect | Timeout