Commit be3c2b3c authored by Pavel Vainerman's avatar Pavel Vainerman

Fixed bug: http://bugs.etersoft.ru/show_bug.cgi?id=6036

(не выставлялись датчики связи)
parent 6349baca
#!/bin/sh
uniset-start.sh -f ./uniset-smonit --name TestProc --confile test.xml --unideb-add-levels system,info,level9
uniset-start.sh -f ./uniset-smonit --name TestProc --confile test.xml --unideb-add-levels system,info,level9 $*
......@@ -62,7 +62,11 @@
<MBMaster1 name="MBMaster1" iaddr="127.0.0.1" addr="0x31" port="30000"
levels="info,warn,crit" poll_time="200" reply_timeout="60"
/>
>
<DeviceList>
<item addr="0x02" respondSensor="RespondRTU_S" timeout="5000" invert="0"/>
</DeviceList>
</MBMaster1>
<MBSlave1 name="MBSlave1" dev="/dev/ttyS0" addr="0x31" speed="9600"
aftersend-pause="0" levels="info,warn,crit" poll_time="200" reply_timeout="60"
......@@ -84,7 +88,7 @@
<RTUExchange name="RTUExchange" speed="38400">
<DeviceList>
<item addr="0x02" force_disconnect="1" speed="9600" respondSensor="RespondRTU_S" timeout="5000" invert="0"/>
<item addr="0x01" speed="9600" respondSensor="RespondRTU_S" timeout="5000" invert="0"/>
</DeviceList>
</RTUExchange>
......
......@@ -542,7 +542,7 @@ bool MBTCPMaster::pollRTU( RTUDevice* dev, RegMap::iterator& it )
bool MBTCPMaster::RTUDevice::checkRespond()
{
bool prev = resp_state;
if( resp_trTimeout.change(resp_real) )
if( resp_trTimeout.hi(resp_real) )
{
if( resp_real )
resp_state = true;
......@@ -557,7 +557,9 @@ bool MBTCPMaster::RTUDevice::checkRespond()
// то возвращаем true, чтобы оно принудительно сохранилось
if( !resp_init )
{
resp_state = resp_real;
resp_init = true;
prev = resp_state;
return true;
}
......
......@@ -9,6 +9,7 @@ uniset-start.sh -f ./uniset-mbtcpmaster \
--mbtcp-filter-value 1 \
--mbtcp-gateway-iaddr 127.0.0.1 \
--mbtcp-gateway-port 2048 \
--mbtcp-recv-timeout 5000
--mbtcp-recv-timeout 5000 \
--mbtcp-force-disconnect 1
#--mbtcp-filter-field mbtcp --mbtcp-filter-value 1
......@@ -564,7 +564,7 @@ bool RTUExchange::pollRTU( RTUDevice* dev, RegMap::iterator& it )
bool RTUExchange::RTUDevice::checkRespond()
{
bool prev = resp_state;
if( resp_trTimeout.change(resp_real) )
if( resp_trTimeout.hi(resp_real) )
{
if( resp_real )
resp_state = true;
......@@ -579,7 +579,9 @@ bool RTUExchange::RTUDevice::checkRespond()
// то возвращаем true, чтобы оно принудительно сохранилось
if( !resp_init )
{
resp_state = resp_real;
resp_init = true;
prev = resp_state;
return true;
}
......
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