Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
[OT] End of packet detection in MODBUS RTU mode
Posted: Mon Jan 15, 2007 2:09 am
Folks,
Sorry for the off-topic question. MODBUS has an RTU mode, which is binary. Here’s an excerpt (from here) describing the detection of the end of the packet and the beginning of the new one:
Quote:
Each message must be preceded by a time gap with a minimum length of 3.5 characters. If a receiver detects a gap of at least 1.5 characters, it assumes that a new message is coming and the receive buffer is cleared.
Why there are 2 different wait periods (1.5 characters and 3.5 characters)? What’s the rationale?
Cheers,
Nick
Last edited by kender on Mon Jan 15, 2007 10:35 pm; edited 1 time in total
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
Posted: Mon Jan 15, 2007 12:38 pm
After 1.5 byte periods a packet may be assumed to be complete and may be processed. Then 2 byte periods later a reply may begin. The 2 byte periods can be used to compose a reply message. On a RS485 connection this is often just enough time for transmit enable holding circuit on a MAX485 to switch back to receive enable. On some hardware extra time must be allowed to allow the holding circuit to release so that data may be sent in the other direction.
The implication is that hardware that can turn around in 2 to 3 byte periods will be compatible with MODBUS because no device meeting the spec will reply faster than 3.5 byte periods. In fact a lot of MODBUS slave devices allow the addition of more reply delay to work on hardware that can not turn around fast enough.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum