Troubleshooting
What an HMI alarm Modbus address maps to in the PLC
Short answer
An HMI alarm address printed as 4x42001 is a Modicon holding-register reference, not a controller tag name. Subtracting the five-digit base turns it into protocol address 2000; that offset, located in the controller's Modbus TCP server mapping, names the variable whose write locations the PLC cross-reference then traces back to the alarm logic. Confirm the conversion against one captured read request before searching the map.
On this page
- What a 4x address says and does not say
- Record the alarm and the tag in the HMI
- The trace in order
- The three readings of one displayed address
- Resolving 4x42001 on the alarm word
- Find the owning variable in the controller project
- Width, word order and the alarm bit
- Cross-reference the variable back to the alarm logic
- Questions asked
That alarm address resolves to a tag without guesswork. An address the HMI prints as 4x42001 is Modicon holding-register notation: the 4x prefix names the holding-register area, and 42001 is a display reference, not a wire address and not a controller variable name. In the five-digit Modicon convention, holding register 40001 is protocol address 0, so this alarm tag sits at protocol address 2000. Take the resolved address to the controller's Modbus TCP server mapping in its programming project, read off the variable that owns that offset, then cross-reference the variable's write locations to reach the alarm logic. The sections below record what to capture on the HMI side, how to convert the address, where the register lives in the controller project, and how to follow the mapped variable back to the condition that drives it.
What a 4x address says and does not say #
A Modbus request carries a function code, a starting address and a register count, and nothing else: no variable names, no comments, no controller project. The notation the HMI displays is a convention the driver converts into that numeric address, so the displayed string is a clue to the wire address, never the tag name itself. The 4x prefix marks the holding-register area, which function code 03 reads and function codes 06 and 16 write, and a controller routinely serves alarm words, setpoints and command words from that one area side by side.
Two display conventions are in common use. The five-digit Modicon style numbers holding registers from 40001, so the wire address is the reference number minus 40001. The six-digit style numbers the same area from a six-digit base, and the misreads that base produces are exactly the ones behind why Modbus error 8189 needs 400001 added to the register address. Both styles describe the same wire addresses, and one captured request settles which style a given tool uses.
Record the alarm and the tag in the HMI #
Work from the alarm definition, because the alarm, not the tag, is the thing being traced. Record the trigger tag and, when the alarm watches a bit inside a word, the configured bit number. The discipline is the same one WinCC alarm source tracing applies to messages that arrive with no obvious source: pin the message to its trigger before touching the controller.
Then open the trigger tag's properties and record four things: the full displayed address, the data type, the length when the tag is an array, and the connection the tag uses. Check whether scaling or an expression transforms the raw register value before the alarm sees it, because a transformed comparison will not match a raw controller value later. Open the connection next and record the controller's IP address and the Modbus unit identifier, and confirm they name the LMC itself rather than a gateway or a second device sharing the link. Watch the tag live once before anything else: a value showing bad quality can be stale, so every comparison in this trace happens only while quality is good.
The trace in order #
- Record the alarm trigger and, for a bit-in-word alarm, the configured bit number.
- Record the tag's displayed address, data type, length and connection.
- Record the connection's IP address and unit identifier and match them to the intended controller.
- Convert the displayed address to a wire address under the driver's documented convention.
- Confirm the conversion against one captured read request or the driver's own diagnostics.
- Open the controller project that matches the running machine and find its Modbus TCP server mapping.
- Check that the wire address falls inside a declared range and compute its offset from the mapped start.
- Follow the offset to the mapped variable, array element or buffer entry, checking element width first.
- Compare the raw word on both sides, online, in hexadecimal or binary.
- Cross-reference the variable's write locations and follow them back to the originating condition.
The three readings of one displayed address #
| Reading | Wire address | Confirmed by |
|---|---|---|
| Five-digit Modicon reference | displayed number minus the area base | driver documentation, or a captured request carrying the result |
| One-based position in the area | displayed number minus one | the driver's address-base setting, or a capture |
| Zero-based position in the area | the displayed number itself | a capture matching the displayed number |
The readings differ by one register, or by the whole base offset, and each produces a different number on the wire. Search the controller project for the address the wire carries, never for the displayed string.
Resolving 4x42001 on the alarm word #
Inputs:
- Displayed alarm address, read from the WinCC tag properties:
4x42001. - Convention: the driver's five-digit Modicon holding-register style, the documented Modicon reference convention.
- Wire check: a read-only capture of one HMI read request, taken while the alarm tag is polled.
Rule: in the five-digit style, the wire address equals the reference number minus 40001, because base register 40001 is protocol address 0; the result is the zero-based address the request carries.
Arithmetic: 42001 - 40001 = 2000.
Result: the alarm tag is the holding register at protocol address 2000, the 2001st register of the holding-register area.
Decision: a captured request whose address field is 2000 with function code 03 confirms the five-digit reading; if the capture shows the displayed number unchanged, the driver read it as zero-based within the area, and if it shows one register less, the driver read it as one-based. Whichever number the wire shows is the one to take to the controller map, and the displayed string itself never goes into the search.
Find the owning variable in the controller project #
Work in the project that matches the running machine, the same application and the same software version, because a near-miss offline project can carry convincing variable names over a different communication layout. How a controller exposes its memory as holding registers is one idea across platforms: what CODESYS %IW0 means for a Modbus TCP holding register works the same mapping out for CODESYS-based controllers, and it is a good model for reading a base-plus-length declaration. On the LMC, the server side of the connection is declared in the controller's communication configuration in EcoStruxure Machine Expert, and the Modbus TCP user guide for the controller family is the document that settles what the device serves: a fixed memory range, an explicit variable mapping, or application-managed buffer space.
Open that configuration and read three values off it: the start address of the area the controller serves, the number of registers it covers, and the variable or buffer bound to the range. Confirm the wire address from the capture lies inside the range, then compute the position: offset equals wire address minus mapped start, counted in registers. That offset becomes an array index or a byte offset only after the element width is known, so check the width before dividing anything. Follow the offset to the variable, array element, structure member or buffer entry it selects, and note the declaration type for the comparison later.
A text search for the displayed string finds nothing in this configuration, and that proves nothing either way: a base-plus-length declaration exposes thousands of registers without any single address appearing as text. The mapping, not the search box, decides whether the register is owned.
One caution belongs here. Do not write a test value into the register to prove the link: the holding-register area can carry command words beside status words, and a write to the wrong offset acts on the machine. Keep the trace read-only until the mapping is confirmed, and when a write is genuinely needed, apply the rules in safe Modbus writes to PLC output registers from SCADA.
Width, word order and the alarm bit #
Each holding register is 16 bits. The mapped variable may fill one register, span several in a defined word order, or share a buffer with unrelated signals, so match the layout before trusting any nearby value. For a bit-in-word alarm, take the bit number from the alarm configuration recorded earlier rather than from the message number or the alarm's position in the list, because neither carries the bit assignment. Display the word in hexadecimal or binary on both the HMI side and the controller side and watch the same bits move when the fault occurs and clears. For a multi-register tag, confirm the word order against the controller's documented layout before combining registers, and for a scaled or processed tag compare raw values on both sides before any scaling or expression is applied.
Cross-reference the variable back to the alarm logic #
The variable that owns the register is often an exported alarm word rather than the fault itself: copy logic, bit packing, latching, acknowledgement and reset commonly sit between the process condition and the register the HMI reads. Cross-reference the variable and open every write location, including writes to a parent structure or array and block moves that update it indirectly. Follow the assignments back to the originating condition and record anything that reshapes the signal on the way: a latch, an acknowledgement, a reset, a mask or an inversion.
Then monitor three points together, online: the originating condition, the exported word and the HMI trigger. The first transition that departs from the expected sequence marks the layer that is wrong. Correct only that layer: the HMI address or bit selection when it points at the wrong location, the export mapping when the register contract is wrong, and the alarm logic only when its behavior fails the machine's functional requirements. Before changing any layout, check the register's other consumers, and put the corrected project onto the controller through the site's approved deployment procedure only after the project and the served map agree.
Questions asked
Why does the same register show a different number in another tool?
Because the displayed number is a convention, not the wire address. One driver subtracts the five-digit base, another treats the number as one-based inside the holding-register area, and a third treats it as zero-based, so the same tag can legitimately appear as 42000 or 42001 in different tools. One captured read request settles which reading applies before any controller-side search begins.
Why do holding-register references look different in different tools?
Two display conventions coexist: a five-digit Modicon style and a six-digit style built for register areas too large for five digits to print. Both address the same registers on the wire, so neither is wrong; each driver simply converts its own notation. Resolve which convention a tool uses from its documentation or one capture, then work only with the converted wire address.
How do I find the alarm bit inside the alarm word?
The bit number comes from the alarm configuration, not from the message number or the alarm's order in the list. A holding-register word holds 16 bits, and drivers number them differently, so display the word in binary on the HMI side and the controller side, let the fault occur and clear, and confirm the same bit moves in both places before trusting the link.
Can I write a test value into the register to confirm the mapping?
Not while the mapping is unconfirmed. A holding-register area usually mixes status words with writable command words, and a write to the wrong offset can act on the machine itself. Prove the link read-only instead: watch the mapped word and the HMI tag change together as the fault occurs and clears, and reserve writes for registers whose direction and effect are documented in the project.