The analog module writes each loop-current count into its PLC register as BCD, four-bit decimal digits. An HMI tag left on the octal type decodes the word in the wrong base, so the screen shows jumpy numbers like 012511 and the editor rejects the 819-4095 scale range. Change the tag's Data Type to BCD_INT_16, keep the register address, and the scale is accepted.
A current-loop input that shows a jumpy five-digit number on the panel is a tag data type problem, and the fix is one setting. The analog module writes each reading into its PLC register as BCD: the count is stored as four-bit decimal digits, so a count of 2662 is stored as the digit groups 2, 6, 6 and 2. An HMI tag left on the octal type decodes that word in the wrong base. That puts numbers like 012511 on the screen and makes the tag editor reject the module's real scale range of 819 to 4095. Set the tag's Data Type to BCD_INT_16, keep the register address as it is, enter 819 to 4095 on the PLC side of the scale, and the panel shows mA. This article shows how to confirm the fault, make the change and check the result against a metered loop.
Why the number makes no sense
The module's documentation gives the 4-20 mA span as 819 counts at 4 mA and 4095 counts at 20 mA. That is a 12-bit count: 4095 is 2^12 minus 1. The span covers 3276 counts, which is 204.75 counts per mA of loop current.
BCD storage means each group of four bits in the register holds one decimal digit. A count of 2662 sits in the word as 2, 6, 6, 2, and a programming tool that shows the register in hex displays 2662. A tag that decodes the word as one plain binary integer instead reads 2 × 4096 + 6 × 256 + 6 × 16 + 2 = 9826. An octal display format then renders that value in base 8. The number on screen now has no relation to mA. Because every change in the count's low digits jumps the misdecoded value, the display fluctuates even when the loop is steady.
Symptoms and what each points to
Four observations put the fault at the tag's Data Type:
| What you see | What it points to | What to do |
|---|---|---|
| The editor rejects 819 to 4095 as out of range and takes 4077 as the highest entry | The octal type's own range check | Set the Data Type to BCD_INT_16 |
| The reading fluctuates around 012511 while a meter shows a steady loop | BCD digits decoded in the wrong base; each low-digit change jumps the value | Same fix, then verify the raw count |
| The displayed number converts to more than 4095 | A BCD word read as a plain number can reach 16533, well past a 12-bit count's 4095 | Decode as BCD; do not rescale to fit |
| The reading is still wrong after the type change | Register address, channel mapping or the module's range setting | Check the module's manual for that channel's register and range |
Wrong decode has cousins on other platforms: analog values that read 0 over Modbus TCP come from a register mapping fault in the same family.
Set the tag to BCD_INT_16
The setup this article follows: one 4-20 mA channel wired into the analog module in slot 0, the register R400, and a tag T1 in the HMI software pointing at it.
- Open tag T1 in the HMI tag editor and confirm the register reference is R400.
- Set the tag's Data Type to BCD_INT_16. Leave the register address untouched; only the interpretation changes.
- Open the numeric display object that uses T1 and drop the octal 6-digit format. Use a decimal format with four digits, enough for 4095.
- Enter the scale: 819 to 4095 on the PLC side, 4 to 20 with units mA on the panel side. The editor accepts both ends once the type is BCD_INT_16.
- Download the project to the panel and verify the raw count before trusting the scaled value.
- Repeat for each channel's tag. Take each channel's register address from the module's manual; do not assume the next channel sits one register up.
Example: a 13 mA loop decoded three ways
Measure the loop with a series milliamp meter: 13 mA. The expected count is 819 + (13 - 4) × 204.75 = 819 + 1842.75 = 2661.75, which the module reports as 2662.
Stored as BCD, the register holds the digits 2, 6, 6, 2; a tool viewing the word in hex shows 2662.
Read as one plain binary integer, the same word is 2 × 4096 + 6 × 256 + 6 × 16 + 2 = 9826. An octal display renders 9826 in base 8 as 23142. That five-digit value has no relation to mA and jumps whenever the count's last digits move.
With the tag on BCD_INT_16, the word decodes back to 2662, which sits inside 819 to 4095. The scale maps it to 4 + (2662 - 819) ÷ 204.75 = 4 + 9.0 = 13.0 mA, matching the meter.
The value the panel was showing tells the same story. 012511 in base 8 is 1 × 4096 + 2 × 512 + 5 × 64 + 1 × 8 + 1 = 5449. No 12-bit count can exceed 4095. Whatever the field was displaying, it was not the module's count read straight.
The count scale from 819 to 4095
Two formulas convert either way across the whole span:
counts = 819 + (mA - 4) × 204.75
mA = 4 + (counts - 819) ÷ 204.75
| Loop current (mA) | Expected count | Register word in hex view |
|---|---|---|
| 4 | 819 | 0819 |
| 8 | 1638 | 1638 |
| 12 | 2457 | 2457 |
| 13 | 2662 | 2662 |
| 16 | 3276 | 3276 |
| 20 | 4095 | 4095 |
Enter the two ends in the panel's scale fields and let the panel do the math. The mapping is the same job as showing an HMI timer counting from a PLC current value, applied to an analog count.
Check the reading
Check the raw count before the scaled one. Set the display to show T1 with no scaling. At 13 mA the panel should read about 2662 and hold steady within a few counts on a steady loop.
Then drive the loop to the ends with a calibrator or the transmitter's trim: about 819 at 4 mA and about 4095 at full scale. Enable the 819 to 4095 scaling and compare the mA display against the meter at 4, 12 and full-scale current.
Two results tell you to stop editing the tag and look elsewhere:
- The raw count does not track the metered current. The register address, the channel mapping or the module's range setting is wrong; the module's manual lists all three.
- A raw value shows a digit above 9 in a hex view. The word is not BCD, which points at the same address or range settings.
If the editor refuses the tag or the register itself instead of the range, that is an address fault, covered in fixing HMI invalid address errors when tagging PLC memory.
BCD math in the ladder too
The data type affects the controller as well as the panel. Ladder logic that compares R400 against a constant, or scales it, must use BCD-capable instructions or convert the word to binary first. Otherwise the CPU computes the same class of wrong answer the panel was showing. The instruction names are listed in the controller's instruction set manual; the panel fix changes none of that logic. Arithmetic on BCD words fails in its own characteristic way, and the page on why hex 20 becomes decimal 25 after a decrement works through one case.
What to do
Recommendation: Set the Data Type to BCD_INT_16 on every tag that reads one of these analog registers, leave each register address as it is, and re-enter the scale as 819 to 4095 on the PLC side with 4 and 20, units mA, on the panel side. Verify the raw count against a metered loop before enabling the scaling, and check the type again on any tag copied from an older project, where the octal type tends to survive.
The panel job ends there. If the same wall grows into shift notices, safety messages or line status on a bigger screen, that is separate equipment: our shop-floor signage displays handle notice and status boards offline, which is a different job from reading an analog register.
Questions
Why did the tag editor cap the scale range at 4077?
With the octal type the editor rejected 819 to 4095 and took 4077 as the highest entry. 4077 is the largest value up to 4095 whose digits are all 7 or below, so a field typed as octal cannot take the 9 in 4095. Once the tag is BCD_INT_16 the editor accepts the module's full count span of 0 to 4095. Do not shrink the range to satisfy the wrong type; the decoded number stays wrong.
Does the PLC program need changes as well?
Yes, wherever ladder logic uses the register. A BCD word compared against binary constants or scaled with plain binary instructions returns wrong results in the controller even after the panel reads it correctly. Use the controller's BCD-capable instructions or convert the word to binary before the math; exact instruction names are in the controller's instruction set manual. A tag that only displays the register needs no ladder change.
How do I map the same register to a temperature reading?
Keep 819 to 4095 as the PLC-side span and put the sensor's span on the panel side instead of the current values. If the transmitter sits at the bottom of its temperature range at 4 mA and at the top of its range at full output, enter those two temperatures as the panel scale low and high in degrees. Check one point against a reference thermometer before trusting the display.
Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.