Skip to content

Arduino library for implementing Modbus RTU communication protocols using hardware/software serial ports.

License

Notifications You must be signed in to change notification settings

CIRCUITSTATE/CSE_ModbusRTU

Repository files navigation

CSE_ModbusRTU

CSE_ModbusRTU

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 CIRCUITSTATE Electronics. You can use both hardware and software serial ports for communication.

This library is in pre-release stage and any feedback is welcome.

Installation

This library is available from the official Arduino Library Manager. Open the Arduino IDE, search for CSE_ModbusRTU and install the latest version of the library.

Additionally, you can download the latest release package from the GitHub repository and install it manually. To do so, open the Arduino IDE, go to Sketch > Include Library > Add .ZIP Library…​ and select the downloaded file.

Another method is to clone the GitHub repository directly into your libraries folder. The development branch will have the latest features, bug fixes and other changes. To do so, navigate to your libraries folder (usually located at Documents/Arduino/libraries on Windows and ~/Documents/Arduino/libraries on macOS) and execute the following command:

git clone https://github.com/CIRCUITSTATE/CSE_ModbusRTU.git

The library can also be installed via PlatformIO. All officially listed Arduino listed libraries are automatically fetched by PlatformIO. Use the lib_deps search option to install the library.

Examples

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.

API Reference

You can find the complete API reference for this library at API.md.

About

Arduino library for implementing Modbus RTU communication protocols using hardware/software serial ports.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages