Page 1 of 1

Modbus RTU

Posted: Fri Jul 29, 2011 8:53 am
by Kirill
Hi folks,
I'm greatly proud that such cool software exists and has a lot of functionality. I would like to share my work of implementing Modbus Master Protocol. My implementation has only one function at the moment - Reading Input Registers, but I hope to continue development. And I think that I will continue implementation after listening your feedback. I spent a lot of time on CRC Calculation Algorithm, which is not a problem for Modbus TCP. So if you decide to develop your own Modbus, you can freely take my algorithm and make your own Components.

Re: Modbus RTU

Posted: Fri Jul 29, 2011 9:58 am
by Embedded
that's great Kirill !

Makes a nice complement to my Modbus TCP :)

Re: Modbus RTU

Posted: Fri Jul 29, 2011 10:07 am
by Kirill
That's true. Of course, these components consume some computer resources, especially when calculating CRC. Anyway Modbus very popular protocol and should be protocol #1 in such software packages.

Re: Modbus RTU

Posted: Thu Aug 04, 2011 12:00 pm
by Embedded
Following your comments on CRC CPU power, I had a quick look at your CRC code. Fundamentally it was ok but there were a couple of optimisations possible.

So here's a version with a new optimised CRC decoder:

Re: Modbus RTU

Posted: Mon Aug 08, 2011 8:48 am
by Kirill
Great, thanks a lot Embedded for your help! I will try to make another Modules with other Function Codes using optimised CRC.

Re: Modbus RTU

Posted: Mon Sep 12, 2011 9:38 pm
by fixstuff555
As a side note to your Modbus RTU testing...

I used this companies gateway chip http://www.hms.se/products/abic.shtml to interface to a Profibus network on a Siemens S7-300 PLC a couple years ago. The chip interface on the microprocessor side was Modbus RTU. So theoretically, using the Modbus RTU code, along with the $80 Anybus-IC, you could talk to almost any industrial network with Flowstone.

Why is this something you may want to do? There is a boatload of used industrial PLC hardware out there for sale that can be had CHEAP (ebay, etc). An interface method to underutilized PLC hardware may be useful to someone. I've also got some code written in Picbasic if anyone is interested that may be useful along this topic as well (with CRC calculations in the messaging)