Tiza Group

Home / Guides / Testing, commissioning and faults

Single-Register Modbus Values Arriving Wrong

Why a 16-bit Modbus value arrives wrong: sign, overflow, scaling, address or byte order, and how to measure it. We configure it remotely.

By Shadai García, CEO and protection engineer at Tiza Group.

Short answer

A Modbus value held in a single 16-bit register that arrives wrong is almost always one of six causes: a negative value read as unsigned, a value that does not fit in 16 bits, wrong scaling or decimals, an address shifted by one, the wrong register type or reversed byte order. A raw register read and the device manual identify which one it is.

Symptom

SCADA or the master reads a 16-bit Modbus register and the value does not match the device panel. “Wrong” comes in several forms, and each points to a cause: a negative value that appears as a huge number, a figure that wraps around and starts again, a correct value multiplied or divided by ten, one hundred or one thousand, the data of the neighboring variable, or a meaningless number in which the two halves seem swapped. This kind of fault is not a communication problem: the data arrives complete but is interpreted wrongly. To understand how information is organized into registers and functions, see Modbus data model and functions.

Likely causes, from most to least likely

CauseHow to recognize itWhat confirms it
Wrong scaling or decimalsThe value keeps a constant ratio (10, 100, 1000) to the panel valueCompare several readings and see that the factor is always the same
Sign: negative value read as unsignedNegative values appear near 65,000; positive ones are correctRead the raw value; subtract 65,536 from the number received
Address offset of oneThe value is that of the previous or next variableRead the register one address lower and one higher
Wrong register typeValues at zero or unchanging; illegal address errorSwitch between read and write registers according to the manual
Value that does not fit in 16 bitsThe number grows and suddenly drops to a small value or stays at a ceilingWatch whether it happens past a certain value; check whether the manual splits it across two registers
Different byte or word orderValues unrelated to the panel; swapping halves makes them matchTry the master’s order settings
Reserved “not available” or sensor fault valueA fixed, odd value appears when the input failsCheck the device manual for the value that means invalid data
Refresh: the data does not update or arrives lateThe value looks right but lags the panelChange the quantity and time when it shows up

How to diagnose it

  1. Read the raw register with a test tool connected to the device, with no SCADA or gateway. Note the decimal value and its hexadecimal equivalent. If the raw value is correct, the error is in the interpretation downstream.
  2. Compare with the device panel in three or four conditions: low value, high value, negative (if applicable) and zero. A constant error in every condition is scaling; an error that only appears in negatives is sign; one that appears past a certain value is overflow.
  3. Check the device manual for that variable: data type (signed or unsigned integer, long unsigned, decimal), unit, factor, register type and address. It is the only document that says how it was encoded, not the habits of other devices.
  4. Test the address offset. Read one address lower and one higher. If the correct value appears at either, the device and the master number differently. The protocol specification numbers from zero inside the message, while many manuals number from one, so the difference is common.
  5. If the value takes two registers, verify which one holds the high part. The protocol specification does not fix the order of the two words; the manufacturer decides it, and most masters let you configure it.
  6. Check the point at each link. The same data can pass through the device, a gateway and SCADA. Scaling or sign can be lost at any of them. The technique of injecting a known value and reading it at each link is in the guide on SCADA showing current with a scaling error.
  7. Confirm the read does not mix blocks. If the master reads a large block of registers and splits the result, a single miscounted register shifts everything that follows.

Illustrative example

A device delivers a temperature in a register with one implicit decimal place, that is, multiplied by ten. The panel shows 25.3 and Modbus delivers 253: SCADA displays 253 until a factor of 0.1 is configured. Separately, a negative reactive power of minus 10 appears in SCADA as 65526. The subtraction confirms it: 65,526 minus 65,536 gives minus 10. With the data type corrected to signed integer, the symptom disappears. These are illustrative examples with generic values.

What to do

  • Scaling: apply the factor once, at a single link, and document it in the point table.
  • Sign: configure the point as signed integer in the master or the gateway.
  • Address offset: adjust the master’s numbering base (zero or one) according to the device manual, and verify with two or three known points, not just one.
  • Register type: use the one the manual gives for each variable.
  • Overflow: ask the manufacturer or check the manual for the two-register version of that variable, or change the unit (for example, from units to thousands) if the device allows it.
  • Word or byte order: change the master’s setting until the reading matches the panel in three different conditions.
  • Reserved value: configure SCADA to treat it as invalid data and not as a measurement.
  • Document every point: address, type, factor, unit, range and which value means a fault.

Field checklist

  • I read the raw register directly from the device.
  • I compared with the panel at low value, high value, zero and negative.
  • I have the device manual with the data type, factor and register type for that variable.
  • I tested the address one lower and one higher.
  • I verified whether the variable takes one or two registers.
  • I tested the master’s byte and word order.
  • I confirmed the scaling at each link in the chain.
  • I verified the corrected point in the conditions that showed it wrong.
  • I updated the point table.

What not to do

  • Do not correct with a factor “by eye” until several readings confirm it: it can mask a sign or an overflow.
  • Do not apply the same factor at two links in the chain.
  • Do not write to registers “to test” on a device in service: a write to the wrong register can change a setting, a mode or a command.
  • Do not rely on a single point to decide the address numbering base.
  • Do not use a measurement as an input to a protection or a control until it is verified over its whole range.

When to call us

Call us when there are hundreds of points to review, several manufacturers with different conventions, or when the data feeds a billing measurement, a control or a command. We review the register map, the gateway and SCADA, and leave the point table verified. We configure it remotely: request configuration support.

References

  • Modbus Organization, MODBUS Application Protocol Specification, version 1.1b3.
  • Device communications manual (register table, data type, factor and unit of each variable).

Frequently asked questions

Why does a negative value show up as a very large number, close to 65,000?

Because the register stores the value as a signed 16-bit two's complement number, and the master is reading it as an unsigned integer. An unsigned 65526 equals minus 10 signed. Fix it by setting the point's data type to signed integer.

Why is the value I get the one from the neighboring variable?

Almost always because of an address offset of one. Manual numbering and the address carried in the message do not always start from the same number: the message uses addresses starting at zero. If the master and the device disagree, every read brings back the neighboring register.

What if the variable does not fit in a single register?

It is split across two consecutive registers, and the order in which the two halves travel is not fixed by the protocol specification: the manufacturer defines it. If the order does not match what the master expects, the value arrives with half its digits swapped. Fix it with the master's word order setting.

WhatsApp