Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculating modbus RTU 3.5 character time

am new to Modbus and developing an application using Modbus RTU. I would like to know how to find out the RTU message frame separation time. In the Modbus RTU specification, It mentions 3.5 chars time, but there is no more data about how i can decide this intervals. and wat are the steps to calculate the separation time?

like image 356
user3128453 Avatar asked Dec 23 '13 08:12

user3128453


1 Answers

Take a look at page 13 of the Modbus Serial Line Protocol and Implementation Guide V1.02

At the bottom you will find a remark explaining the inter-character time-out (t1.5) and inter-frame delay (t3.5) values.

For baud rates over 19200 values are fixed. For slower baud rates they need to be calculated (extract from SimpleModbusMaster library for Arduino):

// Modbus states that a baud rate higher than 19200 must use a fixed 750 us 
// for inter character time out and 1.75 ms for a frame delay.
// For baud rates below 19200 the timeing is more critical and has to be calculated.
// E.g. 9600 baud in a 10 bit packet is 960 characters per second
// In milliseconds this will be 960characters per 1000ms. So for 1 character
// 1000ms/960characters is 1.04167ms per character and finaly modbus states an
// intercharacter must be 1.5T or 1.5 times longer than a normal character and thus
// 1.5T = 1.04167ms * 1.5 = 1.5625ms. A frame delay is 3.5T.    

if (baud > 19200)
{
    T1_5 = 750; 
    T3_5 = 1750; 
}
else 
{
    T1_5 = 15000000/baud; 
    T3_5 = 35000000/baud; 
}
like image 81
Mr. Girgitt Avatar answered Sep 28 '22 01:09

Mr. Girgitt