Increasing the performance of ModbusTCP Protocol.

The ModbusTCP (http://www.modicon.com/openmbus) protocol still has a 256 byte limit on the length of each message. This limits the throughput of Modbus messages between two machines on a 10M bit system to about 25,000 bytes per second. Testing (on a 486-133Mhz under Windows 95) has shown that for Modbus messages that can be 2048 bytes long, the throughput is about 107,000 bytes per second.

The idea is very simple, it uses the same method that Allen Bradley uses to increase the length of their messages. The 256 byte limit comes about because a single byte Byte count field is used to encode the length of a message. The proposal is for messages less than 255 bytes a single byte Byte count field is used. For longer frames a three byte Byte Count field is used, the first byte is set to 0xff, the next two bytes are the length (high byte of length first, then low).

Byte Count Length Byte count High Byte Low Byte
Length < 255 Length    
Length >= 255 0xff High byte of Length Low byte of Length

This method is compatible with the current Modbus standard, because with standard Modbus the Byte count field can never have a value of 0xff.

With the current 256 byte limit, increasing the Ethernet bus speed from 10M to 100M does not result in a corresponding increase in throughput for Modbus messages.

Print out the following first, it takes longer to describe it, then to actually do it. Use default values unless they are mentioned otherwise.

To verify this claim for yourself, you can download the software from http://www.ioserver.com. Set up a Modbus Ethernet Slave device (add a TCP/IP Board with TCP/IP.Port, add a SlavePort with Modbus.Protocol, no IP Address, Ethernet Protocol, Slave Mode, Buffer Size 2048 bytes, add a Slave device with address 0) on one computer and a Modbus Ethernet Master device (add a TCP/IP Board with TCP/IP.Port, add a MasterPort with Modbus.Protocol, IP Address of the Slave, Ethernet Protocol, Master Mode, add a Master device with address 0) on another computer. On the Master computer, add an `IOServer' OPC Server, add a group, add 16 arrays of 125 words each from the Master. (When adding items, click on 4%04u(1-9999) first, set end to 2000, increment to 125 and ItemID Post to [125]).

What you have just done, is to read 2000 registers from the slave continuously.

Set the group Update Rate to 1 ms. The throughput in bytes/Sec is shown in the Port folder. Set the group to inactive, change the Master port->Modbus Channel->Buffer Size to any value between 256 and 2048. Set the group to active and note down the change in throughput. You should not change the Buffer Size while any group using it is active.

Last updated: 26 November 2001