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
d6518de3
Commit
d6518de3
authored
Nov 01, 2009
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add docs for MBTCPMaster
parent
21f127a6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
45 deletions
+89
-45
MBTCPMaster.cc
extensions/MBTCPMaster/MBTCPMaster.cc
+3
-3
MBTCPMaster.h
extensions/MBTCPMaster/MBTCPMaster.h
+79
-35
SharedMemory.h
extensions/SharedMemory/SharedMemory.h
+2
-2
VTypes.h
extensions/include/VTypes.h
+5
-5
No files found.
extensions/MBTCPMaster/MBTCPMaster.cc
View file @
d6518de3
...
@@ -56,9 +56,9 @@ no_extimer(false)
...
@@ -56,9 +56,9 @@ no_extimer(false)
throw
UniSetTypes
::
SystemError
(
myname
+
"(MBMaster): Unknown inet port...(Use: "
+
tmp
+
")"
);
throw
UniSetTypes
::
SystemError
(
myname
+
"(MBMaster): Unknown inet port...(Use: "
+
tmp
+
")"
);
recv_timeout
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-recv-timeout"
,
it
.
getProp
(
"recv_timeout"
),
5
0
);
recv_timeout
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-recv-timeout"
,
it
.
getProp
(
"recv_timeout"
),
200
0
);
int
alltout
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-all-timeout"
,
it
.
getProp
(
"all_timeout"
),
2
000
);
int
alltout
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-all-timeout"
,
it
.
getProp
(
"all_timeout"
),
5
000
);
ptAllNotRespond
.
setTiming
(
alltout
);
ptAllNotRespond
.
setTiming
(
alltout
);
noQueryOptimization
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-no-query-optimization"
,
it
.
getProp
(
"no_query_optimization"
));
noQueryOptimization
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-no-query-optimization"
,
it
.
getProp
(
"no_query_optimization"
));
...
@@ -68,7 +68,7 @@ no_extimer(false)
...
@@ -68,7 +68,7 @@ no_extimer(false)
polltime
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-polltime"
,
it
.
getProp
(
"polltime"
),
100
);
polltime
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-polltime"
,
it
.
getProp
(
"polltime"
),
100
);
initPause
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-initPause"
,
it
.
getProp
(
"initPause"
),
300
0
);
initPause
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-initPause"
,
it
.
getProp
(
"initPause"
),
5
0
);
force
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-force"
,
it
.
getProp
(
"force"
));
force
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-force"
,
it
.
getProp
(
"force"
));
force_out
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-force-out"
,
it
.
getProp
(
"force_out"
));
force_out
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-force-out"
,
it
.
getProp
(
"force_out"
));
...
...
extensions/MBTCPMaster/MBTCPMaster.h
View file @
d6518de3
...
@@ -22,54 +22,98 @@
...
@@ -22,54 +22,98 @@
- \ref sec_MBTCP_Comm
- \ref sec_MBTCP_Comm
- \ref sec_MBTCP_Conf
- \ref sec_MBTCP_Conf
- \ref sec_MBTCP_ConfList
\section sec_MBTCP_Comm ModbusTCP master
\section sec_MBTCP_Comm ModbusTCP master
(/) RTU-,
(/) RTU-,
TCP-.
TCP-.
<sensors>. . \ref sec_MBTCP_Conf
\b
<sensors>. . \ref sec_MBTCP_Conf
\b --xxx-name
\section sec_MBTCP_Conf ModbusTCP master
IP- \b gateway_iaddr
\b --xxx-gateway-iaddr.
.
\b gateway_port
\par
\b --xxx-gateway-port. \b 502.
ϣ , ݣ ,
.
:
\code
<MBMaster1 name="MBMaster1" gateway_iaddr="127.0.0.1" gateway_port="30000" polltime="200">
<DeviceList>
<item addr="0x01" respondSensor="RTU1_Not_Respond_FS" timeout="2000" invert="1"/>
<item addr="0x02" respondSensor="RTU2_Respond_FS" timeout="2000" invert="0"/>
</DeviceList>
</MBMaster1>
\endcode
<DeviceList> RTU-.
\b --xxx-recv-timeout \b recv_timeout
- \b addr - ,
- \b timeout msec - ,
- \b invert - . "1" \b .
- \b respondSensor - .
\par
.
\b xxx="mbtcp".
:
\b --xxx-name ID - .
\b --xxx-all-timeout \b all_timeout
IP- \b gateway_iaddr
\b --xxx-gateway-iaddr.
\b --xxx-no-query-optimization \b no_query_optimization
\b gateway_port
\b --xxx-gateway-port. \b 502.
\b --xxx-
poll-time \b poll_time
\b --xxx-
recv-timeout \b recv_timeout msec - ɣ . 2000 .
\b --xxx-init-time \b init_time
\b --xxx-all-timeout \b all_timeout msec -
( ģ )
\b --xxx-force \b foce
\b --xxx-no-query-optimization \b no_query_optimization - [1|0]
, / .
, \b mbfunc .
\b --xxx-force-out \b foce_out
\b --xxx-
reg-from-id \b reg_from_id
\b --xxx-
poll-time \b poll_time msec - . 100 .
\b --xxx-
heartbeat-id \b heartbeat_id
\b --xxx-
initPause \b initPause msec - , . 50 .
\b --xxx-heartbeat-max \b heartbeat_max
\b --xxx-force \b foce [1|0]
- 1 - SharedMemory
\b --xxx-activate-timeout msec . 2000.
- 0 -
\b --xxx-filter-field
\b --xxx-filter-value
\b --xxx-force-out \b foce_out [1|0]
- 1 - SharedMemory
- 0 -
\b --xxx-reg-from-id \b reg_from_id [1|0]
- 1 -
- 0 - tcp_mbreg
\b --xxx-heartbeat-id \b heartbeat_id ID - "" (. \ref sec_SM_HeartBeat)
\b --xxx-heartbeat-max \b heartbeat_max val - ޣ "".
\b --xxx-activate-timeout msec . 2000. - SharedMemory .
\section sec_MBTCP_ConfList ModbusTCP master
<sensors> .
\b --xxx-filter-field -
\b --xxx-filter-value - . .
, ,
.
\
section sec_MBTCP_Conf ModbusTCP master
\
warning , .
<sensors> .
:
:
\code
\code
<sensors name="Sensors">
<sensors name="Sensors">
...
...
...
@@ -78,7 +122,8 @@
...
@@ -78,7 +122,8 @@
/>
/>
...
...
</sensors>
</sensors>
\endcode
\endcode
:
:
- \b tcp_mbtype - [rtu] - ۣ .
- \b tcp_mbtype - [rtu] - ۣ .
- \b tcp_mbaddr - RTU-.
- \b tcp_mbaddr - RTU-.
...
@@ -96,7 +141,6 @@
...
@@ -96,7 +141,6 @@
.. / "mbreg+mboffset".
.. / "mbreg+mboffset".
\warning . \a nbit \a nbyte.
\warning . \a nbit \a nbyte.
*/
*/
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
@@ -131,8 +175,8 @@ class MBTCPMaster:
...
@@ -131,8 +175,8 @@ class MBTCPMaster:
enum
DeviceType
enum
DeviceType
{
{
dtUnknown
,
/*!< */
dtUnknown
,
/*!< */
dtRTU
/*!< RTU (default) */
dtRTU
/*!< RTU (default) */
};
};
static
DeviceType
getDeviceType
(
const
std
::
string
dtype
);
static
DeviceType
getDeviceType
(
const
std
::
string
dtype
);
...
@@ -145,10 +189,10 @@ class MBTCPMaster:
...
@@ -145,10 +189,10 @@ class MBTCPMaster:
public
IOBase
public
IOBase
{
{
// only for RTU
// only for RTU
short
nbit
;
/*!< bit number) */
short
nbit
;
/*!< bit number) */
VTypes
::
VType
vType
;
/*!< type of value */
VTypes
::
VType
vType
;
/*!< type of value */
short
rnum
;
/*!< count of registers */
short
rnum
;
/*!< count of registers */
short
nbyte
;
/*!< byte number (1-2) */
short
nbyte
;
/*!< byte number (1-2) */
RSProperty
()
:
RSProperty
()
:
nbit
(
-
1
),
vType
(
VTypes
::
vtUnknown
),
nbit
(
-
1
),
vType
(
VTypes
::
vtUnknown
),
...
@@ -173,7 +217,7 @@ class MBTCPMaster:
...
@@ -173,7 +217,7 @@ class MBTCPMaster:
{}
{}
ModbusRTU
::
ModbusData
mbval
;
ModbusRTU
::
ModbusData
mbval
;
ModbusRTU
::
ModbusData
mbreg
;
/*!< */
ModbusRTU
::
ModbusData
mbreg
;
/*!< */
ModbusRTU
::
SlaveFunctionCode
mbfunc
;
/*!< / */
ModbusRTU
::
SlaveFunctionCode
mbfunc
;
/*!< / */
PList
slst
;
PList
slst
;
...
@@ -182,7 +226,7 @@ class MBTCPMaster:
...
@@ -182,7 +226,7 @@ class MBTCPMaster:
int
offset
;
int
offset
;
// optimization
// optimization
int
q_num
;
/*! number in query */
int
q_num
;
/*! number in query */
int
q_count
;
/*! count registers for query */
int
q_count
;
/*! count registers for query */
RegMap
::
iterator
rit
;
RegMap
::
iterator
rit
;
...
...
extensions/SharedMemory/SharedMemory.h
View file @
d6518de3
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
#include "WDTInterface.h"
#include "WDTInterface.h"
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
/*! \page page_SharedMemory
/*! \page page_SharedMemory
(SharedMemory)
\section sec_SM_Common SharedMemory
\section sec_SM_Common SharedMemory
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
\par (depends)
\par (depends)
\code
\code
--d-filter-field - "" (depends)
--d-filter-field - "" (depends)
--d-filter-value - . .
--d-filter-value - . .
\endcode
\endcode
... ... ...
... ... ...
...
...
extensions/include/VTypes.h
View file @
d6518de3
...
@@ -16,11 +16,11 @@ namespace VTypes
...
@@ -16,11 +16,11 @@ namespace VTypes
enum
VType
enum
VType
{
{
vtUnknown
,
vtUnknown
,
vtF2
,
/*!< (4 ) */
vtF2
,
/*!< (4 )
. \b "F2".
*/
vtF4
,
/*!< 8- */
vtF4
,
/*!< 8-
. \b "F4".
*/
vtByte
,
/*!< */
vtByte
,
/*!<
. \b "byte".
*/
vtUnsigned
,
/*!< */
vtUnsigned
,
/*!<
. \b "unsigned".
*/
vtSigned
/*!< */
vtSigned
/*!<
. \b "signed".
*/
};
};
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
VType
&
vt
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
VType
&
vt
);
...
...
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