PortDock

PLC and HMI IP addresses and subnet masks — checking the subnet and joining it from a PC

No ping to the PLC or HMI? How the subnet mask (255.255.255.0 = /24) decides the subnet, one-way traffic from mismatched masks, and adding a PC address.

Tools for this guideNet Scan Windows program · freeModbus Master Windows program · freeIP Subnet Calculator web · no install

Factory devices often ship with fixed IPs such as 192.168.0.x or 192.168.1.x, while a laptop arrives with an address from the office network. So «the cable is in but ping fails» is common, and usually the two are simply not on the same subnet. This guide shows how a subnet mask decides that, and the usual mistakes.

What the subnet mask does

An IPv4 address has 32 bits. The 1 bits of the mask mark the «network» part and the 0 bits the «host» part; AND the address with the mask bit by bit and you get the network address.

Address 192.168.1.10 ANDed with mask 255.255.255.0 in binary gives network 192.168.1.0. Below, PC 192.168.1.200/24 and PLC 192.168.1.10/24 share a network and talk directly, while PC 192.168.0.200/24 and PLC 192.168.1.10/24 differ and need a gateway
Address AND mask = network address. Two hosts talk directly, without a gateway, only when their network addresses match.

A host ANDs the destination with its own mask. If the result equals its own network address it sends directly on Ethernet (asking for the MAC address with ARP); otherwise it sends to its default gateway (router). Even on the same switch, a different network address means the packet goes to the gateway — and with no gateway it goes nowhere.

Notation: 255.255.255.0 = /24

CIDRSubnet maskUsable addressesRange for 192.168.1.10
/16255.255.0.065,534192.168.0.1 – 192.168.255.254
/23255.255.254.0510192.168.0.1 – 192.168.1.254
/24255.255.255.0254192.168.1.1 – 192.168.1.254
/25255.255.255.128126192.168.1.1 – 192.168.1.126
/30255.255.255.2522192.168.1.9 – 192.168.1.10

/n means n leading one bits in the mask (CIDR, RFC 4632). The usable count is 2^(32 − n) − 2: the first (network) and last (broadcast) addresses cannot be given to a device (/31 and /32 are exceptions).

Common mistakes

Joining the device's subnet without dropping your network

Windows lets one adapter hold several IPv4 addresses. Add a free address on the device's network and you reach it while keeping the office connection (e.g. device 192.168.1.10 → add 192.168.1.200, mask 255.255.255.0 to the PC). Administrator rights are required.

Make sure no other device already uses that address, and remove the extra address when you are done.

When you don't know the device's IP

Check the factory default IP in the device manual first. Otherwise add a PC address on the suspected subnet and sweep it. On the same subnet ARP finds devices even when they block ping. ARP does not cross subnets, so if the subnet is unknown, try common defaults (192.168.0.x, 192.168.1.x, …) one by one.

In PortDock

Published 2026-10-23