View previous topic :: View next topic |
Author |
Message |
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
OT - Modbus Quick Question - SOLVED |
Posted: Fri May 25, 2018 10:27 am |
|
|
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
|
|
Posted: Fri May 25, 2018 11:20 am |
|
|
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
|
|
Posted: Fri May 25, 2018 11:42 am |
|
|
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: 125 Location: Bombay, India
|
|
Posted: Fri May 25, 2018 9:30 pm |
|
|
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. |
|
|
|