What About Scaling in Modbus

Modbus does not provide a method for transporting large or Floating Point numbers or a mechanism for scaling analog values.

A 16 bit word can only contain values in the range 0-65535. Only whole numbers are permitted.

To work around this many server device manufacturers use multipliers and document them in their manuals. For example to report a temperature of 58.5 the device reports a value of 585, and make a note in the manual that the master should scale by 10. This scaling is achieved by adopting a convention between the client and the server.
What about large numbers > 65535

Modbus does not provide a mechanism but 3 important schemes are widely used.
Long Integers – Two consecutive 16 bit words are interpreted as a 32 bit long integer.
MK10 values – Two consecutive words are used. The 1st reports the number of units and the 2nd reports the number of 10,000’s.
Floating Point Numbers – Two consecutive words are used and a scheme. (See section X)

These schemes are conventions and not all servers or clients support them.
The protocol does not identify these big numbers. Only the vendor docs do. What we mean by this is – if you look at the byte stream in a Modbus message there is no way of telling whether you are looking at two consecutive 16 bit words, or two consecutive words that should be interpreted as floating point, long or MK10 formats. Because of this you always have to look to the vendor docs. Read more in Appendix.

Byte/Word Order – An ambiguous nightmare

Leave a comment