modbus reading not actual

  • Thread starter Ahmed El-dosoky
  • Start date

Thread Starter

Ahmed El-dosoky

We are connecting our DCS system with PLC using Modbus-RTU (RS485). I am getting some reading in the DCS but this reading are changing fast and expressing a wrong reading also.

But I think the physical link established OK because the TX/RX LEDs in both sides are blinking.

Hopefully to find a solution for this problem with professionals
For example, what reading do you expect?
As examples, what readings are you getting that do appear correct?

What is the rate of change that does not appear to be correct? 10% of scale per second?

Try connect Modbus Master application with possibility to change the display data format.

If you read real as integer you will often have fast changes - so maybe your problem is that you read the wrong addresses / formats. Try Modbus Tester from


Ahmed El-dosoky

I am expecting to get the same reading as it is in the PLC HMI for example for tank level = 50m it should comes to me the same but what the case with me that for this type of reading (Analog) getting some strange numbers rapidly changing. I think I have to reorder the bits coming from the PLC (some bit shift or the entire word) but I don't know how to do such issue.

Please also know that PLC vendor expressing the analog values in double word (32 bit).

I tried also to make some offset and gain adjustment by simulating the PLC reading at any given values and get DCS reading and try again with diffident simulated reading but that not solve the issue also.

I don't know exactly what is the problem.
The data in the slave/server (presumably data in the PLC?) is in a format that has to be interpreted by the master/client (DCS?), which means both the master and the slave need to use and handle exactly the same data format.

32 bit words can be one of several formats:
-32 bit long integer
-32 bit floating point with one of two different common formats depending on byte and word order.

The two common 32 bit floating point formats go by at least half a dozen names: big/little endian, Motorola/Intel, alphanumeric designations like FPLB/FP L or BADC/CDAB, the term 'word swap' or 'byte swap'.

Many (but not all) Modbus client/servers have somewhere in their configuration a choice for which 32 bit floating format is used to interpret the data.

The slave/server's documentation should tell you what format choices are used or are available and whether that format is a long integer or a floating point.

You need to research how to change how the DCS interprets the floating point data - how to interpret it as the alternative format. If the format can't be changed in the master, can the format be changed in the slave?

As Andrzej points out, interpreting a floating point in the wrong format can cause large changes in values for a relatively stable value.

One other way that values can be misinterpreted is when a floating point value, which consists of two 16 bit Modbus registers, is read from one register of a data value and from one register of another data value, the previous or next data value in the register sequence. That can happen when target addresses are off by one. There's no way to produce a correct value when 16 bits are from one data value and 16 bits are from the data in the adjacent register. The addressing would need to be corrected.

Lynn August Linse

> Please also know that PLC vendor expressing the analog values in double word (32 bit).

Be aware that there is no 'standard' for how Modbus moves a 32-bit word.

Modicon PLC move it with low-word first, but big-endian bytes in the two words (so a hybrid part little & part big endian)

Many third-party devices move it with high-word first in true big-endian.

Your DCS needs to be able to support either design, so check with their tech support or documentation.

Luca Gallina

I had once an issue with DeltaV DCS and Siemens PLC, where the 16-bit endian order was managed by the DeltaV driver but 32-bit values needed to be swapped at word (not byte) level. The easiest solution was the adapting of the byte order at PLC side.

Quick hint: send the value 12345678 hex and check the received digits order (as hex value) at the other end of the Modbus line.

See page 19 of the following manual for some info and hints on how to handle Modbus 32-bits values on Siemens PLCs: