Troubleshooting
Scaling encoder counts to inches on an HMI display
Short answer
A value like 9E-46 on a scaled encoder readout is a data-type symptom: the HMI tag reads integer counter memory as a 32-bit float. Set the tag to the integer type the counter writes, apply two-point scaling from 0 counts/0 inches to 2,540 counts/1 inch, set four decimal places on the object, and let one layer, HMI or PLC, own the conversion so the count is never scaled twice.
On this page
A scaled encoder readout that shows values like 9E-46 is not telling you the scaling math is wrong. It is telling you the HMI tag is declared as a 32-bit floating-point number while the counter card writes a plain integer count into the register, and the panel renders the mismatched bits as a tiny number in exponent notation. Fix it in this order: declare the tag as the integer type the counter actually writes, scale with two points — 0 counts to 0 inches and 2,540 counts to 1 inch — set four decimal places on the display object, and let exactly one layer, the HMI or the PLC, own the conversion. Do that and the exponent garbage disappears, and the readout tracks the scale in inches to four decimals.
What a 9E-46 value actually is #
Panels render very small numbers in exponent notation, and the C-more help names exactly that as the condition for the exponent display. The 9E-46 in the reported project is therefore a symptom: the tag was declared as a 32-bit float, "Floating PT32" in the C-more tag editor, over a register pair holding a 16-bit integer count plus whatever follows it. A float splits its 32 bits into sign, exponent and mantissa, and a small integer count reinterpreted that way lands at absurd magnitudes such as 9E-46.
One presentation-only check is worth doing first because it makes the value readable while you work: in the C-more editor, open Setup > Panel Manager and tick Disable Exponent Notation, then transfer the project. That setting changes number formatting and nothing else — it does not repair the tag type, the address or the conversion. If the readout becomes readable but implausible or frozen, keep working down this page. Wrong declarations fail in recognizable ways, and the signature saves diagnostic time: a float over an integer lands in exponent notation, while a BCD tag over binary counts makes a display jump from 9 to 16, as covered in why an HMI counter display jumps from 9 to 16.
Match the tag to the counter register #
Watch the count register — V2000 in the reported project — from the PLC software while jogging the scale. The raw count should move with travel, in the right direction, and by a plausible amount. If the PLC word behaves and only the HMI shows garbage, the fault is in the tag declaration, and the PLC program needs no change for the display itself.
Then make the tag match the memory exactly:
- A raw integer count takes a signed integer tag, not Floating PT32. If the counter card keeps a 32-bit count, declare a 32-bit integer spanning the two consecutive count registers at the card's documented address.
- A floating-point tag is correct only when the program genuinely stores a float at that address, and it must begin at the first of the two registers the float occupies.
- Address and length are part of the type: the right format at the wrong register, or one register of a two-register value, garbles the number just as thoroughly.
Quadrature counts decrement in reverse, so read the count as signed rather than unsigned; reverse travel then shows as negative inches instead of wrapping to a large positive value. The same reasoning is laid out in displaying a PLC counter current value with a signed HMI tag.
Size the format against the travel as well. A signed 16-bit word ends at +32,767, and 32,767 / 2,540 counts per inch = 12.90 in. An axis that travels more than about 12.9 in from its zero position overflows that word, so it needs the counter card's 32-bit count and a matching 32-bit tag.
Enter the scaling points and decimals #
With the tag reading the raw count correctly, enter the conversion as a two-point linear scale: point 1, PLC value 0, display value 0; point 2, PLC value 2,540, display value 1. That maps inches = counts / 2,540. The mechanics are the same as when you scale a PLC integer into an HMI display value; only the magnitudes are larger. Set four decimal places as a separate property of the numeric object: decimals format the display and are not a scaling step, and four decimals on an unscaled tag just render a precise-looking wrong number.
Worked example, calculated from the 2,540 counts per inch you enter: a raw count of 635 displays as 635 / 2,540 = 0.25 in, rendered 0.2500 with four decimals. The endpoints check clean — 0 / 2,540 = 0.0000, and 2,540 / 2,540 = 1.0000. One count is 1 / 2,540 = 0.0003937 in, so a correctly scaled four-decimal display steps in increments of about 0.0004 in. The fourth decimal is finer than the encoder's resolution: treat it as display precision, not measurement resolution.
Choose the layer that owns the conversion #
Decide once where counts become inches:
- Scale in the HMI. The PLC keeps the raw count, the tag carries the two points above, and PLC logic using position keeps working in counts. With one C-more and no data logger, this is the simpler choice, and it is the one the reported project was already half-built around.
- Scale in the PLC. Convert once into a floating-point inches value and declare the HMI tag over the converted value with no HMI scaling. Choose this when a second panel, a logger or another screen set also needs inches.
Converting in both layers produces a value wrong by a factor of 2,540 that still looks plausible — harder to catch than exponent garbage. If you inherit a project, check both sides before editing either: watch the register, and if the PLC already stores inches there, set the HMI tag to pass the value through instead of adding the points again.
Validate against a known distance #
Judge the readout at endpoints, not at one arbitrary position. One safety note: jog at a speed you can stop, and keep hands, gauges and tools out of the travel path.
- Home the axis to its known zero and record the raw register and the HMI display; both should read 0, or the documented home offset.
- Jog exactly 1.000 in against a gauge block or a calibrated indicator: the raw count should read 2,540 and the display 1.0000.
- Travel a longer known distance, say 10.000 in: the count should read 25,400, still inside the signed 16-bit range, and the display 10.0000.
- Reverse over the same distance and confirm the sign flips and the value returns to its start; that checks quadrature phasing along with the signed format.
- Confirm the object shows four decimals with the decimal point where you expect it.
- If the axis cannot move safely or practically, write a known test count into the register from the PLC software and check the display against counts / 2,540 — 1,270 must display 0.5000.
Then run the scale through its normal range once and watch the display track without latching or jumping.
The decisions, symptom by symptom #
| What you see | What it is | What fixes it |
|---|---|---|
| 9E-46 style values | Float tag reading integer count memory | Declare the tag as the integer type the counter writes |
| Readable but implausible magnitude | Conversion applied twice, or a wrong point pair | One layer owns the scaling; points 0 to 0 and 2,540 to 1 |
| Value frozen while the scale moves | Tag at the wrong register, or the counter is not counting | Watch the register live in the PLC software; verify the card's count configuration |
| Large positive value in reverse | Unsigned tag over a decrementing quadrature count | Signed format; the sign then shows direction |
For the reported project the decisions land as: a signed integer tag on the count register, 32-bit if travel can exceed 12.9 in; HMI two-point scaling of 0 counts to 0 inches and 2,540 counts to 1 inch; four decimals on the object; the PLC program untouched. 635 counts then reads 0.2500 in, and a 10-inch move reads 10.0000 — that is the pass condition.
Questions asked
Why 2,540 counts per inch — what is that in metric units?
One inch is exactly 25.4 mm, so 2,540 counts per inch / 25.4 mm per inch = 100 counts per mm, which is one count per 0.01 mm of travel. Use that to cross-check the linear scale's datasheet or to set up metric units: the two-point pair becomes 0 counts to 0 mm and 100 counts to 1 mm.
Does four decimal places mean the reading is accurate to 0.0001 in?
No. Four decimals is display formatting. The measurement resolution is one count, 0.0003937 in at this scaling, and accuracy is a separate matter: it depends on the scale's calibration, the squareness and backlash of the mechanical travel, and where the zero reference actually sits. Validate against a known physical distance before using the readout for a tolerance decision.
The display shows dashes instead of a number. Is that also a scaling fault?
Some panels draw dashes when a numeric object receives characters that are invalid for its declared format, often with an error shown at the element, rather than showing a number. Treat that as an address-and-type problem: confirm the tag begins at the first register of the value, that the length matches, and that the declared type matches what the program stores, before touching the scaling points.
How do I know whether the counter card keeps a 16-bit or a 32-bit count?
The counter card's count-register documentation states the register address, how many words the value occupies and whether it is signed. Confirm it live too: park the axis near one end of travel, read the consecutive registers from the PLC software, interpret the pair as a signed 32-bit integer, and check it matches the expected count for that position.