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.
Factory address
Section titled “Factory address”A board with no application ever downloaded starts with a fixed address, like any PLC out of the box:
| IP | 192.168.1.50 |
| Subnet mask | 255.255.255.0 |
| Gateway | 192.168.1.1 |
| DNS | 8.8.8.8 |
| Mode | static |
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.
First connection
Section titled “First connection”- Connect the board to the PC, directly or through a switch.
- Give the PC an address in the same subnet, for example
192.168.1.10, mask255.255.255.0. - Check the link with
ping 192.168.1.50. - In CODESYS, open the device’s Communication Settings and scan the network, or type
192.168.1.50as the device address.
The board appears as nXPlc. From here login and download work exactly as on USB.
Network parameters
Section titled “Network parameters”The network configuration is part of the project: five parameters of the IO node, downloaded with the application.
| Parameter | ID | Type | Default | Meaning |
|---|---|---|---|---|
| Ethernet Mode | 6000 | USINT | 1 | 0 = DHCP, 1 = static |
| Ethernet IP | 6001 | STRING | 192.168.1.50 | address, in static mode |
| Ethernet SubnetMask | 6002 | STRING | 255.255.255.0 | subnet mask, in static mode |
| Ethernet Gateway | 6003 | STRING | 192.168.1.1 | default gateway, in static mode |
| Ethernet DNS | 6004 | STRING | 8.8.8.8 | DNS server, in static mode |
In DHCP mode the address, mask, gateway and DNS fields are ignored: everything comes from the DHCP server.
Changing the address
Section titled “Changing the address”- Set the new values in the IO node parameters.
- Download the application.
- 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.
- 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.
Where to read the current address
Section titled “Where to read the current address”Every time the network comes up, the device Log records which address is in use and why:
| Log line | Meaning |
|---|---|
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 |