- First create a USER DEFINED tag called IP, and configure it as shown below:
- Create a CIP message instruction like the one shown below.
NOTE: Tag B3.0 is not required.
- Configure the CIP message as shown below. Note that the destination tag ENET_IP_INFO
is a tag of type IP (User Defined).
- 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.
- 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
- 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.
Saturday, February 25, 2012
Obtaining Ethernet IP information from a 1756-ENET
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment