Browse Source

New definitions for MAX_STATUS and MAX_REGISTERS

Improve the conformance to the Modbus protocol.
MAX_STATUS: 800 -> 2000
MAX_REGISTERS: 100 -> 125
Stéphane Raimbault 16 years ago
parent
commit
535e696f23
1 changed files with 9 additions and 2 deletions
  1. 9 2
      src/modbus.h

+ 9 - 2
src/modbus.h

@@ -55,8 +55,15 @@ extern "C" {
  */
  */
 #define MAX_MESSAGE_LENGTH     256
 #define MAX_MESSAGE_LENGTH     256
 
 
-#define MAX_STATUS             800
-#define MAX_REGISTERS          100
+/* Modbus_Application_Protocol_V1_1b.pdf (chapter 6 section 1 page 12)
+ * Quantity of Coils (2 bytes): 1 to 2000 (0x7D0)
+ */
+#define MAX_STATUS            2000
+
+/* Modbus_Application_Protocol_V1_1b.pdf (chapter 6 section 3 page 15)
+ * Quantity of Registers (2 bytes): 1 to 125 (0x7D)
+ */
+#define MAX_REGISTERS          125
 
 
 #define REPORT_SLAVE_ID_LENGTH 75
 #define REPORT_SLAVE_ID_LENGTH 75