Commit 26d5e356 authored by Pavel Vainerman's avatar Pavel Vainerman

(ModbusMaster): исправление "ошибки" с нестабильностью связи и периодическим

возникновением timeout (thank`s ilap@etersoft.ru)
parent 1f2ce030
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
Name: libuniset Name: libuniset
Version: 1.8 Version: 1.8
Release: alt5 Release: alt6
Summary: UniSet - library for building distributed industrial control systems Summary: UniSet - library for building distributed industrial control systems
License: GPL License: GPL
...@@ -339,6 +339,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname ...@@ -339,6 +339,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
%changelog %changelog
* Wed May 13 2015 Pavel Vainerman <pv@altlinux.ru> 1.8-alt6
- ModbusMaster: fixed bug: unstable timeout...( thank`s ilyap@etersoft.ru)
* Thu Mar 19 2015 Pavel Vainerman <pv@altlinux.ru> 1.8-alt5 * Thu Mar 19 2015 Pavel Vainerman <pv@altlinux.ru> 1.8-alt5
- unetudp: fxied critial bug in "switching channels" (thank`s Alexey Surov) - unetudp: fxied critial bug in "switching channels" (thank`s Alexey Surov)
......
...@@ -197,9 +197,17 @@ mbErrCode ModbusTCPMaster::query( ModbusAddr addr, ModbusMessage& msg, ...@@ -197,9 +197,17 @@ mbErrCode ModbusTCPMaster::query( ModbusAddr addr, ModbusMessage& msg,
} }
// //
// timeout = ptTimeout.getLeft(timeout); timeout = ptTimeout.getLeft(timeout);
// в tcp ответе задержек уже не должно быть.. if( timeout <=0 )
mbErrCode res = recv(addr,msg.func,reply,1); //timeout); {
if( dlog.debugging(Debug::WARN) )
dlog[Debug::WARN] << "(ModbusTCPMaster::query): processing reply timeout.." << endl;
return erTimeOut; // return erHardwareError;
}
mbErrCode res = recv(addr, msg.func, reply, timeout);
if( force_disconnect ) if( force_disconnect )
{ {
......
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