AuboStudio SDK  0.6.3
profinet.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_PROFINET_H
2#define AUBO_SCOPE_PROFINET_H
3
5
6namespace arcs {
7namespace aubo_scope {
9
10/**
11 * @ingroup ApplicationApi
12 * \chinese
13 * PROFINET IO 接口
14 * 此接口提供对 PROFINET I/O 的支持。
15 * \endchinese
16 * \english
17 * Profinet
18 * This interface provides support for PROFINET I/Os.
19 * \endenglish
20 */
22{
23public:
27
28 /**
29 * @ingroup Profinet
30 * \chinese
31 * 获取此PROFINET I/O的字节偏移量
32 * @return 字节偏移量。
33 * \endchinese
34 * \english
35 * Returns the byte offset for this Profinet I/O.
36 * @return Get the byte offset for this Profinet I/O.
37 * \endenglish
38 */
40
41 /**
42 * @ingroup Profinet
43 * \chinese
44 * 获取此PROFINET I/O的位偏移量
45 * @return 位偏移量。
46 * \endchinese
47 * \english
48 * Returns the bit offset for this Profinet I/O.
49 * @return Get the bit offset for this Profinet I/O.
50 * \endenglish
51 */
53
54 /**
55 * @ingroup Profinet
56 * \chinese
57 * 判断此PROFINET I/O是否为从站
58 * @return 是否为从站。
59 * \endchinese
60 * \english
61 * Returns whether this Profinet I/O is a slave.
62 * @return <code>true</code> if this is a slave.
63 * \endenglish
64 */
65 bool isSlave();
66
67 /**
68 * @ingroup Profinet
69 * \chinese
70 * 设置PROFINET信号的整数值。如果PROFINET信号是数字量,则<code>false</code>用0
71 * 表示,<code>true</code>用所有非0数字表示。
72 *
73 * @param value 要设置的整数值。
74 * @return 如果PROFINET信号已下发到控制器则返回<code>true</code>,如果信号未下发
75 * (例如控制器未运行)则返回<code>false</code>。注意PROFINET信号必须支持写入,
76 * 请查阅Aubo PROFINET协议。
77 * \endchinese
78 * \english
79 * Set PROFINET signal to an integer value. If the PROFINET signal is
80 * digital, then <code>false</code> is represented by 0 and
81 * <code>true</code> are represented by all numbers different from 0.
82 *
83 * @param value the integer value to set.
84 * @return <code>true</code> if the PROFINET signal was sent down to the
85 * controller, and <code>false</code> if the signal was not sent down, e.g.
86 * because the controller was not running. Notice that the PROFINET signal
87 * must support writes, consult the Aubo PROFINET protocol.
88 * \endenglish
89 */
90 bool setValue(int value);
91
92 /**
93 * @ingroup Profinet
94 * \chinese
95 * 获取PROFINET信号的整数值。如果PROFINET信号是数字量,则<code>false</code>用0
96 * 表示,<code>true</code>用值1表示。
97 * @return PROFINET信号的整数值。
98 * \endchinese
99 * \english
100 * Returns the integer value of the PROFINET signal. If the PROFINET signal
101 * is digital then <code>false</code> is represented by 0 and
102 * <code>true</code> is represented by the value 1.
103 * @return the integer value of the PROFINET signal.
104 * \endenglish
105 */
106 int getValue();
107
108private:
109 friend class DataSwitch;
111 void *d_{ nullptr };
112};
113
115{
116 ProfinetFilter(Io::IoType type, bool is_input)
117 : type_(type), is_input_(is_input)
118 {
119 }
120 bool operator()(IoPtr io)
121 {
122 return std::dynamic_pointer_cast<Profinet>(io) != nullptr &&
123 io->getType() == type_ && io->isInput() == is_input_;
124 }
125
126private:
129};
130
131} // namespace aubo_scope
132} // namespace arcs
133
134#endif // PROFINETIO_H
#define ARCS_ABI_EXPORT
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
\chinese PROFINET IO 接口 此接口提供对 PROFINET I/O 的支持。 \endchinese \english Profinet This interface provide...
int getValue()
\chinese 获取PROFINET信号的整数值。如果PROFINET信号是数字量,则false用0 表示,true用值1表示。
bool setValue(int value)
\chinese 设置PROFINET信号的整数值。如果PROFINET信号是数字量,则false用0 表示,true用所有非0数字表示。
int getBitOffset()
\chinese 获取此PROFINET I/O的位偏移量
bool isSlave()
\chinese 判断此PROFINET I/O是否为从站
int getByteOffset()
\chinese 获取此PROFINET I/O的字节偏移量
ProfinetFilter(Io::IoType type, bool is_input)