Modbus communication problems


Thread Starter


We found some problems sending certain signals [negative numbers with a decimal] down to the Allen-Bradley PanelView, and the problem seems to be caused by an inherent limitation of Modbus. Can the use of ethernet over fiber rather than Modbus over fiber be a solution?

Alan Hartwell

If "negative numbers with a decimal" refers to integers (with possibly some kind of scaling on the PanelView), all you may need to do is configure the PanelView data type as signed rather than unsigned. A negative Modbus number would show on a PanelView configured for unsigned data as a positive number between 32768 and 65535, assuming no scaling in the PanelView.
You didn't mention the details of the problem.

Also, Ethernet and Modbus are two different technologies that operate at different layers. Modbus is at the application layer, Ethernet is a family of frame-based computer networking technologies for local area networks (LANs).

If you are only having problems with 'negative numbers with a decimal' and all other data types can be successfully transfered, then the problem is not at the physical layer.

Since Modbus does not define storage format for floating points, you are most likely experiencing problems with word ordering.

If you want to test this using a different Modbus master on a PC to try and isolate the problem, visit and download a Modbus ActiveX Control or OPC Server.

Both can be used to interact with your Modbus slave and have settings for floating point word ordering.
Both the Modbus master and the Modbus slave have to agree upon the format in which number values are used, whether that format be signed integer, unsigned integer or floating point.

It could be that either the slave or master can not handle a particular number format. The implementation of an open standard (which Modbus is) does not require any particular requirement to handle certain number formats.

Can you provide examples of the number value and the number format you believe the master and the slave are using with those particular registers?


Ganesh Okade

As one of the posters above rightly mentioned, this is not a problem with MODBUS. MODBUS does not define data type interpretation but leaves it at bits and bytes. However, most high level MODBUS drivers, packaged with commercial HMI packages like Intouch or iFix provide for one layer above MODBUS that does data interpretation as well (integer, float, unsigned integer etc.).

As such, it appears to me that your problem is caused either with:

a) Incorrect data type specification for the data tag that you are acquiring via MODBUS

b) Incorrect byte ordering specification (if any)

While the first one is very likely, the second is not normally left by the driver vendor to be specified by end-users. But you could still check it out.

As regards your original question - if Ethernet is better than MODBUS, I would say that these two cannot be compared at the same level. In fact when you run MODBUS TCP, you are already using Ethernet as the Data Link/Physical layer with TCP/IP providing the network and transport layers and MODBUS itself at the application layer.

Ganesh Okade
Sunlux Technologies Ltd.
Industrial Communication Experts