Commit 2683f27f authored by Pavel Vaynerman's avatar Pavel Vaynerman

Merge branch 'master' of git.set:packages/uniset2

parents a226366c 173e6cfc
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
<item id="58" iotype="AO" name="Lamp58_C" textname="Lamp 58" rrd="1" rrd1_ds="GAUGE:20:U:U"/> <item id="58" iotype="AO" name="Lamp58_C" textname="Lamp 58" rrd="1" rrd1_ds="GAUGE:20:U:U"/>
<item id="62" iotype="AI" name="LogLevel_S" textname="LogLevel control"/> <item id="62" iotype="AI" name="LogLevel_S" textname="LogLevel control"/>
<item id="63" iotype="AI" name="SVU_AskCount_AS" textname="svu asl count"/> <item id="63" iotype="AI" name="SVU_AskCount_AS" textname="svu asl count"/>
<item id="64" iotype="AI" name="AI64_AS" textname="AI64" mbaddr="0x01" mbfunc="0x03" mbreg="64" mbtype="rtu" rs="5"/> <item id="64" iotype="AI" name="AI64_AS" textname="AI64" mbaddr="0x01" mbfunc="0x03" mbreg="64" mbtype="rtu" rs="5" tcp="6"/>
<item id="66" iotype="DI" name="DI66_AS" textname="DI66" mbaddr="0x01" mbfunc="0x01" mbreg="66" mbtype="rtu" rs="5"/> <item id="66" iotype="DI" name="DI66_AS" textname="DI66" mbaddr="0x01" mbfunc="0x01" mbreg="66" mbtype="rtu" rs="5"/>
<item id="65" iotype="DI" name="D65_S" textname="D65" threshold_aid="AI64_AS" lowlimit="3" hilimit="5" threshold_invert="1" rs="5" /> <item id="65" iotype="DI" name="D65_S" textname="D65" threshold_aid="AI64_AS" lowlimit="3" hilimit="5" threshold_invert="1" rs="5" />
</sensors> </sensors>
......
...@@ -902,6 +902,9 @@ bool MBSlave::initItem( UniXML::iterator& it ) ...@@ -902,6 +902,9 @@ bool MBSlave::initItem( UniXML::iterator& it )
int mbfunc = IOBase::initIntProp(it, "mbfunc", prop_prefix, false, default_mbfunc); int mbfunc = IOBase::initIntProp(it, "mbfunc", prop_prefix, false, default_mbfunc);
if( !checkMBFunc )
mbfunc = default_mbfunc;
p.regID = ModbusRTU::genRegID(p.mbreg, mbfunc); p.regID = ModbusRTU::genRegID(p.mbreg, mbfunc);
p.amode = MBSlave::amRW; p.amode = MBSlave::amRW;
...@@ -1636,10 +1639,15 @@ ModbusRTU::mbErrCode MBSlave::much_real_read( const ModbusRTU::ModbusData reg, M ...@@ -1636,10 +1639,15 @@ ModbusRTU::mbErrCode MBSlave::much_real_read( const ModbusRTU::ModbusData reg, M
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
ModbusRTU::mbErrCode MBSlave::real_read( const ModbusRTU::ModbusData reg, ModbusRTU::ModbusData& val, const int fn ) ModbusRTU::mbErrCode MBSlave::real_read( const ModbusRTU::ModbusData reg, ModbusRTU::ModbusData& val, const int fn )
{ {
ModbusRTU::RegID regID = checkMBFunc ? genRegID(reg, fn) : genRegID(reg, default_mbfunc);
dinfo << myname << "(real_read): read mbID=" dinfo << myname << "(real_read): read mbID="
<< ModbusRTU::dat2str(reg) << "(" << (int)reg << ")" << " fn=" << fn << endl; << ModbusRTU::dat2str(reg) << "(" << (int)reg << ")" << " fn=" << fn
<< " regID=" << regID
<< " default_mbfunc=" << default_mbfunc
<< " checkMBFunc=" << checkMBFunc
<< endl;
ModbusRTU::RegID regID = checkMBFunc ? genRegID(reg, fn) : genRegID(reg, default_mbfunc);
auto it = iomap.find(regID); auto it = iomap.find(regID);
return real_read_it(it, val); return real_read_it(it, val);
......
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