Modbus Data Length


Thread Starter

Chris Prozzo

Does anyone know if there is a way to handle data larger than 256bytes using modbus RTU. We use modbus to get data from and set up an air monitoring instrument and some of the data structs are many K in length and the modbus byte count is only one byte long. If there is no way around this limit other than breaking up the data into many segments, how about modbus plus?

Are you writing BOTH end of this design?

I have seen 2 NON-STANDARD ways to send more than 256 bytes per message:

1) One suggestion (see page titled "Increasing the performance of ModbusTCP Protocol") is using a value of 0xFF as a byte count meaning "escape" to a special 16-bit word following this. In general this is "Ok" (but non-standard) because as Modbus Fnc 3 requires even numbers of bytes for moving WORDS you'd never have a standard Modbus reply with 255 bytes of data.

So the Response would be 01 03 FF AA BB CC, where FF is the escape and 0xAABB is the new extended 16-bit size, and CC is the first byte of data.

2) I've seen some devices just put ZERO in this byte count as a flag to just use the standard Modbus "timeout" to find the end-of-message.

So the Response would be 01 03 00 CC, where 00 is the "flag" and CC is the first byte of data.

But I stress both of these methods are "custom" and whatever you do you MUST ALLOW users to DISABLE such behavior. It's like the Modbus/RTU drivers which allow a user to WRITE more than 100 registers at once (the traditional Modbus/RTU limit) - they should ALLOW the user be able to LIMIT the writes to 100 or enable writes up to 122 regs if their devices are known to support


Lynn August Linse, Senior Product Application Engineer
15353 Barranca Parkway, Lantronix Inc, Irvine CA 92618
[email protected]
Tel: (949)300-6337 Fax: (949)453-7132

Darold Woodward

You are stuck with the same maximum frame size in both Modbus and Modbus Plus. Unfortunately, the protocols do not have an intrinsic capability for multi-frame messages. I've seen applications where the protocol was extended to provide this capability as a proprietary, non-interoperable solution. The standard Modbus register reads work fine, but for anything else, you must get both the master and the slave device from the same vendor.

Most network protocols only increase frame size to a certain limit and then shift to multi-frame messages. If you extend Modbus for multi-frame
messages, almost nobody will be interoperable with your extensions (although that may not be important if end-user's won't try to use an
off-the-shelf Modbus driver to configure your device). Even in Ethernet, the frames are limited to 1500 bytes, but the standard protocol stacks and application layers include techniques for sending multi-frame messages.

One possibility is ModbusTCP and Telnet and FTP or an HTML server to eliminate the need for configuration software. It isn't cheap though. Cheaper, but not as elegant would be to let the end-user switch between Modbus and an ASCII or
binary protocol (or provide 2 ports) and use zmodem or some other standard protocol to exchange large blocks of data.

Darold Woodward PE
SEL Inc.
[email protected]
Sorry, but there is not much you can do to read larger data blocks when using Modbus. As you noted, Modbus only allocates a single byte to the message length (byte count) in its Response Frame. Actually Modbus places a limit of 125 registers (250 bytes) in the Read Holding Registers (03) function, asking for more should properly result in an error response from the slave.

Modbus+ and Modbus TCP/IP allow programmed register read counts up to 65535, but as both still use good old Modbus, albeit wrapped up in another protocol, the 125 register limit is still in there somewhere. Fortunately MB+ runs at around 1MHz, and MB-TCP/IP is 10 MHz, so their effective data transfer rates are significantly more.

Ian Milne
Upside Engineering Ltd.
Calgary, Canada

Carlos Araya Mackenney

I hope is a modbus standard. If it is, I think you can not transmit more than 255 bytes. All the other modbus (TCP, Plus), are the same but they change the comm media.
Try to read in two polling block with lenght under 255. I hope you can do this in your master station.

Carlos Araya Mackenney [[email protected]]
Automation Manager - PLC International S.A.
Phone (562) 269.8727 - Fax (562) 269.8728
Santigo, Chile