CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

[OT] End of packet detection in MODBUS RTU mode

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

[OT] End of packet detection in MODBUS RTU mode
PostPosted: Mon Jan 15, 2007 2:09 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jan 15, 2007 12:38 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group