photovoltaic Posted December 12, 2022 Report Posted December 12, 2022 (edited) View File 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. Submitter photovoltaic Submitted 12/12/2022 Category PLC Sample Code Edited December 22, 2022 by photovoltaic Quote
Recommended Posts
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.