From 7eed16b188edbb803b90ae23e9bedb00b6357683 Mon Sep 17 00:00:00 2001 From: armink Date: Tue, 29 Jul 2014 13:33:11 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91F?= =?UTF-8?q?reeModbus=E4=B8=BB=E3=80=81=E4=BB=8E=E6=9C=BA=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=86=85=E5=AF=84=E5=AD=98=E5=99=A8=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E5=AE=9A=E4=B9=89=E5=8F=8A=E6=95=B0=E9=87=8F=E5=8F=AA?= =?UTF-8?q?=E6=9C=898=E4=BD=8D=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=94=B9=E4=B8=BA16=E4=BD=8D=E3=80=82?= =?UTF-8?q?=E6=84=9F=E8=B0=A2=E7=BD=91=E5=8F=8B=20@weiweijeff=20=E7=9A=84?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: armink --- FreeModbus/port/user_mb_app.c | 24 ++++++++++++------------ FreeModbus/port/user_mb_app_m.c | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/FreeModbus/port/user_mb_app.c b/FreeModbus/port/user_mb_app.c index 1f7dd0e..0fd00b7 100644 --- a/FreeModbus/port/user_mb_app.c +++ b/FreeModbus/port/user_mb_app.c @@ -56,9 +56,9 @@ eMBRegInputCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs ) eMBErrorCode eStatus = MB_ENOERR; USHORT iRegIndex; USHORT * pusRegInputBuf; - UCHAR REG_INPUT_START; - UCHAR REG_INPUT_NREGS; - UCHAR usRegInStart; + USHORT REG_INPUT_START; + USHORT REG_INPUT_NREGS; + USHORT usRegInStart; pusRegInputBuf = usSRegInBuf; REG_INPUT_START = S_REG_INPUT_START; @@ -103,9 +103,9 @@ eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegi eMBErrorCode eStatus = MB_ENOERR; USHORT iRegIndex; USHORT * pusRegHoldingBuf; - UCHAR REG_HOLDING_START; - UCHAR REG_HOLDING_NREGS; - UCHAR usRegHoldStart; + USHORT REG_HOLDING_START; + USHORT REG_HOLDING_NREGS; + USHORT usRegHoldStart; pusRegHoldingBuf = usSRegHoldBuf; REG_HOLDING_START = S_REG_HOLDING_START; @@ -167,9 +167,9 @@ eMBRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNCoils, eMBRegis eMBErrorCode eStatus = MB_ENOERR; USHORT iRegIndex , iRegBitIndex , iNReg; UCHAR * pucCoilBuf; - UCHAR COIL_START; - UCHAR COIL_NCOILS; - UCHAR usCoilStart; + USHORT COIL_START; + USHORT COIL_NCOILS; + USHORT usCoilStart; iNReg = usNCoils / 8 + 1; //占用寄存器数量 pucCoilBuf = ucSCoilBuf; @@ -237,9 +237,9 @@ eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNDiscrete ) eMBErrorCode eStatus = MB_ENOERR; USHORT iRegIndex , iRegBitIndex , iNReg; UCHAR * pucDiscreteInputBuf; - UCHAR DISCRETE_INPUT_START; - UCHAR DISCRETE_INPUT_NDISCRETES; - UCHAR usDiscreteInputStart; + USHORT DISCRETE_INPUT_START; + USHORT DISCRETE_INPUT_NDISCRETES; + USHORT usDiscreteInputStart; iNReg = usNDiscrete / 8 + 1; //占用寄存器数量 pucDiscreteInputBuf = ucSDiscInBuf; diff --git a/FreeModbus/port/user_mb_app_m.c b/FreeModbus/port/user_mb_app_m.c index 1559e3c..5f96d03 100644 --- a/FreeModbus/port/user_mb_app_m.c +++ b/FreeModbus/port/user_mb_app_m.c @@ -58,9 +58,9 @@ eMBMasterRegInputCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs ) eMBErrorCode eStatus = MB_ENOERR; USHORT iRegIndex; USHORT * pusRegInputBuf; - UCHAR REG_INPUT_START; - UCHAR REG_INPUT_NREGS; - UCHAR usRegInStart; + USHORT REG_INPUT_START; + USHORT REG_INPUT_NREGS; + USHORT usRegInStart; pusRegInputBuf = usMRegInBuf[ucMBMasterGetDestAddress() - 1]; REG_INPUT_START = M_REG_INPUT_START; @@ -105,9 +105,9 @@ eMBMasterRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, e eMBErrorCode eStatus = MB_ENOERR; USHORT iRegIndex; USHORT * pusRegHoldingBuf; - UCHAR REG_HOLDING_START; - UCHAR REG_HOLDING_NREGS; - UCHAR usRegHoldStart; + USHORT REG_HOLDING_START; + USHORT REG_HOLDING_NREGS; + USHORT usRegHoldStart; pusRegHoldingBuf = usMRegHoldBuf[ucMBMasterGetDestAddress() - 1]; REG_HOLDING_START = M_REG_HOLDING_START; @@ -171,9 +171,9 @@ eMBMasterRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNCoils, eM eMBErrorCode eStatus = MB_ENOERR; USHORT iRegIndex , iRegBitIndex , iNReg; UCHAR * pucCoilBuf; - UCHAR COIL_START; - UCHAR COIL_NCOILS; - UCHAR usCoilStart; + USHORT COIL_START; + USHORT COIL_NCOILS; + USHORT usCoilStart; iNReg = usNCoils / 8 + 1; //占用寄存器数量 pucCoilBuf = ucMCoilBuf[ucMBMasterGetDestAddress() - 1]; @@ -243,9 +243,9 @@ eMBMasterRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNDiscre eMBErrorCode eStatus = MB_ENOERR; USHORT iRegIndex , iRegBitIndex , iNReg; UCHAR * pucDiscreteInputBuf; - UCHAR DISCRETE_INPUT_START; - UCHAR DISCRETE_INPUT_NDISCRETES; - UCHAR usDiscreteInputStart; + USHORT DISCRETE_INPUT_START; + USHORT DISCRETE_INPUT_NDISCRETES; + USHORT usDiscreteInputStart; iNReg = usNDiscrete / 8 + 1; //占用寄存器数量 pucDiscreteInputBuf = ucMDiscInBuf[ucMBMasterGetDestAddress() - 1];