0
\$\begingroup\$

I have implemented Modbus RTU server in PIC12F1840. My problem is I have not implemented detection of start of message in the server device. Any guidance on how to implement it?

\$\endgroup\$
4
  • 1
    \$\begingroup\$ It may be useful to you that Realterm can generate Modbus CRC's. Might help you with testing. \$\endgroup\$
    – Henry Crun
    Commented May 2, 2018 at 7:10
  • \$\begingroup\$ How come Realterm can be useful to me ? \$\endgroup\$ Commented May 5, 2018 at 4:54
  • \$\begingroup\$ It can send you test packets and generate the CRC. It can display the (binary) that you are sending \$\endgroup\$
    – Henry Crun
    Commented May 5, 2018 at 4:55
  • \$\begingroup\$ Actually i have that kind of software that shows the packets being sent and received over the serial line. Well now i am getting the clear idea of detecting the RTU frame start and end. I am thinking for 3.5 and 1.5 char delay detection. The problem that arises is how to calculate 3.5 char delay interms of milli seconds or micro seconds. My standard communication parameters are 9600 baud, 8 Data bits, 1 stop bit and none partiy. \$\endgroup\$ Commented May 5, 2018 at 4:58

1 Answer 1

2
\$\begingroup\$

According to Modbus protocol, there should be silent intervals of at least 3.5 character times. Character times can be calculated based on the baudrate of serial port.

http://modbus.org/docs/Modbus_over_serial_line_V1_02.pdf

\$\endgroup\$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.