- Contoh program Modbus TCP Slave
#include <SPI.h>
#include <Ethernet.h>
#include <ModbusIP.h>
IPAddress ip(192,168,1,177);
ModbusIP mb;
void setup()
{
Ethernet.begin(mac, ip);
Serial.begin(9600);
mb.server();
mb.addCoil(0, true);
mb.addHreg(0, 1234);
}
void loop()
{
mb.task();
}