modbusSMA is a smal and easy to use library for accessing the modbus interface of SMA inverters.The following code shows a basic example:
#include <modbusSMA/ModbusAPI.hpp>
#include <vector>
int main() {
auto reg = mapi.getRegisters();
vector<uint16_t> toFetch = {30051, 30053, 30529, 30535, 30538};
err = mapi.updateRegisters(toFetch);
vector<Register> registersWithValues = reg->getRegisters(toFetch);
return 0;
}
- See also
- ModbusAPI for more information