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
ed6bfc9c
Commit
ed6bfc9c
authored
Jul 10, 2010
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Исправил ошибку: сделал параметр force_disconnect глобальным
parent
ec97ede2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
MBTCPMaster.cc
extensions/MBTCPMaster/MBTCPMaster.cc
+3
-4
MBTCPMaster.h
extensions/MBTCPMaster/MBTCPMaster.h
+5
-4
No files found.
extensions/MBTCPMaster/MBTCPMaster.cc
View file @
ed6bfc9c
...
...
@@ -20,6 +20,7 @@ force_out(false),
mbregFromID
(
false
),
activated
(
false
),
noQueryOptimization
(
false
),
force_disconnect
(
false
),
allNotRespond
(
false
),
prefix
(
prefix
),
no_extimer
(
false
)
...
...
@@ -74,6 +75,7 @@ no_extimer(false)
force
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-force"
,
it
.
getProp
(
"force"
));
force_out
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-force-out"
,
it
.
getProp
(
"force_out"
));
force_disconnect
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-force-disconnect"
,
it
.
getProp
(
"force_disconnect"
));
if
(
shm
->
isLocalwork
()
)
{
...
...
@@ -161,6 +163,7 @@ void MBTCPMaster::initMB( bool reopen )
ost
::
InetAddress
ia
(
iaddr
.
c_str
());
mb
->
connect
(
ia
,
port
);
mb
->
setForceDisconnect
(
force_disconnect
);
if
(
recv_timeout
>
0
)
mb
->
setTimeout
(
recv_timeout
);
...
...
@@ -265,8 +268,6 @@ void MBTCPMaster::poll()
{
RTUDevice
*
d
(
it1
->
second
);
mb
->
setForceDisconnect
(
d
->
force_disconnect
);
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(poll): ask addr="
<<
ModbusRTU
::
addr2str
(
d
->
mbaddr
)
<<
" regs="
<<
d
->
regmap
.
size
()
<<
endl
;
...
...
@@ -1467,10 +1468,8 @@ bool MBTCPMaster::initDeviceInfo( RTUDeviceMap& m, ModbusRTU::ModbusAddr a, UniX
}
d
->
second
->
ask_every_reg
=
it
.
getIntProp
(
"ask_every_reg"
);
d
->
second
->
force_disconnect
=
it
.
getIntProp
(
"force_disconnect"
);
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(initDeviceInfo): add addr="
<<
ModbusRTU
::
addr2str
(
a
)
<<
" force_disconnect="
<<
d
->
second
->
force_disconnect
<<
" ask_every_reg="
<<
d
->
second
->
ask_every_reg
<<
endl
;
string
s
(
it
.
getProp
(
"respondSensor"
));
...
...
extensions/MBTCPMaster/MBTCPMaster.h
View file @
ed6bfc9c
...
...
@@ -85,7 +85,9 @@
\b --xxx-force или \b foce [1|0]
- 1 - перечитывать значения входов из SharedMemory на каждом цикле
- 0 - обновлять значения только по изменению
\b --xxx-force-disconnect или \b force_disconnect - закрывать соединение после каждого запроса.
\b --xxx-force-out или \b foce_out [1|0]
- 1 - перечитывать значения выходов из SharedMemory на каждом цикле
- 0 - обновлять значения только по изменению
...
...
@@ -249,8 +251,7 @@ class MBTCPMaster:
resp_invert
(
false
),
resp_real
(
false
),
resp_init
(
false
),
ask_every_reg
(
false
),
force_disconnect
(
false
)
ask_every_reg
(
false
)
{
resp_trTimeout
.
change
(
false
);
}
...
...
@@ -270,7 +271,6 @@ class MBTCPMaster:
bool
resp_real
;
bool
resp_init
;
bool
ask_every_reg
;
bool
force_disconnect
;
// return TRUE if state changed
bool
checkRespond
();
...
...
@@ -367,6 +367,7 @@ class MBTCPMaster:
int
activateTimeout
;
bool
noQueryOptimization
;
bool
force_disconnect
;
bool
allNotRespond
;
Trigger
trAllNotRespond
;
...
...
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