Skip to content

Ethernet

nXPlc has an on-board Ethernet port, and it is the port CODESYS uses: login, download and online monitoring all go over the network. The board has a single IP address, and it answers ping on it.

A board with no application ever downloaded starts with a fixed address, like any PLC out of the box:

IP192.168.1.50
Subnet mask255.255.255.0
Gateway192.168.1.1
DNS8.8.8.8
Modestatic

It needs no download and no DHCP server: connect the cable, and the board answers on 192.168.1.50.

The same port also carries the application’s own traffic: see Modbus TCP.

  1. Connect the board to the PC, directly or through a switch.
  2. Give the PC an address in the same subnet, for example 192.168.1.10, mask 255.255.255.0.
  3. Check the link with ping 192.168.1.50.
  4. In CODESYS, open the device’s Communication Settings and scan the network, or type 192.168.1.50 as the device address.

The board appears as nXPlc. From here login and download work exactly as on USB.

The network configuration is part of the project: five parameters of the IO node, downloaded with the application.

ParameterIDTypeDefaultMeaning
Ethernet Mode6000USINT10 = DHCP, 1 = static
Ethernet IP6001STRING192.168.1.50address, in static mode
Ethernet SubnetMask6002STRING255.255.255.0subnet mask, in static mode
Ethernet Gateway6003STRING192.168.1.1default gateway, in static mode
Ethernet DNS6004STRING8.8.8.8DNS server, in static mode

In DHCP mode the address, mask, gateway and DNS fields are ignored: everything comes from the DHCP server.

  1. Set the new values in the IO node parameters.
  2. Download the application.
  3. About a second later the board switches to the new address. The CODESYS connection drops: that is expected, the PC is still talking to the old address.
  4. Point Communication Settings at the new address and log in again.

No restart is needed. A download that leaves the network parameters unchanged does not touch the network — including the first download of a project left at the defaults, which are the same as the factory ones.

With Ethernet Mode set to 0 the board asks a DHCP server for its address, and introduces itself to the router with the name nXPlc followed by 6 hexadecimal digits, the last three bytes of the MAC (for example nXPlc1A2B3C): look for it in the router’s client list.

If no DHCP server answers within 15 seconds, the board falls back to 192.168.1.50 / 255.255.255.0 and stays reachable.

Every time the network comes up, the device Log records which address is in use and why:

Log lineMeaning
Ethernet pronta (statico): IP …static address from the parameters
Ethernet pronta (DHCP): IP …address assigned by the DHCP server
Ethernet pronta (IP di ripiego): IP …no DHCP answer: fallback address in use
IP cambiato: sessione CODESYS precedente chiusa, …the address changed after a download