PDF
简体中文
简体中文
English
AuboStudio SDK
0.6.3
modbus_io.h
浏览该文件的文档.
1
#ifndef AUBO_SCOPE_MODBUS_IO_H
2
#define AUBO_SCOPE_MODBUS_IO_H
3
4
#include <
aubo_caps/domain/io/io.h
>
5
6
namespace
arcs
{
7
namespace
aubo_scope
{
8
ARCS_CLASS_FORWARD
(
ModbusIo
);
9
10
/**
11
* @ingroup ApplicationApi
12
* \chinese
13
* Modbus IO 接口
14
* 此接口提供对 MODBUS I/O 的支持。
15
* \endchinese
16
* \english
17
* ModbusIo
18
* This interface provides support for MODBUS I/Os.
19
* \endenglish
20
*/
21
class
ARCS_ABI_EXPORT
ModbusIo
:
public
Io
22
{
23
public
:
24
ModbusIo
(
ModbusIo
&f);
25
ModbusIo
(
ModbusIo
&&f);
26
~ModbusIo
();
27
28
/**
29
* @ingroup ModbusIo
30
* \chinese
31
* 获取此MODBUS I/O的IP地址
32
* @return IP地址。
33
* \endchinese
34
* \english
35
* Returns the IP address for this MODBUS I/O.
36
* @return Get the IP address for this MODBUS I/O.
37
* \endenglish
38
*/
39
std::string
getIpAddress
();
40
41
/**
42
* @ingroup ModbusIo
43
* \chinese
44
* 获取此MODBUS I/O的信号地址
45
* @return 信号地址。
46
* \endchinese
47
* \english
48
* Returns the signal address for this MODBUS I/O.
49
* @return the signal address for this MODBUS I/O.
50
* \endenglish
51
*/
52
std::string
getSignalAddress
();
53
54
/**
55
* @ingroup ModbusIo
56
* \chinese
57
* 判断此MODBUS I/O是否为从站
58
* @return 是否为从站。
59
* \endchinese
60
* \english
61
* Returns whether this MODBUS I/O is a slave.
62
* @return Get the is slave for this MODBUS I/O.
63
* \endenglish
64
*/
65
bool
isSlave
();
66
67
/**
68
* @ingroup ModbusIo
69
* \chinese
70
* 设置MODBUS信号的整数值。
71
* @param value 要设置的整数值。
72
* @return 信号下发成功返回<code>true</code>,否则返回<code>false</code>。
73
* \endchinese
74
* \english
75
* Set MODBUS signal to an integer value.
76
* @param value Set MODBUS signal to an integer value.
77
* @return <code>true</code> if the MODBUS signal was sent down to the
78
* controller, and <code>false</code> if the signal was not sent down.
79
* \endenglish
80
*/
81
bool
setValue
(
int
value);
82
83
/**
84
* @ingroup ModbusIo
85
* \chinese
86
* 获取MODBUS信号的整数值。
87
* @return MODBUS信号的整数值。
88
* \endchinese
89
* \english
90
* Returns the integer value of the MODBUS signal.
91
* @return the integer value of the MODBUS signal.
92
* \endenglish
93
*/
94
int
getValue
();
95
96
private
:
97
friend
class
DataSwitch
;
98
ModbusIo
();
99
void
*
d_
{
nullptr
};
100
};
101
102
struct
ModbusIoFilter
103
{
104
ModbusIoFilter
(
Io::IoType
type,
bool
is_input)
105
:
type_
(type),
is_input_
(is_input)
106
{
107
}
108
bool
operator()
(IoPtr io)
109
{
110
return
std::dynamic_pointer_cast<ModbusIo>(io) !=
nullptr
&&
111
io->getType() ==
type_
&& io->isInput() ==
is_input_
;
112
}
113
114
private
:
115
Io::IoType
type_
;
116
bool
is_input_
;
117
};
118
119
}
// namespace aubo_scope
120
}
// namespace arcs
121
122
#endif
// MODBUSIO_H
ARCS_ABI_EXPORT
#define ARCS_ABI_EXPORT
定义
class_forward.h:16
ARCS_CLASS_FORWARD
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
定义
class_forward.h:68
arcs::aubo_scope::Io::IoType
IoType
定义
io.h:26
arcs::aubo_scope::Io::Io
Io(Io &f)
arcs::aubo_scope::ModbusIo
Modbus IO 接口 此接口提供对 MODBUS I/O 的支持。
定义
modbus_io.h:22
arcs::aubo_scope::ModbusIo::d_
void * d_
定义
modbus_io.h:99
arcs::aubo_scope::ModbusIo::setValue
bool setValue(int value)
设置MODBUS信号的整数值。
arcs::aubo_scope::ModbusIo::~ModbusIo
~ModbusIo()
arcs::aubo_scope::ModbusIo::getIpAddress
std::string getIpAddress()
获取此MODBUS I/O的IP地址
arcs::aubo_scope::ModbusIo::DataSwitch
friend class DataSwitch
定义
modbus_io.h:97
arcs::aubo_scope::ModbusIo::ModbusIo
ModbusIo(ModbusIo &f)
arcs::aubo_scope::ModbusIo::ModbusIo
ModbusIo()
arcs::aubo_scope::ModbusIo::ModbusIo
ModbusIo(ModbusIo &&f)
arcs::aubo_scope::ModbusIo::getSignalAddress
std::string getSignalAddress()
获取此MODBUS I/O的信号地址
arcs::aubo_scope::ModbusIo::getValue
int getValue()
获取MODBUS信号的整数值。
arcs::aubo_scope::ModbusIo::isSlave
bool isSlave()
判断此MODBUS I/O是否为从站
io.h
arcs::aubo_scope
定义
contribution_provider.h:8
arcs
定义
contribution_provider.h:7
arcs::aubo_scope::ModbusIoFilter::is_input_
bool is_input_
定义
modbus_io.h:116
arcs::aubo_scope::ModbusIoFilter::type_
Io::IoType type_
定义
modbus_io.h:115
arcs::aubo_scope::ModbusIoFilter::operator()
bool operator()(IoPtr io)
定义
modbus_io.h:108
arcs::aubo_scope::ModbusIoFilter::ModbusIoFilter
ModbusIoFilter(Io::IoType type, bool is_input)
定义
modbus_io.h:104
include
aubo_caps
domain
io
modbus_io.h
制作者
1.16.1