IMDHMIControls LibraryShop main store

Troubleshooting

Reading a CLICK PLC float over Modbus TCP in an HMI

SCADA and data logging Published 7 min read

Short answer

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.

On this page
  1. What the L, F and U prefixes return
  2. Decoding the L reading 1103607636 from DF1
  3. Move the project to 3.99w before changing bindings
  4. Bind F428673 so the decimals survive
  5. Check the DF1 scaling at the PLC
  6. Verify the chain from the loop to the screen
  7. Questions asked

Use F428673. The three numbers are one pair of Modbus registers read through three data types: L428673 = 1103607636 is the raw 32-bit pattern, U428673 = 46932 is one 16-bit half of it, and F428673 is the IEEE 754 float the CLICK program wrote to DF1, which comes to 24.9645 in this case. Nothing is lost between the PLC and the HMI. The rounded 25 comes from the binding: an integer-typed variable or a whole-number display format turns 24.9645 into 25. Move the AdvancedHMI project from 3.99f to 3.99w, bind F428673 with a decimal format string and a floating-point variable, and the screen shows the decimal places that the value in DF1 actually carries, which is what that combination produced on the machine in question.

What the L, F and U prefixes return #

DF1 is one 32-bit float in CLICK memory, and over Modbus TCP it occupies two consecutive 16-bit holding registers. The prefix on the address tells the driver how to assemble and interpret those registers, which is why one register pair returns three different numbers for the same analog value. The values below are the readings from this case; the interpretations come out of the decode in the next section.

Address Value returned How the prefix reads the pair Use for the analog value
L428673 1103607636 Both registers as one 32-bit integer: the raw bit pattern No
F428673 25, then the full decimal value once the display keeps decimals Both registers as an IEEE 754 single-precision float Yes
U428673 46932 One register as an unsigned 16-bit integer: half of the pattern No

Neither L nor U is corrupted data, so scaling either by a constant cannot recover the engineering value; they are the same bits in the wrong shape. The communications chapter of the CLICK user manual documents how memory types such as DS and DF map to Modbus addresses, so take the number after the prefix from that map instead of guessing at it.

Decoding the L reading 1103607636 from DF1 #

Inputs: L428673 = 1103607636 and U428673 = 46932, both read over Modbus TCP from the pair holding DF1 in this case. The value stays dimensionless until the CLICK scaling rung gives it an engineering unit. A single-precision float stores one sign bit, an 8-bit exponent and a 23-bit fraction, and its value is (1 + fraction/8388608) x 2^(exponent - 127), where 8388608 = 2^23. The rule in words: treat the integer as a raw bit pattern, split it into those fields, and rebuild the number.

  • 1103607636 = 0x41C7B754. High word 0x41C7, low word 0xB754 = 46932, which is exactly the U reading, so the two readings are halves of one 32-bit value.
  • Sign: the top bit of 0x41C7, binary 0100 0001 1100 0111, is 0, so the float is positive.
  • Exponent field: the next eight bits, 1000 0011, equal 131; 131 - 127 = 4, a scale factor of 2^4 = 16.
  • Fraction field: the remaining 23 bits hold 4699988, so the fraction is 4699988 / 8388608 = 0.56028.
  • Value: (1 + 0.56028) x 16 = 24.9645.

The register pair therefore holds 24.9645, and the 25 on the screen was that number rounded for display. Decode your own L reading this way before touching the HMI. If it rebuilds into a plausible engineering value, the PLC side is healthy and the fix belongs at the display binding. If it rebuilds into nonsense, with 1e+20 or 1e-20 style numbers pointing at wrong word order or a source that is not a float, fix the data type at the source first, because no format string can recover a value that was never delivered. A float the PLC computes correctly while the HMI rounds it is not unique to this hardware: same mismatch on an SLC 5/04 driving an HMI is written up step by step.

Move the project to 3.99w before changing bindings #

The project that produced the rounded 25 ran AdvancedHMI 3.99f, and the change that produced the decimal places included moving to 3.99w, so upgrade first; chasing binding fields on an outdated build wastes shift time.

  1. Copy the whole project folder to a safe place; that copy is your rollback.
  2. Take the 3.99w release from the official AdvancedHMI project site, not a second-hand copy.
  3. Open the project in 3.99w and rebuild it, then clear any compile complaints from replaced components.
  4. Confirm the Modbus TCP driver component still points at the CLICK's IP address, and ping the PLC's Ethernet port from the HMI PC.

The check: a clean build and a read of F428673 that returns a number with the PLC online. If the upgraded project will not build, put the saved copy back so the screen keeps running, and finish the upgrade outside production hours.

Bind F428673 so the decimals survive #

With 3.99w in place, fix the presentation, which is where the decimals were lost.

  • Put F428673 in the address property of the display component and keep L and U out of the analog path.
  • Set the component's numeric format to a fixed number of decimal places; five places shows 24.96452.
  • If the value passes through a script variable, declare it Single or Double; an Integer rounds it to a whole number before the display ever sees it.
  • Leave scale and offset fields on the component at their neutral values; the CLICK scaling rung already produced engineering units.
  • If the screen converts the value to text on the way out, the conversion rounds too, the same trap documented in a TwinCAT REAL-to-string rounding fix.

If operators act on this number, make the change with the screen out of service and confirm it against the CLICK data view before it returns. The check: decimals on screen that move smoothly as the loop current changes; movement only in whole steps means an integer conversion still sits somewhere in the chain.

Check the DF1 scaling at the PLC #

The HMI can only display what DF1 holds. The 4-20 mA signal arrives on the analog channel as raw counts, and the CLICK program scales them and writes DF1. Open the program, find the rung or instruction that writes DF1, note the configured input range and the scaling constants, and watch the channel value and DF1 together in the CLICK data view while the current changes.

Decide from the data view, not the screen. If it shows a decimal value while the corrected screen still rounds to a whole number, the remaining fault is in the screen chain and the PLC needs nothing. If the data view itself disagrees with a calibrated current injection, the scaling rung is wrong and the HMI was never the problem. Keep format faults and comms faults separate while you work: a rounded number means values are arriving and being formatted, while question marks or frozen values point to PLC comms timeouts, a different fault with its own fix.

Verify the chain from the loop to the screen #

Confirm the whole path once, from the calibrator to the glass:

  • Inject a known current with a loop calibrator, 12 mA for mid-scale on a 4-20 mA input, and compute the DF1 value your scaling constants should produce.
  • Read DF1 in the CLICK data view and check it against that expected value within the analog channel's documented accuracy.
  • Read F428673 on the screen and check it matches the data view to the decimal places your format string shows.
  • Step the calibrator in small increments; the screen must follow in fine steps, and whole-number movement means an integer conversion survives somewhere.
  • To test the driver and the address handling without the running machine, replay the same read through a simulated Modbus TCP SCADA link on one PC and compare the numbers.
  • Keep L428673 as your evidence: decoded to hex it should rebuild the float, which settles instantly whether a future fault lives in the PLC data or in the screen.

When these checks line up, the fault is closed: DF1, the F prefix and the display format each agree, and the decimals on the screen are the decimals in the register pair.

Questions asked

How many digits can the float in DF1 actually carry?

A single-precision float carries a 24-bit fraction, about seven significant decimal digits. Near 25 the smallest steps are 2^-19, about 0.0000019, so 24.96452 is real data while digits beyond roughly the seventh significant figure are formatting artifacts, not measurements. Set the display format to the places the data supports and treat anything further right of the decimal point as decoration.

Another Modbus client reads the same two registers and shows a huge or tiny number. Why?

Most likely it combined the two 16-bit words in the opposite order from the CLICK, which turns 0x41C7B754 into a different float entirely. Swap the words in that client and compare against the live value in the CLICK data view. The F prefix already pairs the words the way the CLICK presents them, which is why F428673 needs no extra word handling on top of it.

Can I take the L reading of 1103607636 and convert it to the float in code instead?

Only by copying bits, not by casting. Casting turns the number 1103607636 into 1103607636.0, which is not the value; the bit pattern has to move into a 32-bit float variable unchanged, the way a memory copy does in most HMI scripting languages. That conversion is exactly what the F prefix performs in the driver, so doing it in code only adds a conversion to maintain. Use F428673.

Does any of this change how the 4-20 mA input should be scaled?

No. The prefix problem sits downstream of scaling: the analog channel delivers raw counts, the CLICK program scales them into DF1 as engineering units, and the F prefix passes that number through untouched. The HMI needs no second scale factor, and adding one double-scales the value. Verify the scaling rung with a calibrator at 12 mA and compare the CLICK data view with the screen.

Keep reading

  • Troubleshooting

    How a SCADA client reads a small PLC over EtherNet/IP

    An Ethernet link to a MicroLogix is not a working SCADA read: the controller serves data through PCCC commands carried over EtherNet/IP, and a client without that application service gets every read rejected. Check the driver's documented controller list for PCCC over EtherNet/IP or use the controller's documented Modbus TCP server, then prove one read-only value end to end.

    Industrial networks

  • How-to

    How to simulate a Modbus TCP SCADA link on one PC

    Yes — one PC can run the SCADA client and a Modbus TCP server simulator at once. Decide which side you are proving, keep exactly one client and one server in the arrangement, prove the server exists with an independent Modbus client, then align object type, offset and word order before trusting any value; a connected link proves transport only.

    SCADA and data logging

  • How-to

    How to run analog I/O over a Modbus TCP bus coupler

    Yes: remote analog I/O behind a Modbus TCP bus coupler can close a control loop from the PLC. Prove the electrical path with the network out of the loop, bring up the connection with a real timeout, map and scale the channels against known test points, then close the loop on measured timing — one documented integration refreshes coupler data every 10 ms, but the valve and hydraulics set the real response, and a failed exchange is a fault state, never fresh data.

    Controllers and I/O