From b473707f3e7eb3cbaefbaeb05ff68a1d93de362a Mon Sep 17 00:00:00 2001 From: armink Date: Mon, 9 Nov 2015 18:55:59 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91F?= =?UTF-8?q?reeModbus=20V1.5=E4=BB=8E=E6=9C=BA=E6=BA=90=E7=A0=81=E4=B8=AD?= =?UTF-8?q?=E9=81=97=E7=95=99=E7=9A=84=E8=AF=BB=E4=BF=9D=E6=8C=81=E5=AF=84?= =?UTF-8?q?=E5=AD=98=E5=99=A8=E4=B8=80=E5=A4=84=E4=B9=A6=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: armink --- FreeModbus/modbus/functions/mbfuncholding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FreeModbus/modbus/functions/mbfuncholding.c b/FreeModbus/modbus/functions/mbfuncholding.c index e74a062..7921302 100644 --- a/FreeModbus/modbus/functions/mbfuncholding.c +++ b/FreeModbus/modbus/functions/mbfuncholding.c @@ -183,7 +183,7 @@ eMBFuncReadHoldingRegister( UCHAR * pucFrame, USHORT * usLen ) usRegAddress++; usRegCount = ( USHORT )( pucFrame[MB_PDU_FUNC_READ_REGCNT_OFF] << 8 ); - usRegCount = ( USHORT )( pucFrame[MB_PDU_FUNC_READ_REGCNT_OFF + 1] ); + usRegCount |= ( USHORT )( pucFrame[MB_PDU_FUNC_READ_REGCNT_OFF + 1] ); /* Check if the number of registers to read is valid. If not * return Modbus illegal data value exception.