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 support@ccsinfo.com

OT - Modbus Quick Question - SOLVED

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



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

OT - Modbus Quick Question - SOLVED
PostPosted: Fri May 25, 2018 10:27 am     Reply with quote

Hi,

Sorry for being OT but i can't seem to find the answer to this on the forum or google.

Regarding the modbus RTU Start and Stop Condition of 28bit (3.5 chars):

Do i actually need to send 28 blank bits, or just wait at least 3.5 chars long with the lines idle?

I can't seem to grasp this concept... is it a mere pause between messages or what?

Thanks.
_________________
CCS PCM 5.078 & CCS PCH 5.093


Last edited by Gabriel on Fri May 25, 2018 11:53 am; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri May 25, 2018 11:20 am     Reply with quote

Look at this CCS driver file:
Quote:
modbus_phy_layer_rtu.c

Then look at this routine:
Quote:
void modbus_serial_send_stop()

It has this line:
Quote:
delay_us(3500000/MODBUS_SERIAL_BAUD); //3.5 character delay

It's not sending anything. It's doing a delay.


Gabriel wrote:
Do i actually need to send 28 blank bits,

Look at this page:
https://www.automation.com/library/articles-white-papers/fieldbus-serial-bus-io-networks/introduction-to-modbus
It says:
Quote:
Character-Time: the time it takes to transmit one character at the chosen
baud rate. In RTU mode, there are 11 bits per character and this
would be 11 bit-times. For example, at 9600 baud, 1 character-time is 11
bit times or 11bits/char* 1/9600bits/sec = 1146us/char.

So it's 3.5 * 11 = 38.5 bits
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Fri May 25, 2018 11:42 am     Reply with quote

Thank you for clearing that up.
So its just a delay... sigh.
I hate to admit how long this has confused me.

I always implemented Modbus ASCII because of it.

Thanks.
_________________
CCS PCM 5.078 & CCS PCH 5.093
Jerson



Joined: 31 Jul 2009
Posts: 122
Location: Bombay, India

View user's profile Send private message Visit poster's website

PostPosted: Fri May 25, 2018 9:30 pm     Reply with quote

It is just enough time for the receiver to recognize that a packet has ended and for the transceiver to switch back to receive mode.
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