Saturday, February 25, 2012

Obtaining Ethernet IP information from a 1756-ENET

  1. First create a USER DEFINED tag called IP, and configure it as shown below:



  2. Create a CIP message instruction like the one shown below.

    NOTE: Tag B3.0 is not required.




  3. Configure the CIP message as shown below.  Note that the destination tag ENET_IP_INFO
    is a tag of type IP (User Defined).





  4. Also note that the values that come back into IPx will be in reverse order.

    Example:
    IP Address of 130.151.191.138  would come back as:

    ENET_IP_INFO.IP1 = 8Ah = -118 (SINT) = 138 (DINT)
    ENET_IP_INFO.IP2 = BFh = -65  (SINT) = 191 (DINT)
    ENET_IP_INFO.IP3 = 97h = -105 (SINT) = 151 (DINT)
    ENET_IP_INFO.IP4 = 82h = -126 (SINT) = 130 (DINT)

    Since the values that come back have to be stored in a SINT, you would need to move them to an INT or a DINT.

    Below, I use the BTD (Bit Field Distribute) functions to move the data.





  5. To determine if the Modules Bootp is enabled, create a MSG instruction configured as shown below:




    Memory5 is a DINT array, 2 elements in length.

    -  If Memory5[0] = 0, then Bootp is DISABLED

    -  If Memory5[0] = 1, then Bootp is ENABLED

  6. To enable or disabled Bootp, you would configure a MSG instruction as shown below:



     - Place a value of 1 into Memory5[0] to ENABLE bootp.

     - Place a value of 0 into Memory5[0] to DISABLE bootp.

    After changing the modules mode to bootp, the module will not request a bootp
    address until the next time it is power cycled.
Source : http://rockwellautomation.custhelp.com/app/answers/detail/a_id/18606/related/1

No comments:

Post a Comment