Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
2683f27f
Commit
2683f27f
authored
May 18, 2015
by
Pavel Vaynerman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.set:packages/uniset2
parents
a226366c
173e6cfc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
test.xml
conf/test.xml
+1
-1
MBSlave.cc
extensions/ModbusSlave/MBSlave.cc
+10
-2
No files found.
conf/test.xml
View file @
2683f27f
...
...
@@ -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=
"62"
iotype=
"AI"
name=
"LogLevel_S"
textname=
"LogLevel control"
/>
<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=
"65"
iotype=
"DI"
name=
"D65_S"
textname=
"D65"
threshold_aid=
"AI64_AS"
lowlimit=
"3"
hilimit=
"5"
threshold_invert=
"1"
rs=
"5"
/>
</sensors>
...
...
extensions/ModbusSlave/MBSlave.cc
View file @
2683f27f
...
...
@@ -902,6 +902,9 @@ bool MBSlave::initItem( UniXML::iterator& it )
int
mbfunc
=
IOBase
::
initIntProp
(
it
,
"mbfunc"
,
prop_prefix
,
false
,
default_mbfunc
);
if
(
!
checkMBFunc
)
mbfunc
=
default_mbfunc
;
p
.
regID
=
ModbusRTU
::
genRegID
(
p
.
mbreg
,
mbfunc
);
p
.
amode
=
MBSlave
::
amRW
;
...
...
@@ -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
::
RegID
regID
=
checkMBFunc
?
genRegID
(
reg
,
fn
)
:
genRegID
(
reg
,
default_mbfunc
);
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
);
return
real_read_it
(
it
,
val
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment