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
8a72fbd2
Commit
8a72fbd2
authored
Jul 03, 2015
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ModbusMultiMaster): исправил ошибку в названиях настроек для respondSensor
(теперб называются одинаково для ModbusMaster и ModbusMultiMaster)
parent
6156e98e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
12 deletions
+30
-12
start_fg.sh
Utilities/SViewer-text/start_fg.sh
+1
-1
libuniset2.spec
conf/libuniset2.spec
+6
-2
test.xml
conf/test.xml
+5
-2
MBTCPMultiMaster.cc
extensions/ModbusMaster/MBTCPMultiMaster.cc
+7
-5
MBTCPMultiMaster.h
extensions/ModbusMaster/MBTCPMultiMaster.h
+1
-0
start_fg_mbtcpmulti.sh
extensions/ModbusMaster/start_fg_mbtcpmulti.sh
+1
-0
test_mbtcpmultimaster.cc
extensions/ModbusMaster/tests/test_mbtcpmultimaster.cc
+5
-0
SViewer.cc
src/Various/SViewer.cc
+4
-2
No files found.
Utilities/SViewer-text/start_fg.sh
View file @
8a72fbd2
#!/bin/sh
#while true; do
./uniset2-start.sh
-f
./uniset2-sviewer-text
--confile
test.xml
--ulog-add-levels
warn,crit
./uniset2-start.sh
-f
./uniset2-sviewer-text
--confile
test.xml
--ulog-add-levels
warn,crit
$*
#done
conf/libuniset2.spec
View file @
8a72fbd2
%def_enable docs
%def_enable mysql
%def_enable sqlite
%def_
dis
able pgsql
%def_
en
able pgsql
%def_enable python
%def_enable rrd
%def_enable io
...
...
@@ -13,7 +13,7 @@
Name: libuniset2
Version: 2.1
Release: alt
9
Release: alt
10
Summary: UniSet - library for building distributed industrial control systems
...
...
@@ -456,6 +456,10 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
# ..
%changelog
* Fri Jul 03 2015 Pavel Vainerman <pv@altlinux.ru> 2.1-alt10
- fixed bug in ModbusMultiMaster (setbug #7596)
- enable pgsql interface
* Tue Jun 30 2015 Pavel Vainerman <pv@altlinux.ru> 2.1-alt9
- temporary disable pgsql interface
...
...
conf/test.xml
View file @
8a72fbd2
...
...
@@ -83,8 +83,8 @@
<item
addr=
"0x01"
invert=
"0"
respondSensor=
"RespondRTU_S"
timeout=
"5000"
modeSensor=
"MB1_Mode_AS"
/>
</DeviceList>
<GateList>
<item
ip=
"127.0.0.1"
port=
"2048"
recv_timeout=
"200"
/>
<item
ip=
"127.0.0.1"
port=
"2049"
recv_timeout=
"200"
/>
<item
ip=
"127.0.0.1"
port=
"2048"
recv_timeout=
"200"
invert=
"1"
respondSensor=
"MM1_Not_Respond_S"
/>
<item
ip=
"127.0.0.1"
port=
"2049"
recv_timeout=
"200"
invert=
"1"
respondSensor=
"MM2_Not_Respond_S"
/>
</GateList>
</MBMultiMaster1>
...
...
@@ -269,6 +269,9 @@
<item
id=
"107"
iotype=
"AI"
name=
"AI107_AS"
textname=
"AI107"
default=
"1"
/>
<item
id=
"108"
iotype=
"AI"
name=
"AI108_AS"
textname=
"AI108"
ag=
"1"
ag_min=
"30"
ag_max=
"40"
ag_invert=
"1"
/>
<item
id=
"109"
iotype=
"DI"
name=
"MM1_Not_Respond_S"
priority=
"Medium"
textname=
"multimaster test sensor"
/>
<item
id=
"110"
iotype=
"DI"
name=
"MM2_Not_Respond_S"
priority=
"Medium"
textname=
"multimaster test sensor"
/>
</sensors>
<thresholds
name=
"thresholds"
>
<sensor
iotype=
"AI"
name=
"AI_AS"
>
...
...
extensions/ModbusMaster/MBTCPMultiMaster.cc
View file @
8a72fbd2
...
...
@@ -74,14 +74,14 @@ MBTCPMultiMaster::MBTCPMultiMaster( UniSetTypes::ObjectId objId, UniSetTypes::Ob
throw
UniSetTypes
::
SystemError
(
err
.
str
());
}
if
(
!
it1
.
getProp
(
"respond"
).
empty
()
)
if
(
!
it1
.
getProp
(
"respond
Sensor
"
).
empty
()
)
{
sinf
.
respond_id
=
conf
->
getSensorID
(
it1
.
getProp
(
"respond"
)
);
sinf
.
respond_id
=
conf
->
getSensorID
(
it1
.
getProp
(
"respond
Sensor
"
)
);
if
(
sinf
.
respond_id
==
DefaultObjectId
)
{
ostringstream
err
;
err
<<
myname
<<
"(init): ERROR: Unknown SensorID for '"
<<
it1
.
getProp
(
"respond"
)
<<
"' in <GateList>"
;
err
<<
myname
<<
"(init): ERROR: Unknown SensorID for '"
<<
it1
.
getProp
(
"respond
Sensor
"
)
<<
"' in <GateList>"
;
mbcrit
<<
err
.
str
()
<<
endl
;
throw
UniSetTypes
::
SystemError
(
err
.
str
());
}
...
...
@@ -94,7 +94,7 @@ MBTCPMultiMaster::MBTCPMultiMaster( UniSetTypes::ObjectId objId, UniSetTypes::Ob
sinf
.
recv_timeout
=
it1
.
getPIntProp
(
"recv_timeout"
,
recv_timeout
);
sinf
.
aftersend_pause
=
it1
.
getPIntProp
(
"aftersend_pause"
,
aftersend_pause
);
sinf
.
sleepPause_usec
=
it1
.
getPIntProp
(
"sleepPause_usec"
,
sleepPause_usec
);
sinf
.
respond_invert
=
it1
.
getPIntProp
(
"
respond_
invert"
,
0
);
sinf
.
respond_invert
=
it1
.
getPIntProp
(
"invert"
,
0
);
sinf
.
force_disconnect
=
it
.
getPIntProp
(
"persistent_connection"
,
!
force_disconnect
)
?
false
:
true
;
...
...
@@ -357,13 +357,15 @@ void MBTCPMultiMaster::check_thread()
{
bool
r
=
it
->
check
();
mbinfo
<<
myname
<<
"(check): "
<<
it
->
myname
<<
" "
<<
(
r
?
"OK"
:
"FAIL"
)
<<
endl
;
cerr
<<
"respond_init="
<<
it
->
respond_init
<<
endl
;
try
{
if
(
it
->
respond_id
!=
DefaultObjectId
&&
(
force_out
||
r
!=
it
->
respond
)
)
if
(
it
->
respond_id
!=
DefaultObjectId
&&
(
force_out
||
!
it
->
respond_init
||
r
!=
it
->
respond
)
)
{
bool
set
=
it
->
respond_invert
?
!
it
->
respond
:
it
->
respond
;
shm
->
localSetValue
(
it
->
respond_it
,
it
->
respond_id
,
(
set
?
1
:
0
),
getId
());
it
->
respond_init
=
true
;
}
}
catch
(
const
Exception
&
ex
)
...
...
extensions/ModbusMaster/MBTCPMultiMaster.h
View file @
8a72fbd2
...
...
@@ -263,6 +263,7 @@ class MBTCPMultiMaster:
UniSetTypes
::
ObjectId
respond_id
;
IOController
::
IOStateList
::
iterator
respond_it
;
bool
respond_invert
;
bool
respond_init
=
{
false
};
inline
bool
operator
<
(
const
MBSlaveInfo
&
mbs
)
const
{
...
...
extensions/ModbusMaster/start_fg_mbtcpmulti.sh
View file @
8a72fbd2
...
...
@@ -15,6 +15,7 @@
--mbtcp-force-disconnect
1
\
--mbtcp-polltime
1000
\
--mbtcp-force-out
1
\
--mbtcp-log-add-levels
any
\
$*
#--mbtcp-exchange-mode-id MB1_Mode_AS \
...
...
extensions/ModbusMaster/tests/test_mbtcpmultimaster.cc
View file @
8a72fbd2
...
...
@@ -127,11 +127,16 @@ TEST_CASE("MBTCPMultiMaster: rotate channel", "[modbus][mbmaster][mbtcpmultimast
mbs1
->
disableExchange
(
true
);
msleep
(
4000
);
// --mbtcp-timeout 3000 (см. run_test_mbtcmultipmaster.sh)
REQUIRE
(
ui
->
getValue
(
1003
)
==
10
);
REQUIRE
(
ui
->
getValue
(
12
)
==
true
);
REQUIRE
(
ui
->
getValue
(
13
)
==
false
);
mbs1
->
disableExchange
(
false
);
mbs2
->
disableExchange
(
true
);
msleep
(
4000
);
// --mbtcp-timeout 3000 (см. run_test_mbtcmultipmaster.sh)
REQUIRE
(
ui
->
getValue
(
1003
)
==
100
);
REQUIRE
(
ui
->
getValue
(
12
)
==
false
);
mbs2
->
disableExchange
(
false
);
REQUIRE
(
ui
->
getValue
(
1003
)
==
100
);
REQUIRE
(
ui
->
getValue
(
13
)
==
true
);
}
// -----------------------------------------------------------------------------
src/Various/SViewer.cc
View file @
8a72fbd2
...
...
@@ -187,19 +187,21 @@ void SViewer::getInfo( ObjectId id )
return
;
}
IOController_i
::
SensorInfoSeq_var
amap
=
ioc
->
getSensorsMap
();
IONotifyController_i
::
ThresholdsListSeq_var
tlst
=
ioc
->
getThresholdsList
();
try
{
IOController_i
::
SensorInfoSeq_var
amap
=
ioc
->
getSensorsMap
();
updateSensors
(
amap
,
id
);
}
catch
(
IOController_i
::
NameNotFound
){}
catch
(...)
{}
try
{
IONotifyController_i
::
ThresholdsListSeq_var
tlst
=
ioc
->
getThresholdsList
();
updateThresholds
(
tlst
,
id
);
}
catch
(
IOController_i
::
NameNotFound
){}
catch
(...)
{}
return
;
...
...
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