IMDHMIControls LibraryShop main store

Troubleshooting

Why AdvancedHMI Modbus TCP floats stop reading a PLC

SCADA and data logging Published 6 min read

Short answer

A blank float in AdvancedHMI over Modbus TCP is almost never a byte-swap problem: when 16-bit integers work while floats stay blank, append the @F address modifier to the float address, as in 40001@F, so the driver reads two registers and decodes them as a 32-bit float. If every analog control goes blank at once, the PLCAddressValue read properties were cleared; restore them from a backup.

On this page
  1. Tell the two faults apart first
  2. Prove one integer read with a fresh control
  3. Append the float modifier before touching swap settings
  4. Worked example: 220.5 in two registers
  5. When every analog control goes blank at once
  6. The decision for each case
  7. Questions asked

When 16-bit integers read fine but a 32-bit float control stays blank over Modbus TCP in AdvancedHMI, the fault is nearly always the address, not the byte order: append the float modifier @F to the address, as in 40001@F, so the driver reads two registers and decodes them as an IEEE-754 float. Swap settings cannot fix this, because swapping rearranges 16-bit data without ever telling the driver that the value is a float. If every analog control goes blank at once while booleans still work, that is a different fault: the PLCAddressValue read properties were cleared, and you restore them from a backup.

Tell the two faults apart first #

Both failures blank a display, and both look like a driver problem from the outside. Sort them before changing any setting:

  • Integers work, floats stay blank: the control reads 16 bits and never decodes a float. Fix with the @F modifier on the float's own address.
  • Booleans work, all integers and reals go blank: the controls lost their read bindings. Fix by restoring PLCAddressValue from a verified backup.
  • A fresh test control also fails: communication, driver binding or the mapped register is wrong. Fix that first; grouped read size is the last check here.

Both faults were reported on builds AdvancedHMIv399xR1 and AdvancedHMIv399yBeta38, and neither was cured by deleting and reinserting the driver, by cycling every byte-swap and word-swap combination, or by reinstalling. The fixes were the address modifier and the restored properties. Nothing in the reported symptoms points to a version-specific defect, so treat the checks below as version-independent.

Prove one integer read with a fresh control #

Use a brand-new control so a damaged property on an existing form cannot mask a working connection:

  1. Add a new BasicLabel to the form and bind it to the existing Modbus TCP driver component.
  2. Set its PLCAddressValue to a mapped 16-bit integer register; 40001 is the example address, and it is only valid when your PLC actually maps a value there.
  3. Run the application and read the label against the value monitored in the PLC.

If the new label shows the integer, communication and addressing are sound and the blank controls carry the fault. If it shows an error message or nothing, repair communication before touching any float setting: an unmapped register and a wrongly decoded float need different repairs, and only the first looks like this failure from the outside. A single Modbus register is one 16-bit word; if that word must be interpreted as signed rather than unsigned, the handling described in converting an unsigned 16-bit Modbus word to a signed integer applies to this same address.

Append the float modifier before touching swap settings #

A Modbus register carries 16 bits, a 32-bit float occupies two consecutive registers, and nothing in a bare address tells the driver to combine them. The AdvancedHMI Modbus drivers use address modifiers written as an @ symbol followed by a modifier letter, and the letter F requests that the register pair at the numeric address be read as a 32-bit float.

Changing swap bytes and swap words rearranges bytes and words inside data the driver already treats as 16-bit integers. No combination of the four swap settings turns a 16-bit read into a float read, which is exactly why every swap combination failed while the fault persisted.

Set the test control's PLCAddressValue to the float's own first register with @F appended, run once, and compare against the PLC monitor. The numeric part follows the same Modicon holding-register convention the driver already uses for integers, so a plain word read that worked at 40001 addresses the float at that location the same way once the modifier is added. The same two-register mechanics are walked through from the HMI side in reading a CLICK PLC float over Modbus TCP in an HMI.

Worked example: 220.5 in two registers #

Say the PLC holds a measured voltage of 220.5 V as a 32-bit float with its first register at 40001 in Modicon-style numbering. Encode the value: 220.5 in binary is 11011100.1, which is 1.10111001 times 2 to the 7th. The exponent field is 7 + 127 = 134, written 0x86 in hexadecimal; the sign bit is 0 and the mantissa is 10111001 followed by zeros, so the 32-bit pattern is 0x435C8000. Register 40001 holds 0x435C and register 40002 holds 0x8000.

Set PLCAddressValue to 40001@F. The driver fetches both registers, assembles 0x435C8000, and the label shows 220.5. Without the modifier the driver reads one 16-bit register and shows 17244 (0x435C as an unsigned integer) or nothing at all on a float-formatted control, never the correct value.

If @F makes the display change but show a tiny number near zero, the PLC stores the words the other way round: 40001 holds 0x8000 and 40002 holds 0x435C, and the two halves need reversing. A changing display alone is not proof of a correct configuration, so enter a second, very different value at the PLC and confirm it round-trips. Before any float address is written to rather than only read, confirm the decoded value at the PLC: a word-order error puts a plausible but wrong number on a live process.

When every analog control goes blank at once #

The second failure mode is unmistakable once you look at the controls: booleans keep working while every integer and real display goes blank, and reinstalling the driver changes nothing while an older backup of the project works. Open one blank control and compare its properties. PLCAddressKeypad still holds its address while PLCAddressValue is empty. The write destination survived; the read binding did not.

In the reported case the damage appeared after an installer project was added to the Visual Studio solution and the project was reopened, with the compiled installed application still working. That points to the project's saved control properties, not to the driver, the network or the PLC. Restore the read properties from the verified backup rather than retyping them, run the project, and save a fresh copy before making further changes so the working state is captured.

The decision for each case #

  • Floats blank, integers fine: append @F using that float's own first register. Do not copy an example address such as 40001@F onto every control; each float needs its own mapped register.
  • Float reads but the number is wrong: reverse the word order, then the byte order, one change per run, confirming each against a value you entered at the PLC.
  • Every analog control blank, booleans fine: restore PLCAddressValue from a verified backup. A driver reinstall does not restore cleared control properties.
  • Everything blank, including a fresh test control: repair the connection, the driver binding and the mapped register first. Reduce MaxGroupReadSize only when a whole register block stops while a test client reads the same registers one by one; in the reported case values of 5 and 30 changed nothing, which fits, because that fault was elsewhere.

Questions asked

Does the @F modifier change which registers the driver reads?

No. The numeric part of the address still selects the first register of the pair, exactly as an integer address would. The modifier only tells the AdvancedHMI Modbus driver to fetch two consecutive registers from there and decode the 32 bits as an IEEE-754 float instead of a 16-bit integer. Each float control still needs its own mapped first register, so an example address such as 40001@F is a format to copy, not a location to copy.

What if the float address reads but shows the wrong number?

Then the two registers arrived but their order is reversed. A 32-bit float spans two 16-bit words, and swapping them turns 0x435C8000, which decodes to 220.5, into 0x8000435C, which decodes to a tiny negative number close to zero. Reverse the word order first, then the byte order, one change per run, and confirm each change against a value you entered at the PLC.

What does MaxGroupReadSize do in the AdvancedHMI Modbus driver?

It sets how many registers the driver combines into a single read request. Some slaves reject or silently mishandle requests longer than they support, which makes a whole block of addresses stop together while a test client reading the registers one by one still works. Reducing it is worth one test in that situation, but it will not fix a blank float on a control whose neighboring integer reads succeed.

Why would PLCAddressValue clear itself on many controls at once?

No documented mechanism explains it, and it is not part of normal operation. In the reported case the read properties disappeared after an installer project was added to the Visual Studio solution and the project was reopened, while PLCAddressKeypad kept its value and the compiled installed application kept working. Whatever the trigger, the repair is the same: compare the properties against a saved backup and restore the read addresses rather than retyping 183 of them by hand.

Keep reading

  • Troubleshooting

    Reading a CLICK PLC float over Modbus TCP in an HMI

    F428673 is the right address: the F prefix reads the two Modbus registers as the IEEE 754 float the CLICK program wrote to DF1 (24.9645 here), while L returns the raw 32-bit pattern (1103607636) and U returns one 16-bit half (46932). The screen showed 25 because an integer tag or whole-number format rounded it. Move the project to 3.99w and bind F with a decimal format and a floating-point variable.

    SCADA and data logging

  • Explainer

    Reading SunSpec Modbus devices into SCADA over Modbus TCP

    A standard Modbus TCP driver reads SunSpec devices. SunSpec only defines the register layout: a chain of model blocks starting at the device's documented base address, each block carrying a model identifier, a length, and int16 values you decode with per-block scale factors. The engineering work is block location and scaling, not a new transport.

    SCADA and data logging

  • Troubleshooting

    Why a Modicon M221 bit stays fixed in Kepware over Modbus TCP

    A Modbus TCP tag at 00001 that never changes usually reads the wrong Modbus object, not a broken link. The M221 does not expose its %I inputs to a read request, so match the controller's documented coil mapping, then correct Kepware's zero-based addressing option before blaming the network.

    SCADA and data logging