Commit 0630856a authored by Pavel Vainerman's avatar Pavel Vainerman

add new fuction to MBSlave

parent cd99adbe
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Name: libuniset Name: libuniset
Version: 0.96 Version: 0.96
Release: eter34 Release: eter35
Summary: UniSet - library for building distributed industrial control systems Summary: UniSet - library for building distributed industrial control systems
......
...@@ -282,7 +282,7 @@ void MBSlave::execute_rtu() ...@@ -282,7 +282,7 @@ void MBSlave::execute_rtu()
{ {
// //
askCount = askCount>=numeric_limits<long>::max() ? 0 : askCount+1; askCount = askCount>=numeric_limits<long>::max() ? 0 : askCount+1;
if( res!=ModbusRTU::erNoError ) if( res!=ModbusRTU::erNoError )
errmap[res]++; errmap[res]++;
prev = res; prev = res;
...@@ -333,7 +333,7 @@ void MBSlave::execute_tcp() ...@@ -333,7 +333,7 @@ void MBSlave::execute_tcp()
{ {
// //
askCount = askCount>=numeric_limits<long>::max() ? 0 : askCount+1; askCount = askCount>=numeric_limits<long>::max() ? 0 : askCount+1;
if( res!=ModbusRTU::erNoError ) if( res!=ModbusRTU::erNoError )
errmap[res]++; errmap[res]++;
prev = res; prev = res;
......
...@@ -56,6 +56,8 @@ class MBSlave: ...@@ -56,6 +56,8 @@ class MBSlave:
friend std::ostream& operator<<( std::ostream& os, IOProperty& p ); friend std::ostream& operator<<( std::ostream& os, IOProperty& p );
}; };
inline long getAskCount(){ return askCount; }
protected: protected:
/*! 0x01 */ /*! 0x01 */
...@@ -165,7 +167,7 @@ class MBSlave: ...@@ -165,7 +167,7 @@ class MBSlave:
ModbusRTU::mbErrCode prev; ModbusRTU::mbErrCode prev;
long askCount; long askCount;
typedef std::map<ModbusRTU::mbErrCode,unsigned int> ExchangeErrorMap; typedef std::map<ModbusRTU::mbErrCode,unsigned int> ExchangeErrorMap;
ExchangeErrorMap errmap; /*!< */ ExchangeErrorMap errmap; /*!< */
bool activated; bool activated;
int activateTimeout; int activateTimeout;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment