SPLat Logo

Message gap x10mS

NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

Message gap x10mS

This is a Communication Control Block (CCB) parameter. It occupies byte 9 (counting from 0) in the CCB.

The ModBus RTU protocol specifies that 3.5 character times or more of silence is to be interpreted as the end of a message. It is the only mechanism specified by ModBus for the receiving device to know that a message has been completed.

In practical communications systems this can cause problems. For example, a modem can introduce random silences into the data stream as a result of its built in error detection and correction algorithms. A satellite link can introduce very long gaps, up to seconds. If you are passing data through any kind of converter boxes, gateways or routers there could also be a problem.

On transmit the SPLat will generate a minimum leadin of 3.5 character times and minimum leadout of 3.5 character times.

On receive the SPLat ModBus RTU driver users an intelligent parser that can determine when a complete message is received, without relying on a silence gap to delineate the end of a message. It is only if a message is unrecognizable that it needs to use a time limit to decide to flush out the receive buffer and start again. That time limit is the message gap.

The message gap is given in units of 10mS. If it is set to zero the SPLat will use approximately (but not less than) 3.5 character times. For non-zero values the SPLat will use the specified interval to delineate messages.

The message gap only gets invoked if a message is corrupted. That means that setting it fairly long will not slow down communications in a communications channel with a low error rate. It is best however that the Message Gap in a slave be shorter than the master's query timeout. If for some reason the master and the slave(s) get out of synchronization, the best chance for them to get back into sync is for the master to keep quiet for at least the Message Gap, so the slave(s) can get a fresh start.

If you are using ModBus RTU over a simple point to point cable hook-up, there is no problem and you can set this value to zero.

Applies to the following protocols: ModBus RTU master, ModBus RTU slave.

See also: Query timeout