Troubleshooting
Fixing Modbus TCP Addressing Errors Between an HMI and a PLC
Short answer
An HMI 'device not found' alarm over Modbus TCP usually means the panel sent a request outside the PLC's mapped registers, not that the network is down. Convert the PLC's byte offsets to register addresses with HMI address = 40000 + byte offset / 2, so a REAL at 100.32 becomes 40016 and 100.36 becomes 40018, and allocate booleans from 100.16 so the driver's grouped 16-bit read stays inside the mapped base.
On this page
- What the alarm is really telling you
- The PLC counts bytes; the panel counts registers
- Allocation rules that stay on the PLC side
- The boolean read that crosses the mapped base
- Match the symptom to the deciding check
- Isolate the failing request with one variable
- Verify the mapping after the alarm clears
- Questions asked
The panel reports that it cannot find the device even though the PLC IP address is entered and both projects downloaded. In this class of failure the alarm is addressing, not networking: the same window appears when the panel's request lands outside the PLC's mapped registers. The fix is arithmetic — the numeric HMI address is 40000 + byte offset / 2 — so the REALs at 100.32 and 100.36 become 40016 and 40018. This article gives the conversion, the allocation rules, the grouped boolean read that can cross the mapped base, and a one-variable test that isolates the failing request.
What the alarm is really telling you #
The window that says the device cannot be found is the panel's generic communication alarm. It fires when nothing answers, and it fires just the same when the server answers with a Modbus exception because the requested register range is unmapped. Entering the correct PLC IP address does not make an invalid register request valid, so check the address map before you touch the Ethernet side.
Moves that waste time at this stage:
- Re-entering the PLC IP address — it corrects a wrong address, not an out-of-range register request.
- Downloading the same projects again — the panel repeats the same invalid requests.
- Moving every variable deeper into memory — it only helps a boolean read that crosses the base, not the byte-to-register conversion.
- Rearranging REAL alignment — offsets 100.32 through 100.88 already meet the four-byte rule; the HMI addresses were the error.
In one such installation the PLC stayed reachable throughout, and the alarm cleared as soon as the numeric addresses were converted.
The PLC counts bytes; the panel counts registers #
Notation first: 100.32 means area 100, byte offset 32. It is not the decimal number 100.32, and only the number after the dot enters the conversion.
The Modbus protocol defines a holding register as 16 bits and carries a plain register number from 0 to 65535 in the request, so it knows nothing about byte offsets. The mapping for this connection bases numeric objects at 40000 with no additional offset:
HMI numeric address = 40000 + (byte offset / 2)
The arithmetic for the REALs in this layout:
- 100.32 → 40000 + 32 / 2 = 40000 + 16 = 40016
- 100.36 → 40000 + 36 / 2 = 40000 + 18 = 40018
- 100.88 → 40000 + 88 / 2 = 40000 + 44 = 40044
| PLC offset | Data type | Registers used | HMI address |
|---|---|---|---|
| 100.32 | REAL | 2 | 40016 |
| 100.36 | REAL | 2 | 40018 |
| 100.88 | REAL | 2 | 40044 |
Each REAL takes two consecutive registers because it takes four bytes. The 4x prefix and its digit count are the driver's entry convention rather than protocol content — the same ambiguity behind decoding a 4500001-style Modbus holding register address — so confirm which base your driver adds before trusting an inherited tag list.
Allocation rules that stay on the PLC side #
The conversion translates your PLC layout; it does not change it. Keep the alignment rules when you lay variables out:
- WORD — offset divisible by 2, occupies one register.
- DWORD and REAL — offset divisible by 4, each occupying two consecutive registers.
Numeric variables may begin at 100.0 whenever their alignment permits. The warning against using the start of the area applies to grouped boolean reads, not to numerics.
Keep three things separate when a value displays wrong: the PLC allocation, the HMI register address, and the HMI object's data format. A correctly addressed REAL still displays nonsense when the object is set to an integer format.
The boolean read that crosses the mapped base #
The Weintek driver described here does not read one boolean. When an object asks for the bit at 100.0, entered at 40000 on this panel, the driver issues one grouped request for 16 booleans beginning at 39992 — eight registers below the mapped base. A request that begins below the base is rejected, and the panel raises the same communication alarm even though every other request succeeds.
The fix is a placement rule, not a workaround: allocate booleans from 100.16 onward. The group for the bit at 100.16 begins at 40008, inside the mapped area.
Two cautions on boolean entry:
- Do not apply the divide-by-two formula to booleans; they use the driver's bit format, not numeric register entry.
- The notation differs from numerics — the working setup shows the bit at 100.16 entered as 400016, that driver's boolean notation, which is not the numeric register 40016.
In the installation behind this failure the boolean addresses were already correct and only the numeric conversion was wrong, so treat the grouped read as a check you run once rather than the default cause.
Match the symptom to the deciding check #
| Symptom | Likely cause | Deciding check |
|---|---|---|
| Alarm with numeric objects configured | Byte offsets entered directly as register offsets | Compare each address with 40000 + offset / 2 |
| Alarm appears when a boolean near the base is read | Grouped request begins below the mapped base | Test a boolean allocated at 100.16 or later |
| No response with one correctly mapped variable | Network path or a server not listening | Check the device connection settings and trace the request |
| Communication healthy, REAL displays a wild value | Data format or register word order | Compare a known PLC value against the object's format |
Isolate the failing request with one variable #
Reduce the noise before changing anything else:
- Keep one REAL at 100.32 in the PLC test program with a known, stable value.
- Point one numeric object at 40016 on the Modbus TCP connection to the PLC.
- Disable every other polling object, including objects on hidden screens and background functions that read the device.
- Download both projects, then check whether the alarm clears and the value matches.
- Add one boolean test at 100.16 or later, then restore the remaining variables in groups.
If the single correctly mapped variable still gets no reply, the fault is on the path: the PLC IP address, the panel network configuration, the selected device connection, or the PLC's Modbus server setup. A trace separates the outcomes — a timeout means nothing answered, while an exception means a server answered and rejected the request, so read its function code and register range before changing Ethernet settings.
Verify the mapping after the alarm clears #
A cleared alarm is the first acceptance check, not the last. An address can be valid and still point at the wrong variable.
- Change each test value in the PLC and watch the matching object; neighboring objects must not move.
- Confirm the REAL sequence advances two HMI registers per four PLC bytes: 100.32 → 40016 and 100.36 → 40018.
- For a wild value with healthy communication, check the object's data type and the driver's word-order setting before touching addresses; displaying a PLC REAL over Modbus covers the word-order detail.
- Test writes only on a variable that cannot actuate equipment: a write that lands in a neighboring register can start the machine. Confirm the intended variable changes and adjacent allocations do not.
- Restore all screens and background polling, then confirm communication stays healthy with every request active.
- Keep an address list — PLC byte offset, data type, HMI address, read or write — and check allocation size as well as alignment, because overlapping storage corrupts values even when every request succeeds.
Questions asked
The panel shows the alarm but the PLC still pings. Is the network down?
A successful ping only proves the IP address answers; it says nothing about register validity. The same alarm appears when the server replies with an exception because the requested register range is unmapped. If one correctly mapped variable still fails after the addresses are converted, check the device connection settings and the PLC's Modbus server, then trace the request: a timeout means nothing answered, an exception means the request was rejected.
Why is 40032 the wrong address for the REAL at 100.32?
Because 40032 equals 40000 + 64 / 2, it addresses byte offset 64, four registers past the variable you wanted. The byte offset must be halved before it is added: 32 bytes is 16 registers, so the REAL at 100.32 is 40016. Entering byte offsets directly as register numbers places every numeric tag twice as deep as intended.
Do booleans use the same divide-by-two conversion?
No. On this driver booleans use its bit format and map one-for-one to the bit offset, so the bit at 100.0 is entered at 40000. The divide-by-two formula applies to numeric registers only. The boolean failure mode is different: the grouped 16-bit read that starts below the mapped base, avoided by allocating from 100.16 onward.
The alarm cleared, but a REAL now displays a wild value. What is wrong?
The request now reaches the right register pair, but the bytes are being interpreted wrongly. Check that the HMI object is set to a floating-point format and that the driver's word-order setting matches the PLC. Two swapped 16-bit halves of a floating-point value read as a huge or near-zero number while communication stays healthy.
How do I keep the addresses correct after PLC layout changes?
Keep one address list with the PLC byte offset, data type, HMI address and read or write use, and regenerate it whenever the PLC layout changes: inserting a variable shifts every later offset by that variable's size. Check each entry for overlapping allocation sizes as well as alignment, because overlaps corrupt values even when every Modbus request succeeds.