RTU Interframe time interval

35 views
Skip to first unread message

mrfau...@pede.com.br

unread,
Dec 8, 2020, 1:28:42 PM12/8/20
to libm...@googlegroups.com
Dear Sirs :

We can read in section 2.5.1.1 of the "MODBUS over serial line
specification and implementation guide V1.02" standard ( see frames.pdf
attached file ) :

"In RTU mode, message frames are separated by a silent interval of at
least 3.5 character times."

I acquisited the tx and rx signals in a serial line which maybe show
that the above requirement of the standard is not being obeyed by
libmodbus. The pictures in the attached files "twopackets.png" and
"fourpackets.png" show pieces of this acquisition. This pictures are
generated by a cheap logic analyser connected to the USB port of my PC.
In one end of the RS232 line there is a micro-controller where I
implemented a Modbus Master program. In other end there is a slave
Modbus program using libmodbus running on my Linux PC.

In "fourpackets.png" one can see the master sending a function 3 request
of one register numbered 0x7ff followed by the slave ( libmodbus )
response with almost no time between them. After this, the master sends
other function3 request, now to read one register of number 0x800 and
again almost immediatly the response of the slave. In "twopackets.png"
is shown the zoom of the first two frames shown in "fourpackets.png".

If I did not misunderstood the standard, a frame is a packet of
characters sent even by the master or the slave device. If it is right,
there must be a at least T3.5 time between the master request frame and
the libmodbus slave response. If the master try to verify this
requirement, it will consider the fast libmodbus response as an spurious
frame and will drop it which will cause an retry time-out error in
master side.

I have some questions :

- My understanding of the standard is right and a delay between the
master request and slave response must exist ?

- If my understanding of the standard is right, is there any kind of
configuration of the "libmodbus" that I am not doing and is necessary to
produce this delay between master and slave.

- Is it a bug of libmodbus ? If it is, could you fix it in a library
that run over Operational Systems that are not real time ? Maybe it is
not so hard because the standard say that the time must be "at least"
and no exactly equal.

Sorry about my poor english. I wish you could understand my doubts.

Marcos Roberto Faustino
Photon Engineering
frames.pdf
fourpackets.png
twopackets.png

Stéphane Raimbault

unread,
Dec 9, 2020, 3:57:26 AM12/9/20
to libm...@googlegroups.com
Good morning Marcos,

Le mar. 8 déc. 2020 à 19:28, <mrfau...@pede.com.br> a écrit :
Dear Sirs :

We can read in section 2.5.1.1 of the "MODBUS over serial line
specification and implementation guide V1.02" standard ( see frames.pdf
attached file ) :

"In RTU mode, message frames are separated by a silent interval of at
least 3.5 character times."

The libmodbus doesn't respect the silent interval of the specifications.
I chose this design when I created libmodbus (very long time ago) because the industrial
system I was working on had to have low latency, high data volume and a 19200 serial link.
The absence of this silent interval could be an issue if you want to time based synchronisation
over the line but it is rarely a problem in practice.

However, there is a PR to support that behaviour

The difficulties of maintaining libmodbus will be described very soon in another mail.
Very clear and detailed analysis BTW.

Stéphane
 
Reply all
Reply to author
Forward
0 new messages