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
b6ebbdcc
Commit
b6ebbdcc
authored
Mar 24, 2011
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Исправил ошибку в MBSlave проявлявщуюся в режиме force=0 для значений занимающих…
Исправил ошибку в MBSlave проявлявщуюся в режиме force=0 для значений занимающих больше одного регистра.
parent
784c7725
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
libuniset.spec
conf/libuniset.spec
+4
-1
MBSlave.cc
extensions/ModbusSlave/MBSlave.cc
+31
-2
No files found.
conf/libuniset.spec
View file @
b6ebbdcc
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
Name: libuniset
Name: libuniset
Version: 1.0
Version: 1.0
Release: alt1
3
Release: alt1
4
Summary: UniSet - library for building distributed industrial control systems
Summary: UniSet - library for building distributed industrial control systems
License: GPL
License: GPL
Group: Development/C++
Group: Development/C++
...
@@ -191,6 +191,9 @@ rm -f %buildroot%_libdir/*.la
...
@@ -191,6 +191,9 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
%changelog
* Thu Mar 24 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt14
- fixed bug in MBSlave
* Thu Mar 24 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt13
* Thu Mar 24 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt13
- rename some utilities (mtr-xxx --> uniset-mtr-xxx, vtconv --> uniset-vtconv)
- rename some utilities (mtr-xxx --> uniset-mtr-xxx, vtconv --> uniset-vtconv)
...
...
extensions/ModbusSlave/MBSlave.cc
View file @
b6ebbdcc
...
@@ -608,6 +608,30 @@ void MBSlave::sensorInfo( UniSetTypes::SensorMessage* sm )
...
@@ -608,6 +608,30 @@ void MBSlave::sensorInfo( UniSetTypes::SensorMessage* sm )
uniset_spin_lock
lock
(
p
->
val_lock
);
uniset_spin_lock
lock
(
p
->
val_lock
);
p
->
value
=
sm
->
value
;
p
->
value
=
sm
->
value
;
}
}
int
sz
=
VTypes
::
wsize
(
p
->
vtype
);
if
(
sz
<
1
)
break
;
// если размер больше одного слова
// то надо обновить значение "везде"
// они если "всё верно инициализировано" идут подряд
int
i
=
0
;
for
(
;
i
<
sz
&&
it
!=
iomap
.
end
();
i
++
,
it
++
)
{
p
=
&
it
->
second
;
if
(
p
->
si
.
id
==
sm
->
id
)
p
->
value
=
sm
->
value
;
}
if
(
dlog
.
debugging
(
Debug
::
CRIT
)
)
{
// вообще этого не может случиться
// потому-что корректность проверяется при загрузке
if
(
i
!=
sz
)
dlog
[
Debug
::
CRIT
]
<<
myname
<<
"(sensorInfo): update failed for sid="
<<
sm
->
id
<<
" (i="
<<
i
<<
" sz="
<<
sz
<<
")"
<<
endl
;
}
break
;
break
;
}
}
}
}
...
@@ -906,7 +930,12 @@ ModbusRTU::mbErrCode MBSlave::writeOutputSingleRegister( ModbusRTU::WriteSingleO
...
@@ -906,7 +930,12 @@ ModbusRTU::mbErrCode MBSlave::writeOutputSingleRegister( ModbusRTU::WriteSingleO
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
ModbusRTU
::
mbErrCode
MBSlave
::
much_real_write
(
ModbusRTU
::
ModbusData
reg
,
ModbusRTU
::
ModbusData
*
dat
,
ModbusRTU
::
mbErrCode
MBSlave
::
much_real_write
(
ModbusRTU
::
ModbusData
reg
,
ModbusRTU
::
ModbusData
*
dat
,
int
count
)
int
count
)
{
{
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
{
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(much_real_write): read mbID="
<<
ModbusRTU
::
dat2str
(
reg
)
<<
" count="
<<
count
<<
endl
;
}
int
i
=
0
;
int
i
=
0
;
IOMap
::
iterator
it
=
iomap
.
end
();
IOMap
::
iterator
it
=
iomap
.
end
();
for
(
;
i
<
count
;
i
++
)
for
(
;
i
<
count
;
i
++
)
...
@@ -1070,7 +1099,7 @@ ModbusRTU::mbErrCode MBSlave::much_real_read( ModbusRTU::ModbusData reg, ModbusR
...
@@ -1070,7 +1099,7 @@ ModbusRTU::mbErrCode MBSlave::much_real_read( ModbusRTU::ModbusData reg, ModbusR
{
{
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
{
{
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(mu
sh_real_read): read mbID="
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(mu
ch_real_read): read mbID="
<<
ModbusRTU
::
dat2str
(
reg
)
<<
" count="
<<
count
<<
endl
;
<<
ModbusRTU
::
dat2str
(
reg
)
<<
" count="
<<
count
<<
endl
;
}
}
...
...
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