Free Modbus Source Code
If the answer to any of the above is yes, then this Modbus RTU source code is a good place to start. Obtain the source code by clicking on the link to the right. This code is written for a PIC18f2431 chip, but it can easily be adapted for other CPUs. The steps required to have a functioning Modbus RTU server device are:
What is this code good for?Modbus is by far the most popular industrial automation protocol in use today. It is relatively easy to implement. Any engineer considering what protocol to support for a new industrial control product cannot go wrong by implementing Modbus RTU in the default base product. Of course, there are good alternative protocols such as EtherNet/IP (for process automation), BACnet MSTP and BACnet/IP (for building automation), but these protocols are much harder to implement and support, and also tend to be based on Ethernet rather than RS-232 or RS-485. If you are interested in our products or learning more about solutions for these other protocols, please visit out webpage showing protocols solutions by clicking here. Why does FieldServer Technologies provide this free Modbus RTU source code?There are already numerous places to obtain free Modbus RTU source code. The protocol specification is in the public domain (PAS at www.modbus-ida.com ) and we at FieldServer Technologies cannot add much value to the protocol itself. However, our ProtoCessor family of protocol coprocessors has an option to support Modbus RTU as the Host Protocol to act as the link between the ProtoCessor and the Host CPU. It follows that some of our customers need the Modbus RTU source code in order to implement Modbus RTU on their system. In such cases, we would rather that they implement our tested and supported Modbus RTU source code which we are familiar with, than some other third party's code. What tools are available for testing?A Modbus RTU Simulator is available that will run on a Windows PC and act as a Modbus RTU client (master). Full instructions are provided with the download. Please contact www.chipkin/com/a/products/modbus/ for more information What Modbus RTU data objects are supported?As coded, this Modbus RTU server will provide data in four Modbus memory map groups or data types. Each data type will provide 20 points or values. The number of points can be changed easily by modifying the source code, but the data types are set in the Modbus protocol specification. The Modbus RTU Memory MapAs defined, this Modbus RTU standard provides data in four Modbus memory map groups or data types.
Do you support Modbus TCP?Our family of ProtoCessors will enable your device to support Modbus/TCP. The ProtoCessor also provides the required Ethernet interface necessary for Modbus/TCP support. In addition, once the “ProtoCessor socket” has been added to your design, there are other ProtoCessor modules that will support many other protocols. This will immediately increase the market for your product, and we highly recommend that you investigate this approach. For a full list of ProtoCessor supported protocols, click here. What technical support is provided?We do provide support, but only via a developer's forums on Yahoo and Google. Feel welcome to join, browse or post questions. One of our developers will get back to you, usually within an hour. Click below to join the Modbus Developers group. |
Download: |


