You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const byte reqQueueCount = 15; // max number of TCP or UDP requests stored in queue
62
-
constint reqQueueSize = 256; // total length of TCP or UDP requests stored in queue (in bytes)
63
-
const byte maxSlaves = 247; // max number of Modbus slaves (Modbus supports up to 247 slaves, the rest is for reserved addresses)
64
-
constint modbusSize = 256; // size of a MODBUS RTU frame (determines size of serialInBuffer and tcpInBuffer)
65
-
#definemySerial Serial // define serial port for RS485 interface, for Arduino Mega choose from Serial1, Serial2 or Serial3
66
-
#defineRS485_CONTROL_PIN6// Arduino Pin for RS485 Direction control, disable if you have module with hardware flow control
67
-
const byte ethResetPin = 7; // Ethernet shield reset pin (deals with power on reset issue of the ethernet shield)
61
+
const byte reqQueueCount = 10; // max number of TCP or UDP requests stored in a queue
62
+
constint reqQueueSize = 256; // total length of TCP or UDP requests stored in a queue (in bytes)
63
+
const byte maxSlaves = 247; // max number of Modbus slaves (Modbus supports up to 247 slaves, the rest is for reserved addresses)
64
+
constint modbusSize = 256; // size of a MODBUS RTU frame (determines size of serialInBuffer and tcpInBuffer)
65
+
#definemySerial Serial // define serial port for RS485 interface, for Arduino Mega choose from Serial1, Serial2 or Serial3
66
+
#defineRS485_CONTROL_PIN6// Arduino Pin for RS485 Direction control, disable if you have module with hardware flow control
67
+
const byte ethResetPin = 7; // Ethernet shield reset pin (deals with power on reset issue of the ethernet shield)
68
68
const byte scanCommand[] = { 0x03, 0x00, 0x00, 0x00, 0x01 }; // Command sent during Modbus RTU Scan. Slave is detected if any response (even error) is received.
69
69
70
70
// #define DEBUG // Main Serial (USB) is used for printing some debug info, not for Modbus RTU. At the moment, only web server related debug messages are printed.
@@ -107,10 +107,10 @@ typedef struct
107
107
const config_type defaultConfig = {
108
108
{}, // macEnd (last 3 bytes)
109
109
false, // enableDhcp
110
-
{192, 168, 1, 254}, // ip
111
-
{255, 255, 255, 0}, // subnet
112
-
{192, 168, 1, 1}, // gateway
113
-
{192, 168, 1, 1}, // dns
110
+
{192, 168, 1, 254 },// ip
111
+
{255, 255, 255, 0 },// subnet
112
+
{192, 168, 1, 1 },// gateway
113
+
{192, 168, 1, 1 },// dns
114
114
502, // tcpPort
115
115
502, // udpPort
116
116
80, // webPort
@@ -130,7 +130,7 @@ const byte configStart = 128;
130
130
#ifdef UDP_TX_PACKET_MAX_SIZE
131
131
#undef UDP_TX_PACKET_MAX_SIZE
132
132
#defineUDP_TX_PACKET_MAX_SIZE modbusSize
133
-
#endif
133
+
#endif
134
134
135
135
#ifdef MAX_SOCK_NUM // Ethernet.h library determines MAX_SOCK_NUM by Microcontroller RAM (not by Ethernet chip type).
136
136
#undef MAX_SOCK_NUM // Ignore the RAM-based limitation on the number of sockets.
0 commit comments