Troubleshooting
Why an HMI Writes the Wrong PLC Value Above 9
Short answer
When an HMI display and its PLC register agree up to 9 but the PLC then reads 16 for a setting of 10, 25 for 19 and 32 for 20, the HMI tag is encoding BCD into a binary register. Set the tag data type to Signed Int 16, download, and step through the full range to confirm both numbers match.
On this page
- Why does the PLC value jump from 10 to 16 when the screen shows 10?
- Why do settings up to 9 work and then break?
- How do I prove it is the tag data type and not the buttons or cable?
- Which tag data type matches a plain binary PLC register?
- Will a keypad limit or a number-format change fix it?
- When does a BCD tag type belong in the project?
- What should I change and verify before returning the screen to service?
- Questions asked
An HMI that writes correct values up to 9 and then puts 16 in the PLC for a screen value of 10, 25 for 19 and 32 for 20 has a tag whose data type encodes BCD while the register holds plain binary. The fix is to set that tag's data type to Signed Int 16, the 16-bit signed binary integer, and retest across the whole operating range. The mismatch stays invisible below 10 because single digits look identical in both encodings, which is why the fault seems to start suddenly. This guide gives the one-minute test that proves which side decodes differently, the numbers to expect at each count, and the cases where a BCD tag is genuinely correct.
Why does the PLC value jump from 10 to 16 when the screen shows 10? #
The panel is writing the number in BCD while the PLC register holds plain binary, so the digits 1 and 0 travel as the bit pattern 0001 0000, which a binary reader counts as 16, while the screen shows its own BCD reading of the same word.
BCD, binary-coded decimal, packs one decimal digit into each group of four bits, so 10 becomes the digits 1 and 0 stored as 0001 0000. Plain binary stores the whole number in one base-2 word, so 10 becomes 0000 0000 0000 1010. The tag encodes and decodes BCD consistently on both sides, which is why the panel looks self-consistent and reports no error: the only wrong number in the machine is the one the PLC holds and the timer uses.
The reported case paired a C-More Micro panel with the integer registers DS1 through DS4 in a CLICK PLC, each driving a timer delay preset; the arithmetic below comes from that pair and applies to any tag set to BCD against a binary register.
Worked example: a screen entry of 10 has BCD digits 1 and 0, so the word on the wire is 0001 0000 and the register holds 16 + 0 = 16. At 19 the word is 0001 1001, which the register reads as 16 + 8 + 1 = 25. At 20 it is 0010 0000, read as 2 x 16 = 32. At 99 it is 1001 1001, read as 9 x 16 + 9 = 153.
Why do settings up to 9 work and then break? #
Every value from 0 through 9 has the same bit pattern in both encodings: 9 is 0000 1001 whether it is stored as BCD or binary, so the fault cannot show itself until the first two-digit entry, and 10 is the first number the two types disagree on.
Above 9, every two-digit entry lands in the register as (tens digit x 16) + ones digit, so the gap between the screen and the register grows through each decade and resets at the next one. That is the reported pattern: register 16 while the screen passed 10, then 25 and 32 as it passed 19 and 20.
The mapping for a BCD tag writing into a binary register:
| Screen value | Bits on the wire (BCD) | Register reads (binary) |
|---|---|---|
| 9 | 0000 1001 | 9 |
| 10 | 0001 0000 | 16 |
| 19 | 0001 1001 | 25 |
| 20 | 0010 0000 | 32 |
| 99 | 1001 1001 | 153 |
A register value that fits this table confirms the diagnosis before you change anything.
How do I prove it is the tag data type and not the buttons or cable? #
Watch the screen and the PLC register at the same time and change the value one count at a time: if the screen shows 10 while the register shows 16, the tag encoding is wrong, and no button object, cable or screen format can cause or fix that pair.
Run the test with both screens open:
- Open the PLC programming software and put the affected register on a live data view so its numeric value stays visible (DS1 in the reported case).
- On the panel, press the INC button once per step and record both numbers at 8, 9, 10 and 11.
- Agreement through 9 with register 16 at screen 10 confirms a BCD tag writing a binary register.
- A register that is wrong from the very first count points to a wrong address or a scaling offset instead.
- A register that never moves at all is a write or communications failure, which is a different fault with a different fix.
The INC/DEC object and the keypad object are only input methods; the tag behind them decides the bit pattern placed on the wire, which is why swapping objects changed the symptom without ever touching the fault.
Which tag data type matches a plain binary PLC register? #
Set the tag data type to Signed Int 16, the 16-bit signed binary integer: it matches plain binary registers such as DS1 through DS4, covers -32,768 to +32,767, and sends a screen entry of 10 as 0000 0000 0000 1010, which the register then reads as 10.
The type is set on each tag in the panel project's tag settings, on the Tag Data Type field; in the reported fix that field was set to Signed Int 16 on each delay tag and the project was downloaded again. Vendor documentation across the major HMI lines states the same requirement: a tag's data type must match the PLC data it points at, and platforms that type-check the project refuse to compile or report a failed tag write instead of writing a wrong number.
Because the type lives on each tag, correcting one button's tag leaves the other delay tags wrong; open every tag bound to a binary integer register and set it the same way. If a tag already uses a 16-bit signed binary type and the values still disagree, its address points somewhere other than the intended register, so verify the address against the ladder before changing anything else.
Will a keypad limit or a number-format change fix it? #
No: a keypad entry limited to 1 through 9 only stops the operator before the range where the two encodings differ, and a number format changes how the value looks on screen, so the tag still sends BCD and the register still holds 16 for a setting of 10.
A 1-to-9 keypad limit is worth keeping only when the machine's design genuinely restricts the setting to 1 through 9; check the required delay range before keeping it, because the same limit blocks every valid two-digit entry. Number formats, decimal placement and unit conversion act on the value after the register is read or before it is written, so they sit downstream of the tag encoding. That layering is the subject of how to scale a PLC integer into an HMI display value, and it is why cycling through number formats never moved the register value in the reported case.
Do not absorb the difference in the ladder either: an offset tuned to the expected BCD error, or a timer preset divided to compensate, hides the transfer fault and breaks the moment any other value is entered. Fix the encoding and leave the arithmetic honest.
When does a BCD tag type belong in the project? #
Keep a BCD tag only for a device that genuinely stores BCD, such as thumbwheel switch inputs, legacy display modules or older register files, and handle a true BCD source with documented conversion instructions inside the PLC rather than by guessing the tag type.
A 16-bit BCD word carries exactly four digits, so it tops out at 9999, and vendor documentation for the conversion instructions notes that converting an integer above 9999 into a 16-bit BCD word raises a conversion error. Instruction sets document the paired conversions for exactly those cases: BCD_TO, for example, converts a BCD word into a binary integer inside the PLC. If both devices in the path store plain binary, BCD belongs nowhere in it.
The same discipline follows the tag onto the network. Analog values moved over Modbus are decoded according to signed integer, floating-point and scaling conventions, and a mismatch there produces the same family of wrong numbers; the signed integer, floating point and scaling conventions for Modbus analog data page covers that decoding layer. Floating-point values bring their own encoding trap, word order, which is the subject of displaying a PLC real value over Modbus on an HMI.
What should I change and verify before returning the screen to service? #
Change every affected tag's data type to Signed Int 16, download the project, then step each value through its full operating range while watching the screen and the register: the two numbers must match at every count, including 10, 19, 20 and 99.
Work the cases in order:
- Screen 10 with register 16, screen 19 with register 25, screen 20 with register 32: a BCD tag on a binary register. Set the tag to Signed Int 16, download, and repeat the step test.
- Register wrong from the first count: a wrong address or scaling offset. Verify the tag's address and scaling against the ladder.
- Screen and register agree but the machine still misbehaves: the timer or logic reads a different register. Check which address the ladder actually uses for the preset.
- Negative values shown as large positive numbers: a signed versus unsigned mismatch. Use the signed 16-bit type.
- Values still disagree after the type and address both check out: stop editing, keep the project and the diagnostics, and take the evidence to the panel vendor's technical support.
Before release, re-verify each delay preset against the machine's documented timing, because correcting the tag changes real behavior: presets that delivered 16 counts for a setting of 10 will now deliver 10, and the machine will run the delays the operator actually enters.
Questions asked
Does the same tag fault corrupt values the PLC sends to the panel?
Yes. The tag type governs both directions. While the mismatch is present, a binary 16 written into the register by the ladder displays as 10 on the panel, because the BCD tag decodes the word 0001 0000 as digits 1 and 0. Once every affected tag uses a 16-bit signed binary type, panel writes and panel reads agree with the register in both directions.
How far off were the delays while the fault was present?
A setting of 10 put 16 counts in the timer and a setting of 19 put 25, so every two-digit delay ran long: 10 ran at 1.6 times its intended length, and a 99 would have run as 153 counts. Re-verify each preset that was set while the fault was present, because machine timing changes the moment the tag is corrected.
What range does the corrected tag cover, including negative values?
A 16-bit signed integer covers -32,768 through +32,767. An unsigned 16-bit type covers 0 through 65,535, which is why a register holding -1 shows 65,535 on an unsigned tag. Match the tag type to the register's documented type rather than to the largest number you expect to enter, and retest both ends of the range after the change.
Is this fault limited to one panel or PLC brand?
No. It appears wherever a tag set to a BCD type points at a register that holds plain binary, regardless of vendor. The fingerprint is the same everywhere: values agree through 9, and above that the register reads each decimal number as if its digits were hexadecimal, so 10 arrives as 16, 19 as 25 and 20 as 32.