IMDTouchKnowledge BaseShop main store

Troubleshooting

Why an HMI shows zero from a Modbus float register

HMI and touchscreens Published 7 min read By IMDTouch engineering team

Short answer

Cleared communication warnings prove only that the panel's requests are answered. The TRM138 temperature is a float with the high word at offset 0x0003 and the low word at 0x0004, which under classic one-based input-register notation is addressed as 30004 and 30005. Setting the variable's polling format to a two-register float, high word first, is what restores the display.

On this page
  1. What does a cleared communication warning actually prove?
  2. How do you convert the register offset into the address the panel expects?
  3. Why does the temperature need two registers?
  4. Which polling setting makes the value appear?
  5. In what order do you change settings so each test proves something?
  6. What must be correct on the RS-485 link before any register test?
  7. How do you confirm the displayed value is the real temperature?
  8. Questions asked

A Magelis GXO3502 panel reads a TRM138 temperature controller over RS-485. The yellow no-communication triangles are gone, so the instrument is answering every request — and both numeric indicators still sit at zero. That combination moves the fault downstream of the link: either the request starts at the wrong register, or the panel decodes the right registers as the wrong data type. The TRM138 map puts the temperature's high word at 0x0003 and the low word at 0x0004, and the variable's polling format decides whether those two words become a temperature or a zero. Here is the address conversion, the decode setting, and the order to test them in.

What does a cleared communication warning actually prove? #

It proves the transactions succeed and nothing more: the cable, framing and device address work, but the panel can still be reading the wrong pair of registers or decoding the right pair as the wrong data type. A Modbus RTU master counts a transaction as good when the slave returns a valid frame — correct checksum, the echoed function code, the expected length. Nothing in that exchange checks that the requested offset is the temperature, or that the four returned bytes are a float.

So treat the cleared triangles as a gate, not a result: they let you stop debugging the link and start debugging the mapping. One glance belongs here before anything else — the instrument's own display. If it shows a live temperature, the register pair is not zero and the panel is misreading it.

How do you convert the register offset into the address the panel expects? #

Under classic one-based input-register notation the reference is 30001 plus the device offset, so a float whose high word sits at offset 3 and low word at offset 4 is addressed as 30004 and 30005, not 30003. The TRM138 map is written in zero-based offsets, while the classic documentation style numbers input registers one-based inside the read-only 3x block served by function 04; the leading 3 is area notation and never appears in the request frame.

Temperature word Map offset (hex) Offset (decimal) Classic input-register reference
High word 0x0003 3 30001 + 3 = 30004
Low word 0x0004 4 30001 + 4 = 30005

Entering 30003 under that notation selects offset 2 (30003 − 30001 = 2), one register before the high word, and the panel then decodes the wrong two words as a float while the communication status stays clean. The notation a driver expects is not universal, though: some drivers take the classic reference, some a plain zero-based offset, some an offset inside a separately selected register area. Read the driver's address help before editing the variable, and confirm where the request actually starts — driver diagnostics or a serial capture — before moving on. The matching rules for the other areas are in Modbus 3x 4x 5x read types and decimal register entry.

Why does the temperature need two registers? #

A 32-bit float cannot fit in one 16-bit Modbus register, so the instrument splits the value across two consecutive registers, high word at the lower offset, and a variable set up as a single-register integer shows a number that is not the temperature. Three misreads follow from that split, and each looks different on the panel:

  • One register read as an integer: you get half a float, and the high word alone is not a temperature in any unit.
  • Two registers assembled with the words swapped: a nonsense value, often so small it prints as zero.
  • Two registers with the bytes reversed inside each word: an implausible number, usually huge.

A worked example shows the arithmetic. Take a true reading of 23.5 °C:

  • 23.5 = 10111.1 in binary = 1.01111 × 2⁴, so the exponent field is 127 + 4 = 131, which is 10000011 in binary.
  • Sign 0, exponent 10000011, fraction 01111000000000000000000 gives high word 0100000110111000 = 0x41BC and low word 0x0000.
  • Correct decode: 0x41BC0000 reads back as 23.5 °C.
  • Word-swapped decode: 0x000041BC is a denormal, 16828 × 2⁻¹⁴⁹ ≈ 2.4 × 10⁻⁴¹ — small enough that any two-decimal indicator prints zero, with no communication warning.
  • Single-register read of the high word as an unsigned integer: 0x41BC = 16828, not a temperature.

That swapped-word line is the whole syndrome: zeros on the indicators, clean communication status.

Which polling setting makes the value appear? #

Open the variable's polling settings and set the data type to a floating-point value spanning two registers, with the word from the lower offset as the high word — that change, with the addresses untouched, restored the readings in this installation. Three fields in the polling configuration decide the decode:

  1. Data type: 32-bit floating point across two registers, not a 16-bit integer.
  2. Word order: the register at the lower offset supplies the high word. Labels like "swap" describe a transformation of the pair, so check what the option does to the two words, not what it is called.
  3. Byte order inside each word: leave it at the driver default first and touch it only if the right pair still decodes wrong.

With those polling values changed and nothing else, both indicators came alive — which also confirms the requests were already landing on the temperature pair under that driver's convention. The same word-order discipline applies when displaying a PLC real value over Modbus on an HMI. The underlying byte-and-word layouts are covered in why Modbus float reads require the documented register order.

In what order do you change settings so each test proves something? #

Change one control at a time and write down the register area, address, data type, word order and displayed result before every change, so a correct value tells you which setting was wrong. The sequence:

  1. Record the current state of the variable.
  2. Confirm where the request starts, and correct the address only if it misses the temperature pair.
  3. Set the data type to a two-register float, high word first. Read the indicator.
  4. Still wrong: swap the word order. Read again.
  5. Still wrong: change the byte order inside the words. Read again.
  6. Stop at the first setting that reproduces the instrument's own display, and record it.
What you observe What it isolates Decision
Warning triangles present The link: cable, polarity, framing, device address Repair the link first; register settings cannot be judged through a dead connection
Warnings clear, indicator zero Register selection or decode Check the instrument's own display, then the data type
Plausible but wrong number Word order, then byte order Correct the decode before touching scaling or display format
Value matches the instrument Nothing Record the settings and stop

Changing the address and the decode together can produce a plausible number without telling you which setting was wrong — that is the reason for the order above.

Before any register test the link needs matching baud rate, parity and stop bits, the instrument's configured device address, and data-pair polarity matched by documented signal function rather than by the letters printed beside the terminals. RS-485 A/B naming is not uniform: some makers label the non-inverting line A, others B, so match the signal functions from the two manuals instead of trusting the letters stamped at the terminals.

  • Serial framing: confirm the values in the instrument's configuration menu and copy them exactly into the driver.
  • Device address: the request carries the slave address the instrument is actually configured for.
  • Termination and biasing: whatever the two manuals call for at the cable length and bit rate in use.

Move or re-solder the pair with the loop de-energized; a polarity swap is a power-off change, not a live test. If the triangles are present instead of cleared, the link is the whole problem — start with fixing HMI Modbus device no response over RS-485 and return to the registers once the instrument answers.

How do you confirm the displayed value is the real temperature? #

Compare the panel's number with the temperature on the instrument's own display and watch it track a process change: agreement at the display's resolution is the acceptance test, and the decoded variable — not the indicator's decimal formatting — is what you verify. Read the variable itself where the panel offers a diagnostics view, because presentation can fake either fault: an integer format on a float, decimal places set to zero, a scaling factor of zero, or an indicator bound to the wrong variable will blank a perfectly good value.

Do the comparison while the process moves: a temperature that rises on the instrument and rises on the panel at the same resolution closes the job. Then map the remaining variables with the same area, data type and word order, and the second indicator needs no new debugging.

Questions asked

Is the leading 3 in the address sent on the wire?

No. The request frame carries the device address, function code 04, a start offset and a register count — for this temperature, offset 3 and count 2. The 30001-style reference exists only in documentation and in driver address fields, which is why two drivers can demand different entries for the same physical register.

Can the panel fetch this temperature with function 03 instead?

Not from this map. Function 03 reads holding registers, the 4x area, while the temperature sits in the read-only input registers served by function 04. A function 03 request to these offsets returns either an exception reply or unrelated holding-register data, so match the function to the area the register map names.

Can I read the two words as integers and combine them with arithmetic?

Only for integer formats: an unsigned 32-bit integer is high word times 65536 plus low word, and a script can do that. A float cannot be rebuilt with arithmetic because the sign, exponent and fraction live in the bit pattern; use the driver's two-register float type or a bit-level conversion.

Does it matter whether both words come from one request or two?

Read both words in one request. Two separate single-register reads can straddle an update: the instrument may store a new value between them, so the panel combines a high word from one sample with a low word from the next. One function 04 read of two consecutive registers returns a consistent pair.

Keep reading

  • Troubleshooting

    Fixing HMI Modbus Device No Response Over RS-485

    Device no Response means the slave never returned a valid frame to that request. When a PC polling tool reads the same scanner, the bus is probably carrying two masters: run one master at a time, then copy the known-good read's serial settings, station address, and register offset into the HMI.

    HMI and touchscreens

  • How-to

    Where an HMI Gets Modbus Addresses on a Shared RS485 Bus

    An HMI such as a Weintek panel is the Modbus client: every address it polls comes from the server device's own register map, never from the HMI. On a shared RS485 bus, give all nodes the same baud rate and framing, assign each device a unique node number, and prefix that number to each register address in the HMI project.

    HMI and touchscreens

  • Troubleshooting

    Displaying a PLC Real Value Over Modbus on an HMI

    An INTEGER display that reads the register proves the link, station and address, so a blank REAL display is a 32-bit mapping fault. Declare the HMI variable as a 32-bit float on the register pair (40064/40065), set the device double-word order to Low Word First to match the PLC, and give the numeric field six integer digits for 628402.0.

    HMI and touchscreens

How to Access One Bit of a Word in Operator Terminal Expert