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
21f127a6
Commit
21f127a6
authored
Oct 31, 2009
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add little docs for MBTCPMaster
parent
3a9fba8e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
22 deletions
+98
-22
Concept.dox
docs/DocPages/Concept.dox
+2
-7
MBTCPMaster.cc
extensions/MBTCPMaster/MBTCPMaster.cc
+3
-6
MBTCPMaster.h
extensions/MBTCPMaster/MBTCPMaster.h
+85
-2
VTypes.h
extensions/include/VTypes.h
+8
-7
No files found.
docs/DocPages/Concept.dox
View file @
21f127a6
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
- \ref sec_Cnpt_Repository
- \ref sec_Cnpt_Repository
- \ref sec_Cnpt_Sensor
- \ref sec_Cnpt_Sensor
- \ref sec_Cnpt_Process
- \ref sec_Cnpt_Process
- \ref sec_Cnpt_Service
\section sec_Cnpt_Object
\section sec_Cnpt_Object
...
@@ -186,9 +185,9 @@ UniSetTypes::Message::TheLastFieldOfTypeOfMessage.
...
@@ -186,9 +185,9 @@ UniSetTypes::Message::TheLastFieldOfTypeOfMessage.
/.
/.
""(DI,AI) - , " "
""(DI,AI) - , " "
""(DO,AO) - " ".
""(DO,AO) - " ".
, "" .
, "" .
ң , ,
ң , ,
,
,
""
""
"1".
"1".
()
()
...
@@ -211,7 +210,4 @@ UniSetTypes::Message::TheLastFieldOfTypeOfMessage.
...
@@ -211,7 +210,4 @@ UniSetTypes::Message::TheLastFieldOfTypeOfMessage.
ģ ""
ģ ""
, .
, .
\section sec_Cnpt_Service
*/
*/
\ No newline at end of file
extensions/MBTCPMaster/MBTCPMaster.cc
View file @
21f127a6
...
@@ -1273,12 +1273,9 @@ void MBTCPMaster::help_print( int argc, const char* const* argv )
...
@@ -1273,12 +1273,9 @@ void MBTCPMaster::help_print( int argc, const char* const* argv )
cout
<<
"--mbm-heartbeat-max - heartbeat-ޣ . 10."
<<
endl
;
cout
<<
"--mbm-heartbeat-max - heartbeat-ޣ . 10."
<<
endl
;
cout
<<
"--mbm-ready-timeout - SM , . (-1 - '')"
<<
endl
;
cout
<<
"--mbm-ready-timeout - SM , . (-1 - '')"
<<
endl
;
cout
<<
"--mbm-force - SM, , "
<<
endl
;
cout
<<
"--mbm-force - SM, , "
<<
endl
;
cout
<<
"--mbm-initPause - ( )"
<<
endl
;
cout
<<
"--mbm-initPause - ( )"
<<
endl
;
cout
<<
"--mbm-sm-ready-timeout - SM"
<<
endl
;
// cout << "--mbm-sm-ready-timeout - SM" << endl;
cout
<<
" RS: "
<<
endl
;
cout
<<
" TCP: "
<<
endl
;
cout
<<
"--mbm-dev devname - "
<<
endl
;
cout
<<
"--mbm-speed - (9600,19920,38400,57600,115200)."
<<
endl
;
cout
<<
"--mbm-my-addr - "
<<
endl
;
cout
<<
"--mbm-recv-timeout - ."
<<
endl
;
cout
<<
"--mbm-recv-timeout - ."
<<
endl
;
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
...
extensions/MBTCPMaster/MBTCPMaster.h
View file @
21f127a6
...
@@ -18,8 +18,91 @@
...
@@ -18,8 +18,91 @@
#include "VTypes.h"
#include "VTypes.h"
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
/*!
/*!
Реализация Modbus TCP Master-а для работы со многими ModbusRTU устройствами,
\page page_ModbusTCP ModbusTCP master
но только через ОДИН ModbusTCP-шлюз.
- \ref sec_MBTCP_Comm
- \ref sec_MBTCP_Conf
\section sec_MBTCP_Comm ModbusTCP master
(/) RTU-,
TCP-.
<sensors>. . \ref sec_MBTCP_Conf
\b --xxx-name
IP- \b gateway_iaddr
\b --xxx-gateway-iaddr.
\b gateway_port
\b --xxx-gateway-port. \b 502.
\b --xxx-recv-timeout \b recv_timeout
\b --xxx-all-timeout \b all_timeout
\b --xxx-no-query-optimization \b no_query_optimization
\b --xxx-poll-time \b poll_time
\b --xxx-init-time \b init_time
\b --xxx-force \b foce
\b --xxx-force-out \b foce_out
\b --xxx-reg-from-id \b reg_from_id
\b --xxx-heartbeat-id \b heartbeat_id
\b --xxx-heartbeat-max \b heartbeat_max
\b --xxx-activate-timeout msec . 2000.
\b --xxx-filter-field
\b --xxx-filter-value
\section sec_MBTCP_Conf ModbusTCP master
<sensors> .
:
\code
<sensors name="Sensors">
...
<item name="MySensor_S" textname="my sesnsor" iotype="DI"
tcp_mbtype="rtu" tcp_mbaddr="0x01" tcp_mbfunc="0x04" tcp_mbreg="0x02" my_tcp="1"
/>
...
</sensors>
\endcode
:
- \b tcp_mbtype - [rtu] - ۣ .
- \b tcp_mbaddr - RTU-.
- \b tcp_mbreg - / .
- \b tcp_mbfunc - [0x1,0x2,0x3,...] /. ۣ . ModbusRTU::SlaveFunctionCode.
:
- \b tcp_vtype - . VTypes::VType.
- \b tcp_rawdata - [1|0] -
- \b tcp_iotype - [DI,DO,AI,AO] - . iotype.
- \b tcp_nbit - . DI,DO
(03
- \b tcp_nbyte - [1|2] . tcp_vtype="byte".
- \b tcp_mboffset - ""( ) /.
.. / "mbreg+mboffset".
\warning . \a nbit \a nbyte.
*/
// -----------------------------------------------------------------------------
/*!
Modbus TCP Master ModbusRTU
modbus tcp .
*/
*/
class
MBTCPMaster
:
class
MBTCPMaster
:
public
UniSetObject_LT
public
UniSetObject_LT
...
...
extensions/include/VTypes.h
View file @
21f127a6
...
@@ -12,22 +12,23 @@
...
@@ -12,22 +12,23 @@
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
namespace
VTypes
namespace
VTypes
{
{
/*! Modbus[RTU|TCP] */
enum
VType
enum
VType
{
{
vtUnknown
,
vtUnknown
,
vtF2
,
vtF2
,
/*!< (4 ) */
vtF4
,
vtF4
,
/*!< 8- */
vtByte
,
vtByte
,
/*!< */
vtUnsigned
,
vtUnsigned
,
/*!< */
vtSigned
vtSigned
/*!< */
};
};
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
VType
&
vt
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
VType
&
vt
);
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
std
::
string
type2str
(
VType
t
);
/*!< */
std
::
string
type2str
(
VType
t
);
/*!< */
VType
str2type
(
const
std
::
string
s
);
/*!< */
VType
str2type
(
const
std
::
string
s
);
/*!< */
int
wsize
(
VType
t
);
/*!< */
int
wsize
(
VType
t
);
/*!< */
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
class
F2
class
F2
{
{
...
...
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