IMDTouchKnowledge BaseShop main store

How-to

Mapping TM241 %MD Real Values to HMI %MF Addresses

HMI and touchscreens Published 7 min read

Short answer

A TM241 REAL at %MDn has no %MD type in the Vijeo Designer variable list: declare it as %MF at twice the index — %MD107 becomes %MF214 — with the driver's double-word order set to Low Word First. An all-asterisk display or a value that never matches the PLC means swapped words, a wrong index or a format too narrow. Map a PLC WORD to UINT at %MWi, never to REAL.

On this page
  1. Why the HMI variable list has no %MD type
  2. The conversion rule: %MF at twice the %MD index
  3. Example: mapping %MD503 for a 0.02 to 2.00 ppm chlorine value
  4. Setting Low Word First in the Modbus driver
  5. Commissioning the mapping end to end
  6. When the display still shows all asterisks
  7. Mapping a WORD without faking a REAL
  8. Choosing between the fallbacks
  9. Questions asked

Declare the HMI variable as %MF at twice the %MD index and set the Modbus driver's double-word order to Low Word First. A REAL stored at %MD107 on the TM241 is reached from Vijeo Designer Basic as %MF214, type REAL. %MD never appears in the HMI variable list because over Modbus the panel addresses controller memory as 16-bit registers, and %MF overlays exactly the 32 bits that %MD holds. No PLC program change and no scaling change are needed; the index doubling and the word order are the whole conversion. Get either wrong and the numeric display shows an all-asterisk field or a number that never matches the PLC online value. This article gives the conversion rule and register table, a worked chlorine-sensor example, the commissioning sequence, and the WORD-versus-REAL answer for 16-bit values.

Why the HMI variable list has no %MD type #

Over Modbus RTU or Modbus TCP, the panel exchanges 16-bit registers with the controller. One %MWi is one register. A %MDi is a 32-bit double word, so it occupies two consecutive registers, %MWi and %MWi + 1; the M241 programming guide lays out these memory areas and their sizes in its memory-mapping chapter.

Vijeo Designer offers %MFi, %MWi, %KWi and %SWi, with %MF as its 32-bit float type. %MF and %MD name the same 32 bits — the difference is only the interpreted type, IEEE-754 floating point on the panel side. The mapping job therefore reduces to three checks: index, width and word order. The general case of putting a PLC real on a panel is covered in the guide to displaying a PLC real value over Modbus on an HMI; what follows adds the M2xx index arithmetic.

The conversion rule: %MF at twice the %MD index #

Multiply the %MD index by 2 and declare the HMI variable at that index as %MF with type REAL. The HMI index counts registers, not double words, so each %MD consumes two slots:

PLC address Registers it occupies HMI address, type REAL
%MD100 %MW200 and %MW201 %MF200
%MD107, PID Kp %MW214 and %MW215 %MF214
%MD503, scaled ppm %MW1006 and %MW1007 %MF1006

Check the PLC program for %MW use inside each pair: a status word parked at %MW201 makes the REAL read next to it corrupt. Each %MW index is also the Modbus holding-register number once the 4xxxxx numbering convention is applied, which the guide to decoding Modbus holding register 4500001 from PLC to HMI works through.

Example: mapping %MD503 for a 0.02 to 2.00 ppm chlorine value #

The chlorine sensor spans 0.02 to 2.00 ppm across 4-20 mA; the program scales a 0-10000 raw count into that span and stores the REAL at %MD503. The case was worked on Machine Expert 1.2.7 against Vijeo Designer Basic 1.2.1.

Index: 2 × 503 = 1006, so the HMI variable is %MF1006, type REAL, occupying %MW1006 and %MW1007.

Decode: force the scaled REAL to 1.000 in the PLC. IEEE-754 gives 1.000 = 0x3F800000, high word 0x3F80, low word 0x0000. The M2xx layout puts the low word at the lower index, so %MW1006 reads 0x0000 and %MW1007 reads 0x3F80.

With Low Word First, the panel takes the first register as the low word: 0x0000 + 0x3F80 × 65,536 = 0x3F800000, and the display shows 1.000.

With High Word First, the same two registers decode as 0x00003F80 — 16,256 as an integer, about 2.3e-41 as a float — so the display falls to 0.000 or the all-asterisk field, which is exactly the reported symptom.

A wrong index fails differently: %MF200 belongs to %MD100, so no forced value at %MD503 ever appears and the panel sits on unrelated memory. Verify index first, then word order, then display format.

Setting Low Word First in the Modbus driver #

The double-word order is a driver-level setting on the panel equipment, reached through the I/O manager; Low Word First matches the M2xx layout, which stores the low word at the lower %MW index. The switch applies to the whole connection, so every DINT and REAL on that driver flips with it — after any change, re-check the other 32-bit variables on the link, not only the one in front of you.

If a verified index still decodes wrong, flip the order, download and retest at two different forced values; keep whichever order reproduces the PLC value at both. Leave the PLC program untouched until the panel side has passed the index, order and format checks — the fault is not in the controller.

The same register-pair discipline applies to the smaller M2xx controllers over Ethernet: the guide to fixing Machine SCADA Expert Modbus TCP reads to a TM221 walks the identical word-order check on Modbus TCP.

Commissioning the mapping end to end #

Work one parameter through every step before starting the next, and keep the loop in manual or the machine in a safe state while forces are active.

  1. Confirm the PLC variable online in Machine Expert: force %MD107 to a known value such as 1.5 and read it back. Proceed only when the online value is correct.
  2. Compute the panel address: 2 × 107 = 214, so the variable is %MF214, type REAL, and the pair %MW214 and %MW215 is reserved.
  3. Create the Modbus equipment and its variables as shown in the guide to adding a Modbus RTU driver and external variables in Vijeo Designer, then declare the variable there at %MF214.
  4. Set the driver to Low Word First in the I/O manager and download to the panel.
  5. Compare display against online value at two different forced values; with the index verified, flip the double-word order only if both mismatch, and keep the order that matches at both.
  6. Test the write direction: enter a new Kp on the panel's numeric input and confirm %MD107 changes to exactly that value in the online view.
  7. Release the forces and round-trip three points across the working span before calling the parameter finished.

When the display still shows all asterisks #

An all-asterisk field (***.***) means the decoded value will not fit the configured display format — usually an invalid or enormous float, not a formatting problem to solve first. Work the observations in order:

Observation Probable cause Check
Display never matches anything forced The %MF index belongs to a different %MD — for example %MF200 when the value lives at %MD503 Recompute 2 × n and confirm no %MW shares the pair
All-asterisk field at every value Words swapped, producing an invalid or enormous float Toggle Low/High Word First, download, retest with the REAL forced to 1.000
All-asterisk field only after forcing 10000 The forced value is the raw count, or the six-character field cannot show 10000.0 when the range top is 2.00 Force the scaled REAL itself to 1.00 and read the panel
Display parks at the low end and never moves Raw input stuck at zero, or scaling truncated by integer arithmetic Watch the REAL online; scaling must run in REAL arithmetic, 0.02 + (raw ÷ 10000) × 1.98

The formula lands on 0.02 at a raw count of 0 and 2.00 at 10000. When the display, the tag and the link all remain in doubt, the routine in the guide to diagnosing HMI values by driver, tag or binding separates them faster than more toggling.

Mapping a WORD without faking a REAL #

The second question resolves by width: a PLC WORD and an HMI UINT are the same 16 bits at the same %MWi. Declare the HMI variable as UINT and choose the display format — WORD values are usually documented in hexadecimal, UINT in decimal — or INT where the value can be negative.

Never declare the panel side as REAL at %MWi when the controller holds a single 16-bit word there. A REAL spans two registers, so the panel reads %MWi and %MWi + 1 as one float: the displayed number is garbage, the second word belongs to the next variable, and a write from that variable corrupts a neighbour. That family of corrupted values from tag-type mismatches is covered in the guide to why an HMI writes the wrong PLC value above 9.

The three decisions:

  • 16-bit integer value: INT or UINT at %MWi, scaled in the display or in the controller.
  • Fractional parameter such as Kp: REAL at %MDn on the controller, %MF at twice the index on the panel.
  • Value that must stay a %MW integer for another Modbus master: convert inside the PLC into a REAL that owns its own %MD pair, and expose both.

Choosing between the fallbacks #

The default is %MF at twice the %MD index with Low Word First: no program change, a native REAL on both ends. Flipping the double-word order is the first fallback, and it repairs only a word-order mismatch — never a wrong index. Moving the exchange into %MW integers with conversion in the PLC is the second, taken when a second Modbus master needs plain integers; keep that scaling in REAL arithmetic or the resolution is lost. The PACdrive driver is the Ethernet-only alternative, a Netvar-style exchange configured on both ends that suits symbol-style transfer instead of register addressing; serial links cannot use it at all. Everything else stays on the default.

Questions asked

Does the doubling change between Modbus RTU and Modbus TCP?

No. Both transports move the same 16-bit registers, so the multiply-by-two index, the register pair and the Low Word First setting are identical. Only the physical link differs: serial port parameters on RTU, IP address and port number on TCP. If a value reads on one transport and not the other, suspect the connection setup, not the mapping.

Can the panel write Kp back into the controller?

Yes. Declare the numeric input on the same %MF variable as the display, then verify the write by watching the PLC online value change to exactly what was entered. Give one operator station ownership of each tuning parameter so two panels cannot fight over it, and change a loop gain only with the loop in manual or the machine safe.

Do adjacent %MD variables overlap once the index is doubled?

No. Consecutive double words stay consecutive: %MD107 owns %MW214 and %MW215, and %MD108 owns %MW216 and %MW217. Trouble starts only when a plain %MW variable is placed inside an occupied pair, or an address is taken without multiplying by 2. List the reserved pairs beside the PLC variable declarations and overlaps become visible at a glance.

Is there an offset to add after multiplying the index by 2?

No. A %MDn begins at register 2n, so doubling lands exactly on the first of its two registers and no offset exists. Offsets belong to other controller families whose float areas start elsewhere; on the M2xx layout the doubling alone is exact, which the worked chlorine case confirms.

Keep reading

  • 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

    How to Split Modbus Register Bytes in Operator Terminal Expert

    Create a variable of type USINT with array size 2 on each register: Operator Terminal Expert assigns the register's low and high byte addresses to the two elements. Rebuild a 16-bit field split across two registers as low byte + 256 × high byte into a UINT, and write it back by replacing only that field's bytes while preserving the neighbor in the shared register.

    HMI and touchscreens

  • Troubleshooting

    Connecting a Delta DVP 15MC PLC to a Weintek HMI

    The DVP 15MC exposes its data to an HMI as a Modbus TCP server on the standard port 502. In EasyBuilder Pro, use a 15MC-specific driver if your editor's driver list has one, otherwise the generic Modbus TCP driver with the controller's register-to-Modbus mapping table. A 64-bit QWORD spans four holding registers, so prove one read-only tag before building screens.

    HMI and touchscreens