RTU modbus mode

T

Thread Starter

TAT

Hi,

In RTU mode in the Modbus message, for each byte there are 11 bits:
1 bit - start
8 bits - data
1 bit for parity
1 bit for stop bit

If parity is none, then stop bit will be 2.

However, in most applications I see that in RTU mode, although parity is set to be NONE, stop bit is still set to be ONE. Why is that? Is stop bit supposed to be TWO because parity is NONE?

Thanks,
T
 
D

Darrin Hansen

According to the spec, yes you are correct: there "should" always be 11 bits per character. However, the market dictates its own requirements sometimes, and this is one of those times. Because many people have come to expect this "unspecified" behavior, it is best for products to support both one stop and two stop bit selections with no parity.

Darrin Hansen
ICC, Inc.
 
D
The short answer is no. Having parity set to none does not require the system to then be set to two stop bits. As to why, I don't have time to write an essay on how the UART works, just know that the system will reduce the number of bits by one when you set parity to none. If the PLC has over run errors, then set the stop bits to two.
 
D

Darrin Hansen

Actually, 2.5.1 of the current "modbus over serial line spec" states "...Remark : the use of no parity requires 2 stop bits..."

If a product was designed according to the "old" PI-MBUS-300 Rev J spec, page 6 of that document states "...1 stop bit if parity is used; 2 bits if no parity..."

But again, in practice customers don't really care about what the spec says in this regard: if they want to use no parity/1 stop bit (for whatever reason), they expect products to support that.

Darrin
 
J

Jerry Miille

The official specification says just what you define. However, common practice dictates that you should have the "choice" to make your communication settings 10 bits by setting the parity to none and the stop bits to one for Modbus RTU.

There is really no reason for a parity bit when using Modbus RTU anyway because the protocol includes a very robust, 16-bit CRC error detection algorithm. Just save the bit time and move on.

Of course, if you are strictly adhering to the 3.5 character time out value, then it makes this computation a little more difficult, but even then, many devices don't really pay that much attention to the exact time out value.

Jerry Miille
Miille Applied Research Co., Inc.
http://www.miille.com/
 
Top