richw
What is the purpose of Transmission Pause in RTU slave devices and in what scenario would it be used? Does the Polling Period (ms) in settings affect the Transmission Pause or vice versa? Can the Transmission Pause be larger then the Polling Period? Any Info would be helpful
 
Thanks,
RichW
Reply 1 0
thiagoralves
This is a delay between the last bit of a message and the first bit of the next message on Modbus RTU. It is normally used to distinguish when a message ends and when another starts since there aren’t any delimitation characters on Modbus RTU. This silent time is calculated based on the baud rate, and cannot be smaller than 1.75ms. You don’t have to do anything about this as the protocol layer should take care of it automatically. The polling period refers only to the periodicity where you want to pull data from slaves.
Reply 1 0
richw
So if my polling period is 200ms and I have 3 slaves with a delay of 100ms, are only 2 slaves polled in the first 200ms and the 3rd in the next 200ms?
Reply 1 0
thiagoralves
No, all slaves are polled at the "same time" with an interval of 200ms between each pulling sequence.
Reply 1 0
richw
Not sure I understand. If I have 3 slaves being delayed 100ms isn't that a total of 300ms, because they are being called in sequential order? How can they complete in 200ms, or are they running on separate threads?
 
The issue I'm having is I have a RPI5 with 2 TCP slaves polling at 200ms. It has been running fine. I added 3 RTU slaves running at 9600bps and now the logs are telling me the slaves are timing out often but still receive data sometimes. It seems like there is not enough time for the RTU slaves to respond before moving on to the next slave request. I tried increasing the polling time 500ms with no changes. I don't want to increase the polling time too much because the TCP slave data is important to receive rather quickly. any suggestions about how to work with fast TCP slaves and slow RTU slaves without losing data?
 
Thanks,
RichW
Reply 1 0
thiagoralves
I'm not sure what you mean by slaves being delayed 100ms. The operation should happen like this:
Poll device 1, poll device 2, poll device 3 .... poll last device [ sleep for 200ms ] Pool device 1, ...
 
Your issue could be on your RTU bus. Maybe there is some noise on the line, or lack of proper bus ending, or something else.
Reply 1 0
richw
Yes I understand the 200ms polling period. but doesn't the Transmission Pause affect this ?
In an early post you said
"This is a delay between the last bit of a message and the first bit of the next message on Modbus RTU"
 
Isn't there going to be a delay between poll1, poll2 and poll3 if the Transmission Pause is set to 100ms
Sorry for all the questions, but I'm just trying to understand how this all works.
 
The RTU bus works fine with a USB RS485 adapter and modbus poll software so the bus seems ok
Reply 1 0
fg71
In Modbus RTU you have start bit and end bit and in between you have the message. I think Thiago meant was to know when a message start/end there is a delay. I believe Thiago is using Modbus RTU framing that do not have any start bit and end bit, instead use delay in interval.
Reply 1 0
richw
So when OpenPLC master send request to slave 1 it waits to receive reply then Transmission Pause (100ms), then send request to slave 2 then Transmission Pause (100ms),   then send request to slave 3 then Transmission Pause (100ms) that equal 300ms total. How does that work when the Polling Period is 200ms? or am I misunderstanding something,
Reply 1 0
fg71
The message is a stream and contains slave id message. So it will send message to all slaves without any delay.
The official standard defines the end-of-message condition as a 3.5 character idle-gap with no new data.
At 9600 baud, this gap is about four milliseconds.
Every slave has a frame and the delay I'm talking about is between frame 1 (slave 1) and frame 2 (slave 2).
Reply 1 0
richw
So OpenPLC master send request to slave 1, 2, 3 without delay then wait for reply from all 3 slaves then  Transmission Pause (100ms) till next send?
Reply 1 0
thiagoralves
Ah, now I can finally see why I'm not understanding anything on this conversation... Transmission pause is supposed to be calculated automatically by the protocol, in case of OpenPLC, by libmodbus that handles the Modbus connections. However, someone added this new extra field on the slave device settings that I forgot about: https://github.com/thiagoralves/OpenPLC_v3/commit/3558955a7024c8d63896f318700d8dc4236a5cfb
 
Looking at the code, it seems that all it does is an extra sleep between requests. But beware, it does this FOR EVERY REQUEST, not for every polling, so it may actually sleep more than you think. The scenario looks like this:
 
read device 1 inputs [ transmission pause ] write device 1 coils [ transmission pause ] read device 2 inputs [ transmission pause ] read device 2 coils [ transmission pause ] [ polling delay ] read device 1 inputs [ transmission pause ] ...
 
If you set transmission pause to zero, it won't sleep between requests and the code should behave like how I originally wrote it.
Reply 1 0
fg71
So OpenPLC master send request to slave 1, 2, 3 without delay then wait for reply from all 3 slaves then  Transmission Pause (100ms) till next send?
I'm not a expert in Modbus specification, I only know the basic stuff but you could read lot of it here.
Reply 1 0
Reply