Commit 86bdc3e4 authored by Pavel Vainerman's avatar Pavel Vainerman

(MBMaster): исправление ошибки "периодическое пропадание связи"

parent a4ae6319
...@@ -3040,7 +3040,7 @@ bool MBExchange::poll() ...@@ -3040,7 +3040,7 @@ bool MBExchange::poll()
if( stat_time > 0 && ptStatistic.checkTime() ) if( stat_time > 0 && ptStatistic.checkTime() )
{ {
cout << endl << "(poll statistic): number of calls is " << poll_count << " (poll time: " << stat_time << " sec)" << endl << endl; dlog9 << endl << "(poll statistic): number of calls is " << poll_count << " (poll time: " << stat_time << " sec)" << endl << endl;
ptStatistic.reset(); ptStatistic.reset();
poll_count = 0; poll_count = 0;
} }
...@@ -3091,7 +3091,7 @@ bool MBExchange::RTUDevice::checkRespond() ...@@ -3091,7 +3091,7 @@ bool MBExchange::RTUDevice::checkRespond()
return (prev != resp_state); return (prev != resp_state);
} }
if( resp_trTimeout.hi(resp_state && !resp_real) ) if( resp_trTimeout.hi(resp_state && !resp_real) || resp_real )
resp_ptTimeout.reset(); resp_ptTimeout.reset();
if( resp_real ) if( resp_real )
...@@ -3125,7 +3125,7 @@ void MBExchange::updateRespondSensors() ...@@ -3125,7 +3125,7 @@ void MBExchange::updateRespondSensors()
RTUDevice* d(it1->second); RTUDevice* d(it1->second);
if( chanTimeout ) if( chanTimeout )
it1->second->resp_real = false; d->resp_real = false;
dlog4 << myname << ": check respond addr=" << ModbusRTU::addr2str(d->mbaddr) dlog4 << myname << ": check respond addr=" << ModbusRTU::addr2str(d->mbaddr)
<< " respond_id=" << d->resp_id << " respond_id=" << d->resp_id
......
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