Jump to content

Recommended Posts

Posted (edited)

NJ/NX Get IP Address


A Library containing a function Block that can be run on any Omron NJ or NX PLC. The Function Block will retrieve the host PLC's IP address, Subnet Mask, Gateway, and MAC Address. The Port Details are displayed through 2 structures , 1 per-port. In the event you only have 1 Ethernet port then the structure for the 2nd port will contain all 0s. Data Format:

IP Address - USINT[4]

Subnet - USINT[4]

Gateway - USINT[4]

MAC - BYTE[6]  (hex value)

Access the retrieved details by the typical parent-child tag structure. ex. Port_1_Detals.IP_Address[0] will get the first octet of Port 1's IP.

Tested on: NX1P2, NX102, NX502, NX7, and NJ301

IMPORTANT: This Function Block should not be run immediately after startup. Allow the PLC a few seconds to establish a connection with the Ethernet network.


 

Edited by photovoltaic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...