From 8f88e24ea59de2eb534940f2c61fb51683658259 Mon Sep 17 00:00:00 2001 From: armink Date: Thu, 9 Jan 2014 22:17:15 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91F?= =?UTF-8?q?reeModbus=E4=B8=BB=E6=9C=BA=E7=BA=BF=E5=9C=88API=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: armink --- .cproject | 13 +++++--- .settings/org.eclipse.core.resources.prefs | 2 ++ FreeModbus/modbus/functions/mbfunccoils_m.c | 35 +++++++++++++++++++++ 3 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 .settings/org.eclipse.core.resources.prefs diff --git a/.cproject b/.cproject index bd00840..beed480 100644 --- a/.cproject +++ b/.cproject @@ -1,14 +1,12 @@ - - - + - + @@ -116,8 +114,8 @@ - + @@ -206,4 +204,9 @@ + + + + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..8a34f2c --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/README.md=UTF-8 diff --git a/FreeModbus/modbus/functions/mbfunccoils_m.c b/FreeModbus/modbus/functions/mbfunccoils_m.c index 0b7de5e..e8b05f8 100644 --- a/FreeModbus/modbus/functions/mbfunccoils_m.c +++ b/FreeModbus/modbus/functions/mbfunccoils_m.c @@ -74,6 +74,16 @@ eMBException prveMBError2Exception( eMBErrorCode eErrorCode ); #if MB_MASTER_RTU_ENABLED > 0 || MB_MASTER_ASCII_ENABLED > 0 #if MB_FUNC_READ_COILS_ENABLED > 0 +/** + * This function will request read coil. + * + * @param ucSndAddr salve address + * @param usCoilAddr coil start address + * @param usNCoils coil total number + * @param lTimeOut timeout (-1 will waiting forever) + * + * @return error code + */ eMBMasterReqErrCode eMBMasterReqReadCoils( UCHAR ucSndAddr, USHORT usCoilAddr, USHORT usNCoils ,LONG lTimeOut ) { @@ -161,6 +171,18 @@ eMBMasterFuncReadCoils( UCHAR * pucFrame, USHORT * usLen ) #if MB_FUNC_WRITE_COIL_ENABLED > 0 +/** + * This function will request write one coil. + * + * @param ucSndAddr salve address + * @param usCoilAddr coil start address + * @param usCoilData data to be written + * @param lTimeOut timeout (-1 will waiting forever) + * + * @return error code + * + * @see eMBMasterReqWriteMultipleCoils + */ eMBMasterReqErrCode eMBMasterReqWriteCoil( UCHAR ucSndAddr, USHORT usCoilAddr, USHORT usCoilData, LONG lTimeOut ) { @@ -240,6 +262,19 @@ eMBMasterFuncWriteCoil( UCHAR * pucFrame, USHORT * usLen ) #if MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED > 0 +/** + * This function will request write multiple coils. + * + * @param ucSndAddr salve address + * @param usCoilAddr coil start address + * @param usNCoils coil total number + * @param usCoilData data to be written + * @param lTimeOut timeout (-1 will waiting forever) + * + * @return error code + * + * @see eMBMasterReqWriteCoil + */ eMBMasterReqErrCode eMBMasterReqWriteMultipleCoils( UCHAR ucSndAddr, USHORT usCoilAddr, USHORT usNCoils, UCHAR * pucDataBuffer, LONG lTimeOut)