Skip to content

Small Modbus slave, RTU (serial) for Arduino

License

Notifications You must be signed in to change notification settings

stephane/modbusino

Repository files navigation

Modbusino

Introduction

Modbusino is a ISC licensed library to handle Modbus requests on Arduino (slave).

Features

To keep it simple and to reduce memory consumption, only the two following Modbus functions are supported:

  • read holding registers (0x03)
  • write multiple registers (0x10)

Example

#include<Modbusino.h>/* Initialize the slave with the ID 1 */ModbusinoSlavemodbusino_slave(1); /* Allocate a mapping of 10 values */uint16_ttab_reg[10]; voidsetup(){/* The transfer speed is set to 115200 bauds */modbusino_slave.setup(115200)} voidloop(){/* Initialize the first register to have a value to read */tab_reg[0] =0x1234; /* Launch Modbus slave loop with: - pointer to the mapping - max values of mapping */modbusino_slave.loop(tab_reg, 10)}

Contribute

I want to keep this library very basic and small so if you want to contribute:

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
  2. Fork the repository on Github to start making your changes on another branch.
  3. Send a pull request (of your small and atomic changes).
  4. Bug the maintainer if he's too busy to answer :)

About

Small Modbus slave, RTU (serial) for Arduino

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages