Commit 535e696f23d7c0800f9bd4880879b34dfdf205ff
1 parent
51500e93
New definitions for MAX_STATUS and MAX_REGISTERS
Improve the conformance to the Modbus protocol. MAX_STATUS: 800 -> 2000 MAX_REGISTERS: 100 -> 125
Showing
1 changed file
with
9 additions
and
2 deletions
src/modbus.h
| ... | ... | @@ -55,8 +55,15 @@ extern "C" { |
| 55 | 55 | */ |
| 56 | 56 | #define MAX_MESSAGE_LENGTH 256 |
| 57 | 57 | |
| 58 | -#define MAX_STATUS 800 | |
| 59 | -#define MAX_REGISTERS 100 | |
| 58 | +/* Modbus_Application_Protocol_V1_1b.pdf (chapter 6 section 1 page 12) | |
| 59 | + * Quantity of Coils (2 bytes): 1 to 2000 (0x7D0) | |
| 60 | + */ | |
| 61 | +#define MAX_STATUS 2000 | |
| 62 | + | |
| 63 | +/* Modbus_Application_Protocol_V1_1b.pdf (chapter 6 section 3 page 15) | |
| 64 | + * Quantity of Registers (2 bytes): 1 to 125 (0x7D) | |
| 65 | + */ | |
| 66 | +#define MAX_REGISTERS 125 | |
| 60 | 67 | |
| 61 | 68 | #define REPORT_SLAVE_ID_LENGTH 75 |
| 62 | 69 | ... | ... |