modbus-arduino  1.0.0
Modbus library for Arduino
ModbusIP.h
1 /*
2  ModbusIP.h - Header for Modbus IP Library
3  Copyright (C) 2015 AndrĂ© Sarmento Barbosa
4 */
5 #include <Arduino.h>
6 #include <Modbus.h>
7 #include <SPI.h>
8 #include <Ethernet.h>
9 
10 #ifndef MODBUSIP_H
11 #define MODBUSIP_H
12 
13 #define MODBUSIP_PORT 502
14 #define MODBUSIP_MAXFRAME 200
15 
16 //#define TCP_KEEP_ALIVE
17 
22 class ModbusIP : public Modbus {
23 #ifndef __DOXYGEN__
24  private:
25  EthernetServer _server;
26  byte _MBAP[7];
27 #endif
28  public:
32  ModbusIP();
40  void config(uint8_t *mac);
49  void config(uint8_t *mac, IPAddress ip);
60  void config(uint8_t *mac, IPAddress ip, IPAddress dns);
73  void config(uint8_t *mac, IPAddress ip, IPAddress dns, IPAddress gateway);
87  void config(uint8_t *mac, IPAddress ip, IPAddress dns, IPAddress gateway, IPAddress subnet);
93  void task();
94 };
95 
96 #endif //MODBUSIP_H
97 
Modbus over TCP/IP network Class for Arduino Ethernet shield.
Definition: ModbusIP.h:22
ModbusIP()
Default constructor.
void config(uint8_t *mac)
Connect a ModbusIP object to a network.
void task()
Task that performs all operations on MODBUS.
Modbus base class.
Definition: Modbus.h:53