This Arduino library allows you to implement the Modbus RTU protocol on any Arduino-supported microcontroller board. It supports both client and server modes. The library depends on the CSE_ArduinoRS485 library from CIRCUTISTATE. You can use both hardware and software serial ports for communication.
This library is in pre-release stage and any feedback is welcome. Library API documentation can be found in API.md.
Two examples are included with this library:
-
ModbusRTU_Client_LED - Acts as a Modbus RTU Client and sends periodic requests to a Modbus RTU Server to control an LED via Coil data.
-
ModbusRTU_Server_LED - Acts as a Modbus RTU Server and responds to requests from a Modbus RTU Client to control an LED using Coil data.