A long time ago I found a group of people in forums.adafruit already had an advance and example have been implemented and improvements suggested by ibbba for the contribution.
The programming code for ESP8266 in this case was implemented in Arduino IDE versions 1.6.4 above. These 2 tutorials indicate connection and basic programming ESP8266 01 and 03 modules.
ESP8266 - 01 Modbus Slave TCP IP (Ethernet) for Industrial Applications
In previous tests with the library Original ModbusTCPSlave, it had two drawbacks of application:
properly functioning communication modbus tcp, but do not run the code in the routine void loop, as a temporary solution the library for ESP8266 amending stop the connection and reconnect again, the problem with this method is time reconnection can make the teacher while accepting the data indicate error in data reception.
Originally ESP8266 the serial port was used as a debug port in hexadecimal, I have made changes to the library so that Serial can be used freely.
VIDEO Update ESP8266 Industrial Modbus TCP IP V2.0
Mb. = Holding Registers 2
Mb. send a (,) value to the Modbus Master and validate the upgrade value.
modbus routine Mb.(); is executed; and execute the Ticker Parada.(,valor); every 25ms doing the value created in the function.
Taking this example as a basis, they could perform management functions for I / O similar and digital, load and others, taking only into account not implement any delay.
Arduino Mega 2560 Oled Display I2C Master Modbus RTU Scada Industrial Connection
Arduino + ESP8266 + Software Opto22 example Scada Industrial