emelianov / modbus-esp8266

Most complete Modbus library for Arduino. A library that allows your Arduino board to communicate via Modbus protocol, acting as a master, slave or both. Supports network transport (Modbus TCP) and Serial line/RS-485 (Modbus RTU). Supports Modbus TCP Security for ESP8266/ESP32.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ModbusTCP Server -> Write local register

challo2018 opened this issue · comments

I'm trying to setup Modbus TCP Server on WT32-ETH01. This ESP Reads values from 1-Wire Bus and should put them to an register.
I want to have a register which contains this data:

#include <ETH.h>
#include <ModbusIP_ESP8266.h>

Setup:
mb.server();
mb.addHreg(100, 0xABCD);

Loop:
mb.task();
if(newValues)
{
     Hreg(100, <newValue>);
}

Following error is shown:
"Compilation error: 'Hreg' was not declared in this scope"

Any Idea what is wrong with my code?

sorry i found syntax issue.
it is mb.Hreg(100, );