How to use ladder logic to access IP information of a ControlLogix Ethernet Module or a CompactLogix Controller

Refer to Tech Note 26779.

Access IP information of Logix Ethernet Modules with MSG instruction with environment 1756-ENBT, 1756-EN2T, 1756-EN2TR, 1756-EN3TR, 1756-EWEB, 1788-ENBT, 1768-ENBT, 1769-L35E, 5069-L306ER, 5069-L306ERM, 5069-L310ER, 5069-L310ER-NSE, 5069-L310ERM, 5069-L320ER, 5069-L320ERM, 5069-L330ER, 5069-L330ERM, 5069-L340ER, 5069-L340ERM.

The following steps describe how to access the IP Address of most of Logix Ethernet/IP modules via the user program.

Note: For 1756-ENET Ethernet module use the one described in Tech Note 18606.
Note: For 5380 controllers, having catalog numbers beginning with 5069, the following are used for the MSG configuration window:
  • Linear/DLR mode, use path=THIS and instance=1
  • Dual-IP mode, A1 enterprise port, use path=THIS and instance=2
  • Dual-IP mode, A2 device-level port, use path=THIS and instance=3
We recommend to import attached rungs to simplify UDT creation and Message Configuration.

Important: The import of the attached L5X files must be performed as "Import Rungs"



To get IP address import the MessageGetIP.L5X file into the program




Message details (already pre-configured):


Destination tag is UDT:

Please note:
octets are listed in reverse order with low octet represented in [0] member. 

octets presented in hexadecimal format to avoid negative numbers. In the example above the IP address is 10.88.208.132. Second rung converts optional Domain Name to a String
As an alternative SINT[70] array can be used as a destination. To set the module IP Address, import rung using MessageSetIP.L5X file
Message details (already pre-configured):


Source UDT must have valid information or message will fail. Source Array length should be 22 plus the length value in ipinfo[20], padded to an even number of bytes (pad not included in the length). As alternative, you can use attached Add-On instructions that obtain IP address in basic format above or convert all addresses to strings


Comments

Popular Posts