From 41d426ce3d95e58c74e349131abeb172918ba513 Mon Sep 17 00:00:00 2001 From: Alex Lisitsyn Date: Mon, 19 Aug 2024 16:36:51 +0800 Subject: [PATCH] modbus fix read input regs max number --- freemodbus/modbus/functions/mbfuncinput.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freemodbus/modbus/functions/mbfuncinput.c b/freemodbus/modbus/functions/mbfuncinput.c index 2880bd9..a86a2f3 100644 --- a/freemodbus/modbus/functions/mbfuncinput.c +++ b/freemodbus/modbus/functions/mbfuncinput.c @@ -87,7 +87,7 @@ eMBFuncReadInputRegister( UCHAR * pucFrame, USHORT * usLen ) * return Modbus illegal data value exception. */ if( ( usRegCount >= 1 ) - && ( usRegCount < MB_PDU_FUNC_READ_REGCNT_MAX ) ) + && ( usRegCount <= MB_PDU_FUNC_READ_REGCNT_MAX ) ) { /* Set the current PDU data pointer to the beginning. */ pucFrameCur = &pucFrame[MB_PDU_FUNC_OFF];