Hello everyone!
I’m developing an edge gateway with Zig for agri-voltaic plants and I needed a Modbus implementation.
Instead of using libmodbus, I decided to implement the protocol from scratch given that is a pretty simple protocol.
The library implements both TCP and Serial (only RTU, not ASCII yet) transports and all the basic function codes that Modbus provides, but I would like to support also CANopen, serial diagnostics and custom function codes.
Developing this from scratch has been really fun and I can’t wait to test this in a real world scenario!
If you’re an Zig and/or Modbus expert, feel free to critique my work - I’m always open to learn how to write better code ![]()
Here’s the link to the repo (it’s a monorepo for a bigger project):
https://codeberg.org/intales/giacomo/src/branch/main/modbuz