AUBO SDK  0.26.0
载入中...
搜索中...
未找到
register_control.h
浏览该文件的文档.
1/** @file register_control.h
2 * @brief 寄存器操作接口,用于三个模块之间的数据交换功能
3 */
4#ifndef AUBO_SDK_REGISTER_CONTROL_INTERFACE_H
5#define AUBO_SDK_REGISTER_CONTROL_INTERFACE_H
6
7#include <stdint.h>
8#include <memory>
9#include <vector>
10
11#include <aubo/type_def.h>
12#include <aubo/global_config.h>
13
15{
16 /** MODBUS unit not initiallized
17 */
19
20 /** MODBUS unit disconnected
21 */
23
24 /** The function code received in the query is not an allowable action for
25 * the server (or slave).
26 */
28
29 /** The function code received in the query is not an allowable action for
30 * the server (or slave), check that the entered signal address corresponds
31 * to the setup of the remote MODBUS server.
32 */
34
35 /** A value contained in the query data field is not an allowable value for
36 * server (or slave), check that the enterd signal value is valid for the
37 * specified address on the remote MODBUS server.
38 */
40
41 /** An unrecoverable error occurred while the server (or slave) was
42 * attempting to perform the requested action.
43 */
45
46 /** Specialized use in conjunction with programming commands sent to the
47 * remote MODBUS unit.
48 */
50
51 /** Specialized use in conjunction with programming commands sent to the
52 * remote MODBUS unit, the slave (server) is not able to respond now
53 */
55};
56
57namespace arcs {
58namespace common_interface {
59
60/**
61 * @defgroup RegisterControl RegisterControl (寄存器操作)
62 * \~chinese 通用寄存器 \~english General Registers
63 */
64class ARCS_ABI_EXPORT RegisterControl
65{
66public:
69
70 /**
71 * @ingroup RegisterControl
72 * \chinese
73 *
74 * 从一个输入寄存器中读取布尔值,也可以通过现场总线进行访问。
75 * 注意,它使用自己的内存空间。
76 *
77 * @param address 寄存器的地址(0:127)
78 * @return 寄存器中保存的布尔值(true、false)
79 *
80 * @note 布尔输入寄存器的较低范围[0:63]保留供FieldBus/PLC接口使用。
81 * 较高范围[64:127]无法通过FieldBus/PLC接口访问,因为它保留供外部RTDE客户端使用。
82 *
83 * @par Python函数原型
84 * getBoolInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> bool
85 *
86 * @par Lua函数原型
87 * getBoolInput(address: number) -> boolean
88 *
89 * @par Lua示例
90 * BoolInput_0 = getBoolInput(0)
91 *
92 * @par JSON-RPC请求示例
93 * {"jsonrpc":"2.0","method":"RegisterControl.getBoolInput","params":[0],"id":1}
94 *
95 * @par JSON-RPC响应示例
96 * {"id":1,"jsonrpc":"2.0","result":false}
97 * \endchinese
98 *
99 * \english
100 * Reads the boolean from one of the input registers, which can also be
101 * accessed by a Field bus. Note, uses its own memory space.
102 *
103 * @param address Address of the register (0:127)
104 * @return Boolean value held by the register (true, false)
105 *
106 * @note The lower range of the boolean input registers [0:63] is reserved
107 * for FieldBus/PLC interface usage. The upper range [64:127] cannot be
108 * accessed by FieldBus/PLC interfaces, since it is reserved for external
109 * RTDE clients.
110 *
111 * @par Python interface prototype
112 * getBoolInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> bool
113 *
114 * @par Lua interface prototype
115 * getBoolInput(address: number) -> boolean
116 *
117 * @par Lua example
118 * BoolInput_0 = getBoolInput(0)
119 *
120 * @par JSON-RPC request example
121 * {"jsonrpc":"2.0","method":"RegisterControl.getBoolInput","params":[0],"id":1}
122 *
123 * @par JSON-RPC response example
124 * {"id":1,"jsonrpc":"2.0","result":false}
125 * \endenglish
126 */
127 bool getBoolInput(uint32_t address);
128
129 /**
130 * @ingroup RegisterControl
131 * \chinese
132 *
133 * @param address
134 * @param value
135 * @return
136 *
137 * @note 只有在实现 RTDE/Modbus Slave/PLC 服务端时使用
138 *
139 * @par Python函数原型
140 * setBoolInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: bool) ->
141 * int
142 *
143 * @par Lua函数原型
144 * setBoolInput(address: number, value: boolean) -> nil
145 *
146 * @par Lua示例
147 * setBoolInput(0)
148 *
149 * @par JSON-RPC请求示例
150 * {"jsonrpc":"2.0","method":"RegisterControl.setBoolInput","params":[0,true],"id":1}
151 *
152 * @par JSON-RPC响应示例
153 * {"id":1,"jsonrpc":"2.0","result":0}
154 *
155 * \endchinese
156 * \english
157 *
158 * @param address Address of the register (0:127)
159 * @param value Boolean value to set (true or false)
160 * @return Returns 0 on success, or an error code
161 *
162 * @note Only used when implementing RTDE/Modbus Slave/PLC server
163 *
164 * @par Python interface prototype
165 * setBoolInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: bool) ->
166 * int
167 *
168 * @par Lua interface prototype
169 * setBoolInput(address: number, value: boolean) -> nil
170 *
171 * @par Lua example
172 * setBoolInput(0)
173 *
174 * @par JSON-RPC request example
175 * {"jsonrpc":"2.0","method":"RegisterControl.setBoolInput","params":[0,true],"id":1}
176 *
177 * @par JSON-RPC response example
178 * {"id":1,"jsonrpc":"2.0","result":0}
179 *
180 * \endenglish
181 */
182 int setBoolInput(uint32_t address, bool value);
183
184 /**
185 * @ingroup RegisterControl
186 * \chinese
187 *
188 * 从一个输入寄存器中读取整数值,也可以通过现场总线进行访问。
189 * 注意,它使用自己的内存空间。
190 *
191 * @param address 寄存器的地址(0:47)
192 * @return 寄存器中保存的整数值[-2,147,483,648 : 2,147,483,647]
193 *
194 * @note 整数输入寄存器的较低范围[0:23]保留供FieldBus/PLC接口使用。
195 * 较高范围[24:47]无法通过FieldBus/PLC接口访问,因为它保留供外部RTDE客户端使用。
196 *
197 * @par Python函数原型
198 * getInt32Input(self: pyaubo_sdk.RegisterControl, arg0: int) -> int
199 *
200 * @par Lua函数原型
201 * getInt32Input(address: number) -> number
202 *
203 * @par Lua示例
204 * Int32Input_0 = getInt32Input(0)
205 *
206 * @par JSON-RPC请求示例
207 * {"jsonrpc":"2.0","method":"RegisterControl.getInt32Input","params":[0],"id":1}
208 *
209 * @par JSON-RPC响应示例
210 * {"id":1,"jsonrpc":"2.0","result":0}
211 * \endchinese
212 *
213 * \english
214 * Reads the integer from one of the input registers, which can also be
215 * accessed by a FieldBus. Note, uses it’s own memory space.
216 *
217 * @param address Address of the register (0:47)
218 * @return The value held by the register [-2,147,483,648 : 2,147,483,647]
219 *
220 * @note The lower range of the integer input registers [0:23] is reserved
221 * for FieldBus/PLC interface usage. The upper range [24:47] cannot be
222 * accessed by FieldBus/PLC interfaces, since it is reserved for external
223 * RTDE clients.
224 *
225 * @par Python interface prototype
226 * getInt32Input(self: pyaubo_sdk.RegisterControl, arg0: int) -> int
227 *
228 * @par Lua interface prototype
229 * getInt32Input(address: number) -> number
230 *
231 * @par Lua example
232 * Int32Input_0 = getInt32Input(0)
233 *
234 * @par JSON-RPC request example
235 * {"jsonrpc":"2.0","method":"RegisterControl.getInt32Input","params":[0],"id":1}
236 *
237 * @par JSON-RPC response example
238 * {"id":1,"jsonrpc":"2.0","result":0}
239 * \endchinese
240 */
241 int getInt32Input(uint32_t address);
242
243 /**
244 * @ingroup RegisterControl
245 * @ingroup RegisterControl
246 * \chinese
247 *
248 * @param address 寄存器的地址(0:47)
249 * @param value 要设置的整数值
250 * @return 返回0表示成功,其他为错误码
251 *
252 * @note 只有在实现 RTDE/Modbus Slave/PLC 服务端时使用
253 *
254 * @par Python函数原型
255 * setInt32Input(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) ->
256 * int
257 *
258 * @par Lua函数原型
259 * setInt32Input(address: number, value: number) -> nil
260 *
261 * @par Lua示例
262 * setInt32Input(0)
263 *
264 * @par JSON-RPC请求示例
265 * {"jsonrpc":"2.0","method":"RegisterControl.setInt32Input","params":[0,33],"id":1}
266 *
267 * @par JSON-RPC响应示例
268 * {"id":1,"jsonrpc":"2.0","result":0}
269 *
270 * \endchinese
271 * \english
272 *
273 * @param address Address of the register (0:47)
274 * @param value Integer value to set
275 * @return Returns 0 on success, or an error code
276 *
277 * @note Only used when implementing RTDE/Modbus Slave/PLC server
278 *
279 * @par Python interface prototype
280 * setInt32Input(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) ->
281 * int
282 *
283 * @par Lua interface prototype
284 * setInt32Input(address: number, value: number) -> nil
285 *
286 * @par Lua example
287 * setInt32Input(0)
288 *
289 * @par JSON-RPC request example
290 * {"jsonrpc":"2.0","method":"RegisterControl.setInt32Input","params":[0,33],"id":1}
291 *
292 * @par JSON-RPC response example
293 * {"id":1,"jsonrpc":"2.0","result":0}
294 *
295 * \endenglish
296 */
297 int setInt32Input(uint32_t address, int value);
298
299 /**
300 * @ingroup RegisterControl
301 * \chinese
302 * Reads the float from one of the input registers, which can also be
303 * accessed by a Field bus. Note, uses it’s own memory space.
304 *
305 * 从一个输入寄存器中读取浮点数,也可以通过现场总线进行访问。
306 * 注意,它使用自己的内存空间。
307 *
308 * @param address Address of the register (0:47)
309 * 寄存器地址(0:47)
310 * @return The value held by the register (float)
311 * 寄存器中保存的浮点数值
312 *
313 * @note The lower range of the float input registers [0:23] is reserved
314 * for FieldBus/PLC interface usage. The upper range [24:47] cannot be
315 * accessed by FieldBus/PLC interfaces, since it is reserved for external
316 * RTDE clients.
317 * 浮点数输入寄存器的较低范围[0:23]保留供现场总线/PLC接口使用。
318 * 较高范围[24:47]不能通过现场总线/PLC接口访问,因为它们是为外部RTDE客户端保留的。
319 *
320 * @par Python函数原型
321 * getFloatInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float
322 *
323 * @par Lua函数原型
324 * getFloatInput(address: number) -> number
325 *
326 * @par Lua示例
327 * FloatInput_0 = getFloatInput(0)
328 *
329 * @par JSON-RPC请求示例
330 * {"jsonrpc":"2.0","method":"RegisterControl.getFloatInput","params":[0],"id":1}
331 *
332 * @par JSON-RPC响应示例
333 * {"id":1,"jsonrpc":"2.0","result":0.0}
334 *
335 * \endchinese
336 *
337 * \english
338 * Reads the float from one of the input registers, which can also be
339 * accessed by a Field bus. Note, uses it’s own memory space.
340 *
341 * @param address Address of the register (0:47)
342 * @return The value held by the register (float)
343 *
344 * @note The lower range of the float input registers [0:23] is reserved
345 * for FieldBus/PLC interface usage. The upper range [24:47] cannot be
346 * accessed by FieldBus/PLC interfaces, since it is reserved for external
347 * RTDE clients.
348 *
349 * @par Python interface prototype
350 * getFloatInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float
351 *
352 * @par Lua interface prototype
353 * getFloatInput(address: number) -> number
354 *
355 * @par Lua example
356 * FloatInput_0_0 = getFloatInput(0)
357 *
358 * @par JSON-RPC request example
359 * {"jsonrpc":"2.0","method":"RegisterControl.getFloatInput","params":[0],"id":1}
360 *
361 * @par JSON-RPC response example
362 * {"id":1,"jsonrpc":"2.0","result":0.0}
363 */
364 float getFloatInput(uint32_t address);
365
366 /**
367 * @ingroup RegisterControl
368 * \chinese
369 *
370 * @param address 寄存器的地址(0:47)
371 * @param value 要设置的浮点数值
372 * @return 返回0表示成功,其他为错误码
373 *
374 * @note 只有在实现 RTDE/Modbus Slave/PLC 服务端时使用
375 *
376 * @par Python函数原型
377 * setFloatInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float)
378 * -> int
379 *
380 * @par Lua函数原型
381 * setFloatInput(address: number, value: number) -> nil
382 *
383 * @par Lua示例
384 * setFloatInput(0, 3.3)
385 *
386 * @par JSON-RPC请求示例
387 * {"jsonrpc":"2.0","method":"RegisterControl.setFloatInput","params":[0,3.3],"id":1}
388 *
389 * @par JSON-RPC响应示例
390 * {"id":1,"jsonrpc":"2.0","result":0}
391 *
392 * \endchinese
393 * \english
394 *
395 * @param address Address of the register (0:47)
396 * @param value Float value to set
397 * @return Returns 0 on success, or an error code
398 *
399 * @note Only used when implementing RTDE/Modbus Slave/PLC server
400 *
401 * @par Python interface prototype
402 * setFloatInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float)
403 * -> int
404 *
405 * @par Lua interface prototype
406 * setFloatInput(address: number, value: number) -> nil
407 *
408 * @par Lua example
409 * setFloatInput(0, 3.3)
410 *
411 * @par JSON-RPC request example
412 * {"jsonrpc":"2.0","method":"RegisterControl.setFloatInput","params":[0,3.3],"id":1}
413 *
414 * @par JSON-RPC response example
415 * {"id":1,"jsonrpc":"2.0","result":0}
416 *
417 * \endenglish
418 */
419 int setFloatInput(uint32_t address, float value);
420
421 /**
422 * @ingroup RegisterControl
423 * \chinese
424 *
425 * 从一个输入寄存器中读取双精度浮点数,也可以通过现场总线进行访问。
426 * 注意,它使用自己的内存空间。
427 *
428 * @param address 寄存器的地址(0:47)
429 * @return 寄存器中保存的双精度浮点数值
430 *
431 * @par Python函数原型
432 * getDoubleInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float
433 *
434 * @par Lua函数原型
435 * getDoubleInput(address: number) -> number
436 *
437 * @par Lua示例
438 * DoubleInput_0 = getDoubleInput(0)
439 *
440 * @par JSON-RPC请求示例
441 * {"jsonrpc":"2.0","method":"RegisterControl.getDoubleInput","params":[0],"id":1}
442 *
443 * @par JSON-RPC响应示例
444 * {"id":1,"jsonrpc":"2.0","result":0.0}
445 *
446 * \endchinese
447 * \english
448 *
449 * Reads the double value from one of the input registers, which can also be
450 * accessed by a FieldBus. Note, uses its own memory space.
451 *
452 * @param address Address of the register (0:47)
453 * @return The double value held by the register
454 *
455 * @par Python interface prototype
456 * getDoubleInput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float
457 *
458 * @par Lua interface prototype
459 * getDoubleInput(address: number) -> number
460 *
461 * @par Lua example
462 * DoubleInput_0 = getDoubleInput(0)
463 *
464 * @par JSON-RPC request example
465 * {"jsonrpc":"2.0","method":"RegisterControl.getDoubleInput","params":[0],"id":1}
466 *
467 * @par JSON-RPC response example
468 * {"id":1,"jsonrpc":"2.0","result":0.0}
469 *
470 * \endenglish
471 */
472 double getDoubleInput(uint32_t address);
473
474 /**
475 * \english
476 * @param address
477 * @param value
478 * @return
479 *
480 * @note Only used when implementing RTDE/Modbus Slave/PLC server
481 *
482 * @par Python interface prototype
483 * setDoubleInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float)
484 * -> int
485 *
486 * @par Lua interface prototype
487 * setDoubleInput(address: number, value: number) -> nil
488 *
489 * @par Lua example
490 * setDoubleInput(0, 3.3)
491 *
492 * @par JSON-RPC request example
493 * {"jsonrpc":"2.0","method":"RegisterControl.setDoubleInput","params":[0,6.6],"id":1}
494 *
495 * @par JSON-RPC response example
496 * {"id":1,"jsonrpc":"2.0","result":0}
497 * \endenglish
498 *
499 * @ingroup RegisterControl
500 * \chinese
501 * @param address
502 * @param value
503 * @return
504 *
505 * @note 只有在实现 RTDE/Modbus Slave/PLC 服务端时使用
506 *
507 * @par Python函数原型
508 * setDoubleInput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float)
509 * -> int
510 *
511 * @par Lua函数原型
512 * setDoubleInput(address: number, value: number) -> nil
513 *
514 * @par Lua示例
515 * setDoubleInput(0, 3.3)
516 *
517 * @par JSON-RPC请求示例
518 * {"jsonrpc":"2.0","method":"RegisterControl.setDoubleInput","params":[0,6.6],"id":1}
519 *
520 * @par JSON-RPC响应示例
521 * {"id":1,"jsonrpc":"2.0","result":0}
522 * \endchinese
523 */
524 int setDoubleInput(uint32_t address, double value);
525
526 /**
527 * @ingroup RegisterControl
528 * \chinese
529 * 从一个输出寄存器中读取布尔值,也可以通过现场总线进行访问。
530 * 注意,它使用自己的内存空间。
531 *
532 * @param address 寄存器地址(0:127)
533 * @return 寄存器中保存的布尔值(true, false)
534 *
535 * @note 布尔输出寄存器的较低范围[0:63]保留供现场总线/PLC接口使用。
536 * 较高范围[64:127]不能通过现场总线/PLC接口访问,因为它们是为外部RTDE客户端保留的。
537 *
538 * @par Python函数原型
539 * getBoolOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> bool
540 *
541 * @par Lua函数原型
542 * getBoolOutput(address: number) -> boolean
543 *
544 * @par Lua示例
545 * BoolOutput_0 = getBoolOutput(0)
546 *
547 * @par JSON-RPC请求示例
548 * {"jsonrpc":"2.0","method":"RegisterControl.getBoolOutput","params":[0],"id":1}
549 *
550 * @par JSON-RPC响应示例
551 * {"id":1,"jsonrpc":"2.0","result":false}
552 * \endchinese
553 *
554 * \english
555 * Reads the boolean from one of the output registers, which can also be
556 * accessed by a Field bus.
557 * Note, uses its own memory space.
558 *
559 * @param address Address of the register (0:127)
560 * @return The boolean value held by the register (true, false)
561 *
562 * @note The lower range of the boolean output registers [0:63] is reserved
563 * for FieldBus/PLC interface usage. The upper range [64:127] cannot be
564 * accessed by FieldBus/PLC interfaces, since it is reserved for external
565 * RTDE clients.
566 *
567 * @par Python interface prototype
568 * getBoolOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> bool
569 *
570 * @par Lua interface prototype
571 * getBoolOutput(address: number) -> boolean
572 *
573 * @par Lua example
574 * BoolOutput_0 = getBoolOutput(0)
575 *
576 * @par JSON-RPC request example
577 * {"jsonrpc":"2.0","method":"RegisterControl.getBoolOutput","params":[0],"id":1}
578 *
579 * @par JSON-RPC response example
580 * {"id":1,"jsonrpc":"2.0","result":false}
581 * \endenglish
582 */
583 bool getBoolOutput(uint32_t address);
584
585 /**
586 * @ingroup RegisterControl
587 * \chinese
588 *
589 * @param address 寄存器地址(0:127)
590 * @param value 要设置的布尔值(true 或 false)
591 * @return 返回0表示成功,其他为错误码
592 *
593 * @par Python函数原型
594 * setBoolOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: bool) ->
595 * int
596 *
597 * @par Lua函数原型
598 * setBoolOutput(address: number, value: boolean) -> nil
599 *
600 * @par Lua示例
601 * setBoolOutput(0)
602 *
603 * @par JSON-RPC请求示例
604 * {"jsonrpc":"2.0","method":"RegisterControl.setBoolOutput","params":[0,false],"id":1}
605 *
606 * @par JSON-RPC响应示例
607 * {"id":1,"jsonrpc":"2.0","result":0}
608 *
609 * \endchinese
610 * \english
611 *
612 * @param address Address of the register (0:127)
613 * @param value Boolean value to set (true or false)
614 * @return Returns 0 on success, or an error code
615 *
616 * @par Python interface prototype
617 * setBoolOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: bool) ->
618 * int
619 *
620 * @par Lua interface prototype
621 * setBoolOutput(address: number, value: boolean) -> nil
622 *
623 * @par Lua example
624 * setBoolOutput(0)
625 *
626 * @par JSON-RPC request example
627 * {"jsonrpc":"2.0","method":"RegisterControl.setBoolOutput","params":[0,false],"id":1}
628 *
629 * @par JSON-RPC response example
630 * {"id":1,"jsonrpc":"2.0","result":0}
631 *
632 * \endenglish
633 */
634 int setBoolOutput(uint32_t address, bool value);
635
636 /**
637 * @ingroup RegisterControl
638 * \chinese
639 * 从一个输出寄存器中读取整数值,也可以通过现场总线进行访问。
640 * 注意,它使用自己的内存空间。
641 *
642 * @param address 寄存器地址(0:47)
643 * @return 寄存器中保存的整数值(-2,147,483,648 : 2,147,483,647)
644 *
645 * @note 整数输出寄存器的较低范围[0:23]保留供现场总线/PLC接口使用。
646 * 较高范围[24:47]不能通过现场总线/PLC接口访问,因为它们是为外部RTDE客户端保留的。
647 *
648 * @par Python函数原型
649 * getInt32Output(self: pyaubo_sdk.RegisterControl, arg0: int) -> int
650 *
651 * @par Lua函数原型
652 * getInt32Output(address: number) -> number
653 *
654 * @par Lua示例
655 * Int32Output_0 = getInt32Output(0)
656 *
657 * @par JSON-RPC请求示例
658 * {"jsonrpc":"2.0","method":"RegisterControl.getInt32Output","params":[0],"id":1}
659 *
660 * @par JSON-RPC响应示例
661 * {"id":1,"jsonrpc":"2.0","result":0}
662 * \endchinese
663 *
664 * \english
665 * Reads the integer from one of the output registers, which can also be
666 * accessed by a FieldBus. Note, uses its own memory space.
667 *
668 * @param address Address of the register (0:47)
669 * @return The int value held by the register [-2,147,483,648 :
670 * 2,147,483,647]
671 *
672 * @note The lower range of the integer output registers [0:23] is reserved
673 * for FieldBus/PLC interface usage. The upper range [24:47] cannot be
674 * accessed by FieldBus/PLC interfaces, since it is reserved for external
675 * RTDE clients.
676 *
677 * @par Python interface prototype
678 * getInt32Output(self: pyaubo_sdk.RegisterControl, arg0: int) -> int
679 *
680 * @par Lua interface prototype
681 * getInt32Output(address: number) -> number
682 *
683 * @par Lua example
684 * Int32Output_0 = getInt32Output(0)
685 *
686 * @par JSON-RPC request example
687 * {"jsonrpc":"2.0","method":"RegisterControl.getInt32Output","params":[0],"id":1}
688 *
689 * @par JSON-RPC response example
690 * {"id":1,"jsonrpc":"2.0","result":0}
691 * \endenglish
692 */
693 int getInt32Output(uint32_t address);
694
695 /**
696 * @ingroup RegisterControl
697 * \chinese
698 *
699 * @param address 寄存器地址(0:47)
700 * @param value 要设置的整数值
701 * @return 返回0表示成功,其他为错误码
702 *
703 * @par Python函数原型
704 * setInt32Output(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) ->
705 * int
706 *
707 * @par Lua函数原型
708 * setInt32Output(address: number, value: number) -> nil
709 *
710 * @par Lua示例
711 * setInt32Output(0, 100)
712 *
713 * @par JSON-RPC请求示例
714 * {"jsonrpc":"2.0","method":"RegisterControl.setInt32Output","params":[0,100],"id":1}
715 *
716 * @par JSON-RPC响应示例
717 * {"id":1,"jsonrpc":"2.0","result":0}
718 *
719 * \endchinese
720 * \english
721 *
722 * @param address Address of the register (0:47)
723 * @param value Integer value to set
724 * @return Returns 0 on success, or an error code
725 *
726 * @par Python interface prototype
727 * setInt32Output(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int) ->
728 * int
729 *
730 * @par Lua interface prototype
731 * setInt32Output(address: number, value: number) -> nil
732 *
733 * @par Lua example
734 * setInt32Output(0, 100)
735 *
736 * @par JSON-RPC request example
737 * {"jsonrpc":"2.0","method":"RegisterControl.setInt32Output","params":[0,100],"id":1}
738 *
739 * @par JSON-RPC response example
740 * {"id":1,"jsonrpc":"2.0","result":0}
741 *
742 * \endenglish
743 */
744 int setInt32Output(uint32_t address, int value);
745
746 /**
747 * @ingroup RegisterControl
748 * \chinese
749 * 从一个输出寄存器中读取浮点数,也可以通过现场总线进行访问。
750 * 注意,它使用自己的内存空间。
751 *
752 * @param address 寄存器地址(0:47)
753 * @return 寄存器中保存的浮点数值(float)
754 *
755 * @note 浮点数输出寄存器的较低范围[0:23]保留供现场总线/PLC接口使用。
756 * 较高范围[24:47]不能通过现场总线/PLC接口访问,因为它们是为外部RTDE客户端保留的。
757 *
758 * @par Python函数原型
759 * getFloatOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float
760 *
761 * @par Lua函数原型
762 * getFloatOutput(address: number) -> number
763 *
764 * @par Lua示例
765 * FloatOutput_0 = getFloatOutput(0)
766 *
767 * @par JSON-RPC请求示例
768 * {"jsonrpc":"2.0","method":"RegisterControl.getFloatOutput","params":[0],"id":1}
769 *
770 * @par JSON-RPC响应示例
771 * {"id":1,"jsonrpc":"2.0","result":3.3}
772 * \endchinese
773 *
774 * \english
775 * Reads the float from one of the output registers, which can also be
776 * accessed by a FieldBus. Note, uses its own memory space.
777 *
778 * @param address Address of the register (0:47)
779 * @return The value held by the register (float)
780 *
781 * @note The lower range of the float output registers [0:23] is reserved
782 * for FieldBus/PLC interface usage. The upper range [24:47] cannot be
783 * accessed by FieldBus/PLC interfaces, since it is reserved for external
784 * RTDE clients.
785 *
786 * @par Python interface prototype
787 * getFloatOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float
788 *
789 * @par Lua interface prototype
790 * getFloatOutput(address: number) -> number
791 *
792 * @par Lua example
793 * FloatOutput_0 = getFloatOutput(0)
794 *
795 * @par JSON-RPC request example
796 * {"jsonrpc":"2.0","method":"RegisterControl.getFloatOutput","params":[0],"id":1}
797 *
798 * @par JSON-RPC response example
799 * {"id":1,"jsonrpc":"2.0","result":3.3}
800 * \endenglish
801 */
802 float getFloatOutput(uint32_t address);
803
804 /**
805 * @ingroup RegisterControl
806 * \chinese
807 *
808 * @param address 寄存器地址(0:47)
809 * @param value 要设置的浮点数值
810 * @return 返回0表示成功,其他为错误码
811 *
812 * @par Python函数原型
813 * setFloatOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float)
814 * -> int
815 *
816 * @par Lua函数原型
817 * setFloatOutput(address: number, value: number) -> nil
818 *
819 * @par Lua示例
820 * setFloatOutput(0,5.5)
821 *
822 * @par JSON-RPC请求示例
823 * {"jsonrpc":"2.0","method":"RegisterControl.setFloatOutput","params":[0,5.5],"id":1}
824 *
825 * @par JSON-RPC响应示例
826 * {"id":1,"jsonrpc":"2.0","result":0}
827 *
828 * \endchinese
829 * \english
830 *
831 * @param address Address of the register (0:47)
832 * @param value Float value to set
833 * @return Returns 0 on success, or an error code
834 *
835 * @par Python interface prototype
836 * setFloatOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float)
837 * -> int
838 *
839 * @par Lua interface prototype
840 * setFloatOutput(address: number, value: number) -> nil
841 *
842 * @par Lua example
843 * setFloatOutput(0,5.5)
844 *
845 * @par JSON-RPC request example
846 * {"jsonrpc":"2.0","method":"RegisterControl.setFloatOutput","params":[0,5.5],"id":1}
847 *
848 * @par JSON-RPC response example
849 * {"id":1,"jsonrpc":"2.0","result":0}
850 *
851 * \endenglish
852 */
853 int setFloatOutput(uint32_t address, float value);
854
855 /**
856 * @ingroup RegisterControl
857 * \chinese
858 *
859 * 从一个输出寄存器中读取双精度浮点数。
860 *
861 * @param address 寄存器地址
862 * @return 寄存器中保存的双精度浮点数值
863 *
864 * @par Python函数原型
865 * getDoubleOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float
866 *
867 * @par Lua函数原型
868 * getDoubleOutput(address: number) -> number
869 *
870 * @par Lua示例
871 * DoubleOutput_0 = getDoubleOutput(0)
872 *
873 * @par JSON-RPC请求示例
874 * {"jsonrpc":"2.0","method":"RegisterControl.getDoubleOutput","params":[0],"id":1}
875 *
876 * @par JSON-RPC响应示例
877 * {"id":1,"jsonrpc":"2.0","result":0.0}
878 *
879 * \endchinese
880 * \english
881 *
882 * Reads the double value from one of the output registers.
883 *
884 * @param address Address of the register
885 * @return The double value held by the register
886 *
887 * @par Python interface prototype
888 * getDoubleOutput(self: pyaubo_sdk.RegisterControl, arg0: int) -> float
889 *
890 * @par Lua interface prototype
891 * getDoubleOutput(address: number) -> number
892 *
893 * @par Lua example
894 * DoubleOutput_0 = getDoubleOutput(0)
895 *
896 * @par JSON-RPC request example
897 * {"jsonrpc":"2.0","method":"RegisterControl.getDoubleOutput","params":[0],"id":1}
898 *
899 * @par JSON-RPC response example
900 * {"id":1,"jsonrpc":"2.0","result":0.0}
901 *
902 * \endenglish
903 */
904 double getDoubleOutput(uint32_t address);
905
906 /**
907 * @ingroup RegisterControl
908 * \chinese
909 *
910 * @param address 寄存器地址
911 * @param value 要设置的双精度浮点数值
912 * @return 返回0表示成功,其他为错误码
913 *
914 * @par Python函数原型
915 * setDoubleOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float)
916 * -> int
917 *
918 * @par Lua函数原型
919 * setDoubleOutput(address: number, value: number) -> nil
920 *
921 * @par Lua示例
922 * setDoubleOutput(0,4.4)
923 *
924 * @par JSON-RPC请求示例
925 * {"jsonrpc":"2.0","method":"RegisterControl.setDoubleOutput","params":[0,4.4],"id":1}
926 *
927 * @par JSON-RPC响应示例
928 * {"id":1,"jsonrpc":"2.0","result":0}
929 *
930 * \endchinese
931 * \english
932 *
933 * @param address Address of the register
934 * @param value Double value to set
935 * @return Returns 0 on success, or an error code
936 *
937 * @par Python interface prototype
938 * setDoubleOutput(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: float)
939 * -> int
940 *
941 * @par Lua interface prototype
942 * setDoubleOutput(address: number, value: number) -> nil
943 *
944 * @par Lua example
945 * setDoubleOutput(0,4.4)
946 *
947 * @par JSON-RPC request example
948 * {"jsonrpc":"2.0","method":"RegisterControl.setDoubleOutput","params":[0,4.4],"id":1}
949 *
950 * @par JSON-RPC response example
951 * {"id":1,"jsonrpc":"2.0","result":0}
952 *
953 * \endenglish
954 */
955 int setDoubleOutput(uint32_t address, double value);
956
957 /**
958 * @ingroup RegisterControl
959 * \chinese
960 * 用于 Modbus Slave
961 *
962 * @param address
963 * @return
964 *
965 * @par Python函数原型
966 * getInt16Register(self: pyaubo_sdk.RegisterControl, arg0: int) -> int
967 *
968 * @par Lua函数原型
969 * getInt16Register(address: number) -> number
970 *
971 * @par Lua示例
972 * Int16Register_0 = getInt16Register(0)
973 *
974 * @par JSON-RPC请求示例
975 * {"jsonrpc":"2.0","method":"RegisterControl.getInt16Register","params":[0],"id":1}
976 *
977 * @par JSON-RPC响应示例
978 * {"id":1,"jsonrpc":"2.0","result":0}
979 *
980 * \endchinese
981 * \english
982 * Used for Modbus Slave
983 *
984 * @param address
985 * @return
986 *
987 * @par Python interface prototype
988 * getInt16Register(self: pyaubo_sdk.RegisterControl, arg0: int) -> int
989 *
990 * @par Lua interface prototype
991 * getInt16Register(address: number) -> number
992 *
993 * @par Lua example
994 * Int16Register_0 = getInt16Register(0)
995 *
996 * @par JSON-RPC request example
997 * {"jsonrpc":"2.0","method":"RegisterControl.getInt16Register","params":[0],"id":1}
998 *
999 * @par JSON-RPC response example
1000 * {"id":1,"jsonrpc":"2.0","result":0}
1001 *
1002 * \endenglish
1003 */
1004 int16_t getInt16Register(uint32_t address);
1005
1006 /**
1007 * @ingroup RegisterControl
1008 * \chinese
1009 *
1010 * @param address 寄存器地址
1011 * @param value 要设置的值
1012 * @return 返回0表示成功,其他为错误码
1013 *
1014 * @par Python函数原型
1015 * setInt16Register(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int)
1016 * -> int
1017 *
1018 * @par Lua函数原型
1019 * setInt16Register(address: number, value: number) -> nil
1020 *
1021 * @par Lua示例
1022 * setInt16Register(0,4.4)
1023 *
1024 * @par JSON-RPC请求示例
1025 * {"jsonrpc":"2.0","method":"RegisterControl.setInt16Register","params":[0,0],"id":1}
1026 *
1027 * @par JSON-RPC响应示例
1028 * {"id":1,"jsonrpc":"2.0","result":0}
1029 *
1030 * \endchinese
1031 * \english
1032 *
1033 * @param address Register address
1034 * @param value Value to set
1035 * @return Returns 0 on success, otherwise error code
1036 *
1037 * @par Python interface prototype
1038 * setInt16Register(self: pyaubo_sdk.RegisterControl, arg0: int, arg1: int)
1039 * -> int
1040 *
1041 * @par Lua interface prototype
1042 * setInt16Register(address: number, value: number) -> nil
1043 *
1044 * @par Lua example
1045 * setInt16Register(0,4.4)
1046 *
1047 * @par JSON-RPC request example
1048 * {"jsonrpc":"2.0","method":"RegisterControl.setInt16Register","params":[0,0],"id":1}
1049 *
1050 * @par JSON-RPC response example
1051 * {"id":1,"jsonrpc":"2.0","result":0}
1052 *
1053 * \endenglish
1054 */
1055 int setInt16Register(uint32_t address, int16_t value);
1056
1057 /**
1058 * @ingroup RegisterControl
1059 * \chinese
1060 * 获取 Int16 寄存器的某个bit的状态
1061 *
1062 * @param address: Int16 寄存器地址
1063 * @param bit_offset: 寄存器中的bit偏移,0 ~ 15
1064 * @return 指定bit的状态,true表示1,false表示0或参数无效
1065 *
1066 * @par Python函数原型
1067 * getInt16RegisterBit(self: pyaubo_sdk.RegisterControl, address: int,
1068 * bit_offset: int) -> bool
1069 *
1070 * @par Lua函数原型
1071 * getInt16RegisterBit(address: number, bit_offset: number) -> boolean
1072 *
1073 * @par JSON-RPC请求示例
1074 * {"jsonrpc":"2.0","method":"RegisterControl.getInt16RegisterBit","params":[1,
1075 * 5],"id":1}
1076 *
1077 * @par JSON-RPC响应示例
1078 * {"id":1,"jsonrpc":"2.0","result":true}
1079 *
1080 * \endchinese
1081 * \english
1082 * Get the status of a specific bit in an Int16 register
1083 *
1084 * @param address Int16 register address
1085 * @param bit_offset Bit offset in the register, 0 ~ 15
1086 * @return Status of the specified bit, true for 1, false for 0 or invalid
1087 * parameters
1088 *
1089 * @par Python interface prototype
1090 * getInt16RegisterBit(self: pyaubo_sdk.RegisterControl, address: int,
1091 * bit_offset: int) -> bool
1092 *
1093 * @par Lua interface prototype
1094 * getInt16RegisterBit(address: number, bit_offset: number) -> boolean
1095 *
1096 * @par JSON-RPC request example
1097 * {"jsonrpc":"2.0","method":"RegisterControl.getInt16RegisterBit","params":[1,
1098 * 5],"id":1}
1099 *
1100 * @par JSON-RPC response example
1101 * {"id":1,"jsonrpc":"2.0","result":true}
1102 *
1103 * \endenglish
1104 */
1105 bool getInt16RegisterBit(uint32_t address, uint8_t bit_offset);
1106
1107 /**
1108 * @ingroup RegisterControl
1109 * \chinese
1110 * 设置 Int16 寄存器的某个bit的状态
1111 *
1112 * @param address: Int16 寄存器地址
1113 * @param bit_offset: 寄存器中的bit偏移,0 ~ 15
1114 * @param value: 要设置的值,true表示置1,false表示清0
1115 * @return 成功返回0,失败返回错误码
1116 *
1117 * @par Python函数原型
1118 * setInt16RegisterBit(self: pyaubo_sdk.RegisterControl, address: int,
1119 * bit_offset: int, value: bool) -> int
1120 *
1121 * @par Lua函数原型
1122 * setInt16RegisterBit(address: number, bit_offset: number, value: boolean)
1123 * -> number
1124 *
1125 * @par JSON-RPC请求示例
1126 * {"jsonrpc":"2.0","method":"RegisterControl.setInt16RegisterBit","params":[1,
1127 * 5, true],"id":1}
1128 *
1129 * @par JSON-RPC响应示例
1130 * {"id":1,"jsonrpc":"2.0","result":0}
1131 *
1132 * \endchinese
1133 * \english
1134 * Set the status of a specific bit in an Int16 register
1135 *
1136 * @param address Int16 register address
1137 * @param bit_offset Bit offset in the register, 0 ~ 15
1138 * @param value Value to set, true to set to 1, false to clear to 0
1139 * @return Returns 0 on success, error code on failure
1140 *
1141 * @par Python interface prototype
1142 * setInt16RegisterBit(self: pyaubo_sdk.RegisterControl, address: int,
1143 * bit_offset: int, value: bool) -> int
1144 *
1145 * @par Lua interface prototype
1146 * setInt16RegisterBit(address: number, bit_offset: number, value: boolean)
1147 * -> number
1148 *
1149 * @par JSON-RPC request example
1150 * {"jsonrpc":"2.0","method":"RegisterControl.setInt16RegisterBit","params":[1,
1151 * 5, true],"id":1}
1152 *
1153 * @par JSON-RPC response example
1154 * {"id":1,"jsonrpc":"2.0","result":0}
1155 *
1156 * \endenglish
1157 */
1158 int setInt16RegisterBit(uint32_t address, uint8_t bit_offset, bool value);
1159
1160 /**
1161 * @ingroup RegisterControl
1162 * \chinese
1163 * 具名变量是否存在
1164 *
1165 * @param key 变量名
1166 * @return
1167 *
1168 * @par Lua函数原型
1169 * hasNamedVariable(key: string) -> boolean
1170 *
1171 * @par Lua示例
1172 * NamedVariable = hasNamedVariable("custom")
1173 *
1174 * @par JSON-RPC请求示例
1175 * {"jsonrpc":"2.0","method":"RegisterControl.hasNamedVariable","params":["custom"],"id":1}
1176 *
1177 * @par JSON-RPC响应示例
1178 * {"id":1,"jsonrpc":"2.0","result":false}
1179 *
1180 * \endchinese
1181 * \english
1182 * Whether the named variable exists
1183 *
1184 * @param key Variable name
1185 * @return
1186 *
1187 * @par Lua interface prototype
1188 * hasNamedVariable(key: string) -> boolean
1189 *
1190 * @par Lua example
1191 * NamedVariable = hasNamedVariable("custom")
1192 *
1193 * @par JSON-RPC request example
1194 * {"jsonrpc":"2.0","method":"RegisterControl.hasNamedVariable","params":["custom"],"id":1}
1195 *
1196 * @par JSON-RPC response example
1197 * {"id":1,"jsonrpc":"2.0","result":false}
1198 *
1199 * \endenglish
1200 */
1201 bool hasNamedVariable(const std::string &key);
1202
1203 /**
1204 * @ingroup RegisterControl
1205 * \chinese
1206 * 获取具名变量的类型
1207 *
1208 * @param key
1209 * @return
1210 *
1211 * @par Lua函数原型
1212 * getNamedVariableType(key: string) -> string
1213 *
1214 * @par Lua示例
1215 * NamedVariableType = getNamedVariableType("custom")
1216 *
1217 * @par JSON-RPC请求示例
1218 * {"jsonrpc":"2.0","method":"RegisterControl.getNamedVariableType","params":["custom"],"id":1}
1219 *
1220 * @par JSON-RPC响应示例
1221 * {"id":1,"jsonrpc":"2.0","result":"NONE"}
1222 *
1223 * \endchinese
1224 * \english
1225 * Get the type of a named variable
1226 *
1227 * @param key
1228 * @return
1229 *
1230 * @par Lua interface prototype
1231 * getNamedVariableType(key: string) -> string
1232 *
1233 * @par Lua example
1234 * NamedVariableType = getNamedVariableType("custom")
1235 *
1236 * @par JSON-RPC request example
1237 * {"jsonrpc":"2.0","method":"RegisterControl.getNamedVariableType","params":["custom"],"id":1}
1238 *
1239 * @par JSON-RPC response example
1240 * {"id":1,"jsonrpc":"2.0","result":"NONE"}
1241 *
1242 * \endenglish
1243 */
1244 std::string getNamedVariableType(const std::string &key);
1245
1246 /**
1247 * @ingroup RegisterControl
1248 * \chinese
1249 * 具名变量是否更新
1250 *
1251 * @param key
1252 * @param since
1253 * @return
1254 *
1255 * @par Python函数原型
1256 * variableUpdated(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int)
1257 * -> bool
1258 *
1259 * @par Lua函数原型
1260 * variableUpdated(key: string, since: number) -> boolean
1261 *
1262 * @par Lua示例
1263 * Variable_Updated = variableUpdated("custom" , 0)
1264 *
1265 * \endchinese
1266 *
1267 * \english
1268 * Whether the named variable has been updated
1269 *
1270 * @param key
1271 * @param since
1272 * @return
1273 *
1274 * @par Python interface prototype
1275 * variableUpdated(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int)
1276 * -> bool
1277 *
1278 * @par Lua interface prototype
1279 * variableUpdated(key: string, since: number) -> boolean
1280 *
1281 * @par Lua example
1282 * Variable_Updated = variableUpdated("custom" , 0)
1283 *
1284 * \endchinese
1285 */
1286 bool variableUpdated(const std::string &key, uint64_t since);
1287
1288 /**
1289 * @ingroup RegisterControl
1290 * \chinese
1291 * 获取变量值
1292 *
1293 * @param key
1294 * @param default_value
1295 * @return
1296 *
1297 * @par Python函数原型
1298 * getBool(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: bool) -> bool
1299 *
1300 * @par Lua函数原型
1301 * getBool(key: string, default_value: boolean) -> boolean
1302 *
1303 * @par Lua示例
1304 * Bool_var = getBool("custom",false)
1305 *
1306 * @par JSON-RPC请求示例
1307 * {"jsonrpc":"2.0","method":"RegisterControl.getBool","params":["custom",false],"id":1}
1308 *
1309 * @par JSON-RPC响应示例
1310 * {"id":1,"jsonrpc":"2.0","result":true}
1311 *
1312 * \endchinese
1313 * \english
1314 * Get variable value
1315 *
1316 * @param key
1317 * @param default_value
1318 * @return
1319 *
1320 * @par Python interface prototype
1321 * getBool(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: bool) -> bool
1322 *
1323 * @par Lua interface prototype
1324 * getBool(key: string, default_value: boolean) -> boolean
1325 *
1326 * @par Lua example
1327 * Bool_var = getBool("custom",false)
1328 *
1329 * @par JSON-RPC request example
1330 * {"jsonrpc":"2.0","method":"RegisterControl.getBool","params":["custom",false],"id":1}
1331 *
1332 * @par JSON-RPC response example
1333 * {"id":1,"jsonrpc":"2.0","result":true}
1334 *
1335 * \endenglish
1336 */
1337 bool getBool(const std::string &key, bool default_value);
1338
1339 /**
1340 * @ingroup RegisterControl
1341 * \chinese
1342 * 设置/更新变量值
1343 *
1344 * @param key
1345 * @param value
1346 * @return
1347 *
1348 * @par Python函数原型
1349 * setBool(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: bool) -> int
1350 *
1351 * @par Lua函数原型
1352 * setBool(key: string, value: boolean) -> nil
1353 *
1354 * @par Lua示例
1355 * setBool("custom",true)
1356 *
1357 * @par JSON-RPC请求示例
1358 * {"jsonrpc":"2.0","method":"RegisterControl.setBool","params":["custom",true],"id":1}
1359 *
1360 * @par JSON-RPC响应示例
1361 * {"id":1,"jsonrpc":"2.0","result":0}
1362 *
1363 * \endchinese
1364 * \english
1365 * Set or update the variable value
1366 *
1367 * @param key
1368 * @param value
1369 * @return Returns 0 on success, otherwise error code
1370 *
1371 * @par Python interface prototype
1372 * setBool(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: bool) -> int
1373 *
1374 * @par Lua interface prototype
1375 * setBool(key: string, value: boolean) -> nil
1376 *
1377 * @par Lua example
1378 * setBool("custom",true)
1379 *
1380 * @par JSON-RPC request example
1381 * {"jsonrpc":"2.0","method":"RegisterControl.setBool","params":["custom",true],"id":1}
1382 *
1383 * @par JSON-RPC response example
1384 * {"id":1,"jsonrpc":"2.0","result":0}
1385 *
1386 * \endenglish
1387 */
1388 int setBool(const std::string &key, bool value);
1389
1390 /**
1391 * @ingroup RegisterControl
1392 * \chinese
1393 * 获取变量值
1394 *
1395 * @param key
1396 * @param default_value
1397 * @return
1398 *
1399 * @par Python函数原型
1400 * getVecChar(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[str])
1401 * -> List[str]
1402 *
1403 * @par Lua函数原型
1404 * getVecChar(key: string, default_value: table) -> table
1405 *
1406 * @par Lua示例
1407 * VecChar = getVecChar("custom",{})
1408 *
1409 * @par JSON-RPC请求示例
1410 * {"jsonrpc":"2.0","method":"RegisterControl.getVecChar","params":["custom",[]],"id":1}
1411 *
1412 * @par JSON-RPC响应示例
1413 * {"id":1,"jsonrpc":"2.0","result":[0,1,0]}
1414 *
1415 * \endchinese
1416 * \english
1417 * Get variable value
1418 *
1419 * @param key
1420 * @param default_value
1421 * @return
1422 *
1423 * @par Python interface prototype
1424 * getVecChar(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[str])
1425 * -> List[str]
1426 *
1427 * @par Lua interface prototype
1428 * getVecChar(key: string, default_value: table) -> table
1429 *
1430 * @par Lua example
1431 * VecChar = getVecChar("custom",{})
1432 *
1433 * @par JSON-RPC request example
1434 * {"jsonrpc":"2.0","method":"RegisterControl.getVecChar","params":["custom",[]],"id":1}
1435 *
1436 * @par JSON-RPC response example
1437 * {"id":1,"jsonrpc":"2.0","result":[0,1,0]}
1438 *
1439 * \endenglish
1440 */
1441 std::vector<char> getVecChar(const std::string &key,
1442 const std::vector<char> &default_value);
1443
1444 /**
1445 * @ingroup RegisterControl
1446 * \chinese
1447 * 设置/更新变量值
1448 *
1449 * @param key
1450 * @param value
1451 * @return
1452 *
1453 * @par Python函数原型
1454 * setVecChar(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[str])
1455 * -> int
1456 *
1457 * @par Lua函数原型
1458 * setVecChar(key: string, value: table) -> nil
1459 *
1460 * @par Lua示例
1461 * setVecChar("custom",{0,1,0})
1462 *
1463 * @par JSON-RPC请求示例
1464 * {"jsonrpc":"2.0","method":"RegisterControl.setVecChar","params":["custom",[0,1,0]],"id":1}
1465 *
1466 * @par JSON-RPC响应示例
1467 * {"id":1,"jsonrpc":"2.0","result":0}
1468 *
1469 * \endchinese
1470 * \english
1471 * Set or update the variable value
1472 *
1473 * @param key
1474 * @param value
1475 * @return Returns 0 on success, otherwise error code
1476 *
1477 * @par Python interface prototype
1478 * setVecChar(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[str])
1479 * -> int
1480 *
1481 * @par Lua interface prototype
1482 * setVecChar(key: string, value: table) -> nil
1483 *
1484 * @par Lua example
1485 * setVecChar("custom",{0,1,0})
1486 *
1487 * @par JSON-RPC request example
1488 * {"jsonrpc":"2.0","method":"RegisterControl.setVecChar","params":["custom",[0,1,0]],"id":1}
1489 *
1490 * @par JSON-RPC response example
1491 * {"id":1,"jsonrpc":"2.0","result":0}
1492 *
1493 * \endenglish
1494 */
1495 int setVecChar(const std::string &key, const std::vector<char> &value);
1496
1497 /**
1498 * @ingroup RegisterControl
1499 * \chinese
1500 * 获取变量值
1501 *
1502 * @param key
1503 * @param default_value
1504 * @return
1505 *
1506 * @par Python函数原型
1507 * getInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int
1508 *
1509 * @par Lua函数原型
1510 * getInt32(key: string, default_value: number) -> number
1511 *
1512 * @par Lua示例
1513 * Int32 = getInt32("custom",0)
1514 *
1515 * @par JSON-RPC请求示例
1516 * {"jsonrpc":"2.0","method":"RegisterControl.getInt32","params":["custom",0],"id":1}
1517 *
1518 * @par JSON-RPC响应示例
1519 * {"id":1,"jsonrpc":"2.0","result":6}
1520 *
1521 * \endchinese
1522 * \english
1523 * Get variable value
1524 *
1525 * @param key
1526 * @param default_value
1527 * @return
1528 *
1529 * @par Python interface prototype
1530 * getInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int
1531 *
1532 * @par Lua interface prototype
1533 * getInt32(key: string, default_value: number) -> number
1534 *
1535 * @par Lua example
1536 * Int32 = getInt32("custom",0)
1537 *
1538 * @par JSON-RPC request example
1539 * {"jsonrpc":"2.0","method":"RegisterControl.getInt32","params":["custom",0],"id":1}
1540 *
1541 * @par JSON-RPC response example
1542 * {"id":1,"jsonrpc":"2.0","result":6}
1543 *
1544 * \endenglish
1545 */
1546 int getInt32(const std::string &key, int default_value);
1547
1548 /**
1549 * @ingroup RegisterControl
1550 * \chinese
1551 * 设置/更新变量值
1552 *
1553 * @param key
1554 * @param value
1555 * @return
1556 *
1557 * @par Python函数原型
1558 * setInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int
1559 *
1560 * @par Lua函数原型
1561 * setInt32(key: string, value: number) -> nil
1562 *
1563 * @par Lua示例
1564 * setInt32("custom",6)
1565 *
1566 * @par JSON-RPC请求示例
1567 * {"jsonrpc":"2.0","method":"RegisterControl.setInt32","params":["custom",6],"id":1}
1568 *
1569 * @par JSON-RPC响应示例
1570 * {"id":1,"jsonrpc":"2.0","result":0}
1571 *
1572 * \endchinese
1573 * \english
1574 * Set or update the variable value
1575 *
1576 * @param key
1577 * @param value
1578 * @return
1579 *
1580 * @par Python interface prototype
1581 * setInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int) -> int
1582 *
1583 * @par Lua interface prototype
1584 * setInt32(key: string, value: number) -> nil
1585 *
1586 * @par Lua example
1587 * setInt32("custom",6)
1588 *
1589 * @par JSON-RPC request example
1590 * {"jsonrpc":"2.0","method":"RegisterControl.setInt32","params":["custom",6],"id":1}
1591 *
1592 * @par JSON-RPC response example
1593 * {"id":1,"jsonrpc":"2.0","result":0}
1594 *
1595 * \endenglish
1596 */
1597 int setInt32(const std::string &key, int value);
1598
1599 /**
1600 * @ingroup RegisterControl
1601 * \chinese
1602 * 获取变量值
1603 *
1604 * @param key
1605 * @param default_value
1606 * @return
1607 *
1608 * @par Python函数原型
1609 * getVecInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[int])
1610 * -> List[int]
1611 *
1612 * @par Lua函数原型
1613 * getVecInt32(key: string, default_value: table) -> table
1614 *
1615 * @par Lua示例
1616 * VecInt32 = getVecInt32("custom",{})
1617 *
1618 * @par JSON-RPC请求示例
1619 * {"jsonrpc":"2.0","method":"RegisterControl.getVecInt32","params":["custom",[]],"id":1}
1620 *
1621 * @par JSON-RPC响应示例
1622 * {"id":1,"jsonrpc":"2.0","result":[1,2,3,4]}
1623 *
1624 * \endchinese
1625 * \english
1626 * Get variable value
1627 *
1628 * @param key
1629 * @param default_value
1630 * @return
1631 *
1632 * @par Python interface prototype
1633 * getVecInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[int])
1634 * -> List[int]
1635 *
1636 * @par Lua interface prototype
1637 * getVecInt32(key: string, default_value: table) -> table
1638 *
1639 * @par Lua example
1640 * VecInt32 = getVecInt32("custom",{})
1641 *
1642 * @par JSON-RPC request example
1643 * {"jsonrpc":"2.0","method":"RegisterControl.getVecInt32","params":["custom",[]],"id":1}
1644 *
1645 * @par JSON-RPC response example
1646 * {"id":1,"jsonrpc":"2.0","result":[1,2,3,4]}
1647 *
1648 * \endenglish
1649 */
1650 std::vector<int32_t> getVecInt32(const std::string &key,
1651 const std::vector<int32_t> &default_value);
1652
1653 /**
1654 * @ingroup RegisterControl
1655 * \chinese
1656 * 设置/更新变量值
1657 *
1658 * @param key
1659 * @param value
1660 * @return
1661 *
1662 * @par Python函数原型
1663 * setVecInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[int])
1664 * -> int
1665 *
1666 * @par Lua函数原型
1667 * setVecInt32(key: string, value: table) -> nil
1668 *
1669 * @par Lua示例
1670 * setVecInt32("custom",{1,2,3,4})
1671 *
1672 * @par JSON-RPC请求示例
1673 * {"jsonrpc":"2.0","method":"RegisterControl.setVecInt32","params":["custom",[1,2,3,4]],"id":1}
1674 *
1675 * @par JSON-RPC响应示例
1676 * {"id":1,"jsonrpc":"2.0","result":0}
1677 *
1678 * \endchinese
1679 * \english
1680 * Set or update the variable value
1681 *
1682 * @param key
1683 * @param value
1684 * @return
1685 *
1686 * @par Python interface prototype
1687 * setVecInt32(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: List[int])
1688 * -> int
1689 *
1690 * @par Lua interface prototype
1691 * setVecInt32(key: string, value: table) -> nil
1692 *
1693 * @par Lua example
1694 * setVecInt32("custom",{1,2,3,4})
1695 *
1696 * @par JSON-RPC request example
1697 * {"jsonrpc":"2.0","method":"RegisterControl.setVecInt32","params":["custom",[1,2,3,4]],"id":1}
1698 *
1699 * @par JSON-RPC response example
1700 * {"id":1,"jsonrpc":"2.0","result":0}
1701 *
1702 * \endenglish
1703 */
1704 int setVecInt32(const std::string &key, const std::vector<int32_t> &value);
1705
1706 /**
1707 * @ingroup RegisterControl
1708 * \chinese
1709 * 获取变量值
1710 *
1711 * @param key
1712 * @param default_value
1713 * @return
1714 *
1715 * @par Python函数原型
1716 * getFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) ->
1717 * float
1718 *
1719 * @par Lua函数原型
1720 * getFloat(key: string, default_value: number) -> number
1721 *
1722 * @par Lua示例
1723 * var_Float = getFloat("custom",0.0)
1724 *
1725 * @par JSON-RPC请求示例
1726 * {"jsonrpc":"2.0","method":"RegisterControl.getFloat","params":["custom",0.0],"id":1}
1727 *
1728 * @par JSON-RPC响应示例
1729 * {"id":1,"jsonrpc":"2.0","result":4.400000095367432}
1730 *
1731 * \endchinese
1732 * \english
1733 * Get variable value
1734 *
1735 * @param key
1736 * @param default_value
1737 * @return
1738 *
1739 * @par Python interface prototype
1740 * getFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) ->
1741 * float
1742 *
1743 * @par Lua interface prototype
1744 * getFloat(key: string, default_value: number) -> number
1745 *
1746 * @par Lua example
1747 * var_Float = getFloat("custom",0.0)
1748 *
1749 * @par JSON-RPC request example
1750 * {"jsonrpc":"2.0","method":"RegisterControl.getFloat","params":["custom",0.0],"id":1}
1751 *
1752 * @par JSON-RPC response example
1753 * {"id":1,"jsonrpc":"2.0","result":4.400000095367432}
1754 *
1755 * \endenglish
1756 */
1757 float getFloat(const std::string &key, float default_value);
1758
1759 /**
1760 * @ingroup RegisterControl
1761 * \chinese
1762 * 设置/更新变量值
1763 *
1764 * @param key
1765 * @param value
1766 * @return
1767 *
1768 * @par Python函数原型
1769 * setFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> int
1770 *
1771 * @par Lua函数原型
1772 * setFloat(key: string, value: number) -> nil
1773 *
1774 * @par Lua示例
1775 * setFloat("custom",4.4)
1776 *
1777 * @par JSON-RPC请求示例
1778 * {"jsonrpc":"2.0","method":"RegisterControl.setFloat","params":["custom",4.4],"id":1}
1779 *
1780 * @par JSON-RPC响应示例
1781 * {"id":1,"jsonrpc":"2.0","result":0}
1782 *
1783 * \endchinese
1784 * \english
1785 * Set or update the variable value
1786 *
1787 * @param key
1788 * @param value
1789 * @return
1790 *
1791 * @par Python interface prototype
1792 * setFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) -> int
1793 *
1794 * @par Lua interface prototype
1795 * setFloat(key: string, value: number) -> nil
1796 *
1797 * @par Lua example
1798 * setFloat("custom",4.4)
1799 *
1800 * @par JSON-RPC request example
1801 * {"jsonrpc":"2.0","method":"RegisterControl.setFloat","params":["custom",4.4],"id":1}
1802 *
1803 * @par JSON-RPC response example
1804 * {"id":1,"jsonrpc":"2.0","result":0}
1805 *
1806 * \endenglish
1807 */
1808 int setFloat(const std::string &key, float value);
1809
1810 /**
1811 * @ingroup RegisterControl
1812 * \chinese
1813 * 获取变量值
1814 *
1815 * @param key
1816 * @param default_value
1817 * @return
1818 *
1819 * @par Python函数原型
1820 * getVecFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
1821 * List[float]) -> List[float]
1822 *
1823 * @par Lua函数原型
1824 * getVecFloat(key: string, default_value: table) -> table
1825 *
1826 * @par Lua示例
1827 * VecFloat = getVecFloat("custom",{})
1828 *
1829 * @par JSON-RPC请求示例
1830 * {"jsonrpc":"2.0","method":"RegisterControl.getVecFloat","params":["custom",[]],"id":1}
1831 *
1832 * @par JSON-RPC响应示例
1833 * {"id":1,"jsonrpc":"2.0","result":[0.0,0.10000000149011612,3.299999952316284]}
1834 *
1835 * \endchinese
1836 * \english
1837 * Get variable value
1838 *
1839 * @param key
1840 * @param default_value
1841 * @return
1842 *
1843 * @par Python interface prototype
1844 * getVecFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
1845 * List[float]) -> List[float]
1846 *
1847 * @par Lua interface prototype
1848 * getVecFloat(key: string, default_value: table) -> table
1849 *
1850 * @par Lua example
1851 * VecFloat = getVecFloat("custom",{})
1852 *
1853 * @par JSON-RPC request example
1854 * {"jsonrpc":"2.0","method":"RegisterControl.getVecFloat","params":["custom",[]],"id":1}
1855 *
1856 * @par JSON-RPC response example
1857 * {"id":1,"jsonrpc":"2.0","result":[0.0,0.10000000149011612,3.299999952316284]}
1858 *
1859 * \endenglish
1860 */
1861 std::vector<float> getVecFloat(const std::string &key,
1862 const std::vector<float> &default_value);
1863
1864 /**
1865 * @ingroup RegisterControl
1866 * \chinese
1867 * 设置/更新变量值
1868 *
1869 * @param key
1870 * @param value
1871 * @return
1872 *
1873 * @par Python函数原型
1874 * setVecFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
1875 * List[float]) -> int
1876 *
1877 * @par Lua函数原型
1878 * setVecFloat(key: string, value: table) -> nil
1879 *
1880 * @par Lua示例
1881 * setVecFloat("custom", {0.0,0.1,3.3})
1882 *
1883 * @par JSON-RPC请求示例
1884 * {"jsonrpc":"2.0","method":"RegisterControl.setVecFloat","params":["custom",[0.0,0.1,3.3]],"id":1}
1885 *
1886 * @par JSON-RPC响应示例
1887 * {"id":1,"jsonrpc":"2.0","result":0}
1888 *
1889 * \endchinese
1890 * \english
1891 * Set or update the variable value
1892 *
1893 * @param key
1894 * @param value
1895 * @return
1896 *
1897 * @par Python interface prototype
1898 * setVecFloat(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
1899 * List[float]) -> int
1900 *
1901 * @par Lua interface prototype
1902 * setVecFloat(key: string, value: table) -> nil
1903 *
1904 * @par Lua example
1905 * setVecFloat("custom", {0.0,0.1,3.3})
1906 *
1907 * @par JSON-RPC request example
1908 * {"jsonrpc":"2.0","method":"RegisterControl.setVecFloat","params":["custom",[0.0,0.1,3.3]],"id":1}
1909 *
1910 * @par JSON-RPC response example
1911 * {"id":1,"jsonrpc":"2.0","result":0}
1912 *
1913 * \endenglish
1914 */
1915 int setVecFloat(const std::string &key, const std::vector<float> &value);
1916
1917 /**
1918 * @ingroup RegisterControl
1919 * \chinese
1920 * 获取变量值
1921 *
1922 * @param key
1923 * @param default_value
1924 * @return
1925 *
1926 * @par Python函数原型
1927 * getDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) ->
1928 * float
1929 *
1930 * @par Lua函数原型
1931 * getDouble(key: string, default_value: number) -> number
1932 *
1933 * @par Lua示例
1934 * var_Double = getDouble("custom",0.0)
1935 *
1936 * @par JSON-RPC请求示例
1937 * {"jsonrpc":"2.0","method":"RegisterControl.getDouble","params":["custom",0.0],"id":1}
1938 *
1939 * @par JSON-RPC响应示例
1940 * {"id":1,"jsonrpc":"2.0","result":0.0}
1941 *
1942 * \endchinese
1943 * \english
1944 * Get variable value
1945 *
1946 * @param key
1947 * @param default_value
1948 * @return
1949 *
1950 * @par Python interface prototype
1951 * getDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) ->
1952 * float
1953 *
1954 * @par Lua interface prototype
1955 * getDouble(key: string, default_value: number) -> number
1956 *
1957 * @par Lua example
1958 * var_Double = getDouble("custom",0.0)
1959 *
1960 * @par JSON-RPC request example
1961 * {"jsonrpc":"2.0","method":"RegisterControl.getDouble","params":["custom",0.0],"id":1}
1962 *
1963 * @par JSON-RPC response example
1964 * {"id":1,"jsonrpc":"2.0","result":0.0}
1965 *
1966 * \endenglish
1967 */
1968 double getDouble(const std::string &key, double default_value);
1969
1970 /**
1971 * @ingroup RegisterControl
1972 * \chinese
1973 * 设置/更新变量值
1974 *
1975 * @param key
1976 * @param value
1977 * @return
1978 *
1979 * @par Python函数原型
1980 * setDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) ->
1981 * int
1982 *
1983 * @par Lua函数原型
1984 * setDouble(key: string, value: number) -> nil
1985 *
1986 * @par Lua示例
1987 * setDouble("custom",6.6)
1988 *
1989 * @par JSON-RPC请求示例
1990 * {"jsonrpc":"2.0","method":"RegisterControl.setDouble","params":["custom",6.6],"id":1}
1991 *
1992 * @par JSON-RPC响应示例
1993 * {"id":1,"jsonrpc":"2.0","result":0}
1994 *
1995 * \endchinese
1996 * \english
1997 * Set or update the variable value
1998 *
1999 * @param key
2000 * @param value
2001 * @return
2002 *
2003 * @par Python interface prototype
2004 * setDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: float) ->
2005 * int
2006 *
2007 * @par Lua interface prototype
2008 * setDouble(key: string, value: number) -> nil
2009 *
2010 * @par Lua example
2011 * setDouble("custom",6.6)
2012 *
2013 * @par JSON-RPC request example
2014 * {"jsonrpc":"2.0","method":"RegisterControl.setDouble","params":["custom",6.6],"id":1}
2015 *
2016 * @par JSON-RPC response example
2017 * {"id":1,"jsonrpc":"2.0","result":0}
2018 *
2019 * \endenglish
2020 */
2021 int setDouble(const std::string &key, double value);
2022
2023 /**
2024 * @ingroup RegisterControl
2025 * \chinese
2026 * 获取变量值
2027 *
2028 * @param key
2029 * @param default_value
2030 * @return
2031 *
2032 * @par Python函数原型
2033 * getVecDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
2034 * List[float]) -> List[float]
2035 *
2036 * @par Lua函数原型
2037 * getVecDouble(key: string, default_value: table) -> table
2038 *
2039 * @par Lua示例
2040 * VecDouble = getVecDouble("custom",{})
2041 *
2042 * @par JSON-RPC请求示例
2043 * {"jsonrpc":"2.0","method":"RegisterControl.getVecDouble","params":["custom",[]],"id":1}
2044 *
2045 * @par JSON-RPC响应示例
2046 * {"id":1,"jsonrpc":"2.0","result":[0.1,0.2,0.3]}
2047 *
2048 * \endchinese
2049 * \english
2050 * Get variable value
2051 *
2052 * @param key
2053 * @param default_value
2054 * @return
2055 *
2056 * @par Python interface prototype
2057 * getVecDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
2058 * List[float]) -> List[float]
2059 *
2060 * @par Lua interface prototype
2061 * getVecDouble(key: string, default_value: table) -> table
2062 *
2063 * @par Lua example
2064 * VecDouble = getVecDouble("custom",{})
2065 *
2066 * @par JSON-RPC request example
2067 * {"jsonrpc":"2.0","method":"RegisterControl.getVecDouble","params":["custom",[]],"id":1}
2068 *
2069 * @par JSON-RPC response example
2070 * {"id":1,"jsonrpc":"2.0","result":[0.1,0.2,0.3]}
2071 *
2072 * \endenglish
2073 */
2074 std::vector<double> getVecDouble(const std::string &key,
2075 const std::vector<double> &default_value);
2076
2077 /**
2078 * @ingroup RegisterControl
2079 * \chinese
2080 * 设置/更新变量值
2081 *
2082 * @param key
2083 * @param value
2084 * @return
2085 *
2086 * @par Python函数原型
2087 * setVecDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
2088 * List[float]) -> int
2089 *
2090 * @par Lua函数原型
2091 * setVecDouble(key: string, value: table) -> nil
2092 *
2093 * @par Lua示例
2094 * setVecDouble("custom",{0.1,0.2,0.3})
2095 *
2096 * @par JSON-RPC请求示例
2097 * {"jsonrpc":"2.0","method":"RegisterControl.setVecDouble","params":["custom",[0.1,0.2,0.3]],"id":1}
2098 *
2099 * @par JSON-RPC响应示例
2100 * {"id":1,"jsonrpc":"2.0","result":0}
2101 *
2102 * \endchinese
2103 * \english
2104 * Set or update the variable value
2105 *
2106 * @param key
2107 * @param value
2108 * @return
2109 *
2110 * @par Python interface prototype
2111 * setVecDouble(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
2112 * List[float]) -> int
2113 *
2114 * @par Lua interface prototype
2115 * setVecDouble(key: string, value: table) -> nil
2116 *
2117 * @par Lua example
2118 * setVecDouble("custom",{0.1,0.2,0.3})
2119 *
2120 * @par JSON-RPC request example
2121 * {"jsonrpc":"2.0","method":"RegisterControl.setVecDouble","params":["custom",[0.1,0.2,0.3]],"id":1}
2122 *
2123 * @par JSON-RPC response example
2124 * {"id":1,"jsonrpc":"2.0","result":0}
2125 *
2126 * \endenglish
2127 */
2128 int setVecDouble(const std::string &key, const std::vector<double> &value);
2129
2130 /**
2131 * @ingroup RegisterControl
2132 * \chinese
2133 * 获取变量值
2134 *
2135 * @param key
2136 * @param default_value
2137 * @return
2138 *
2139 * @par Python函数原型
2140 * getString(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: str) -> str
2141 *
2142 * @par Lua函数原型
2143 * getString(key: string, default_value: string) -> string
2144 *
2145 * @par Lua示例
2146 * var_String = getString("custom","")
2147 *
2148 * @par JSON-RPC请求示例
2149 * {"jsonrpc":"2.0","method":"RegisterControl.getString","params":["custom",""],"id":1}
2150 *
2151 * @par JSON-RPC响应示例
2152 * {"id":1,"jsonrpc":"2.0","result":"test"}
2153 *
2154 * \endchinese
2155 * \english
2156 * Get variable value
2157 *
2158 * @param key
2159 * @param default_value
2160 * @return
2161 *
2162 * @par Python interface prototype
2163 * getString(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: str) -> str
2164 *
2165 * @par Lua interface prototype
2166 * getString(key: string, default_value: string) -> string
2167 *
2168 * @par Lua example
2169 * var_String = getString("custom","")
2170 *
2171 * @par JSON-RPC request example
2172 * {"jsonrpc":"2.0","method":"RegisterControl.getString","params":["custom",""],"id":1}
2173 *
2174 * @par JSON-RPC response example
2175 * {"id":1,"jsonrpc":"2.0","result":"test"}
2176 *
2177 * \endenglish
2178 */
2179 std::string getString(const std::string &key,
2180 const std::string &default_value);
2181
2182 /**
2183 * @ingroup RegisterControl
2184 * \chinese
2185 * 设置/更新变量值
2186 *
2187 * @param key
2188 * @param value
2189 * @return
2190 *
2191 * @par Python函数原型
2192 * setString(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: str) -> int
2193 *
2194 * @par Lua函数原型
2195 * setString(key: string, value: string) -> nil
2196 *
2197 * @par Lua示例
2198 * setString("custom","test")
2199 *
2200 * @par JSON-RPC请求示例
2201 * {"jsonrpc":"2.0","method":"RegisterControl.setString","params":["custom","test"],"id":1}
2202 *
2203 * @par JSON-RPC响应示例
2204 * {"id":1,"jsonrpc":"2.0","result":0}
2205 *
2206 * \endchinese
2207 * \english
2208 * Set or update the variable value
2209 *
2210 * @param key
2211 * @param value
2212 * @return Returns 0 on success, otherwise error code
2213 *
2214 * @par Python interface prototype
2215 * setString(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: str) -> int
2216 *
2217 * @par Lua interface prototype
2218 * setString(key: string, value: string) -> nil
2219 *
2220 * @par Lua example
2221 * setString("custom","test")
2222 *
2223 * @par JSON-RPC request example
2224 * {"jsonrpc":"2.0","method":"RegisterControl.setString","params":["custom","test"],"id":1}
2225 *
2226 * @par JSON-RPC response example
2227 * {"id":1,"jsonrpc":"2.0","result":0}
2228 *
2229 * \endenglish
2230 */
2231 int setString(const std::string &key, const std::string &value);
2232
2233 /**
2234 * @ingroup RegisterControl
2235 * \chinese
2236 * 清除变量
2237 *
2238 * @param key
2239 * @return
2240 *
2241 * @par Python函数原型
2242 * clearNamedVariable(self: pyaubo_sdk.RegisterControl, arg0: str) -> int
2243 *
2244 * @par Lua函数原型
2245 * clearNamedVariable(key: string) -> nil
2246 *
2247 * @par Lua示例
2248 * clearNamedVariable("custom")
2249 *
2250 * @par JSON-RPC请求示例
2251 * {"jsonrpc":"2.0","method":"RegisterControl.clearNamedVariable","params":["custom"],"id":1}
2252 *
2253 * @par JSON-RPC响应示例
2254 * {"id":1,"jsonrpc":"2.0","result":1}
2255 *
2256 * \endchinese
2257 * \english
2258 * Clear variable
2259 *
2260 * @param key
2261 * @return
2262 *
2263 * @par Python interface prototype
2264 * clearNamedVariable(self: pyaubo_sdk.RegisterControl, arg0: str) -> int
2265 *
2266 * @par Lua interface prototype
2267 * clearNamedVariable(key: string) -> nil
2268 *
2269 * @par Lua example
2270 * clearNamedVariable("custom")
2271 *
2272 * @par JSON-RPC request example
2273 * {"jsonrpc":"2.0","method":"RegisterControl.clearNamedVariable","params":["custom"],"id":1}
2274 *
2275 * @par JSON-RPC response example
2276 * {"id":1,"jsonrpc":"2.0","result":1}
2277 *
2278 * \endenglish
2279 */
2280 int clearNamedVariable(const std::string &key);
2281
2282 /**
2283 * @ingroup RegisterControl
2284 * \chinese
2285 * 设置看门狗
2286 *
2287 * 看门狗被触发之后控制器会执行对应的动作,并自动删除看门狗
2288 *
2289 * @param key
2290 * @param timeout 超时时间,单位秒(s),超时时间最小为 0.1s
2291 * @param action
2292 * NONE (0): 无动作
2293 * PAUSE(1): 暂停运行时
2294 * STOP (2): 停止运行时/停止机器人运动
2295 * PROTECTIVE_STOP (3): 触发防护停止
2296 * @return
2297 * \endchinese
2298 * \english
2299 * Set the watchdog
2300 *
2301 * After the watchdog is triggered, the controller will perform the
2302 * corresponding action and automatically delete the watchdog.
2303 *
2304 * @param key
2305 * @param timeout Timeout in seconds (s), minimum timeout is 0.1s
2306 * @param action
2307 * NONE (0): No action
2308 * PAUSE(1): Pause runtime
2309 * STOP (2): Stop runtime/stop robot motion
2310 * PROTECTIVE_STOP (3): Trigger protective stop
2311 * @return
2312 * \endenglish
2313 */
2314 int setWatchDog(const std::string &key, double timeout, int action);
2315
2316 /**
2317 * @ingroup RegisterControl
2318 * \chinese
2319 * 获取看门狗动作
2320 *
2321 * @param key
2322 * @return
2323 * \endchinese
2324 * \english
2325 * Get the watchdog action
2326 *
2327 * @param key
2328 * @return
2329 * \endenglish
2330 */
2331 int getWatchDogAction(const std::string &key);
2332
2333 /**
2334 * @ingroup RegisterControl
2335 * \chinese
2336 * 获取看门狗超时时间
2337 *
2338 * @param key
2339 * @return
2340 * \endchinese
2341 * \english
2342 * Get the watchdog timeout value
2343 *
2344 * @param key
2345 * @return
2346 * \endenglish
2347 */
2348 int getWatchDogTimeout(const std::string &key);
2349
2350 /**
2351 * @ingroup RegisterControl
2352 * \chinese
2353 * 添加一个新的Modbus信号以供控制器监视。不需要返回响应。
2354 *
2355 * @param device_info 设备信息
2356 * 设备信息是RTU格式,例如:"serial_port,baud,parity,data_bit,stop_bit"
2357 * (1)serial_port参数指定串口的名称,例如,在Linux上为"/dev/ttyS0"或"/dev/ttyUSB0",在Windows上为"\.\COM10"
2358 * (2)baud参数指定通信的波特率,例如9600、19200、57600、115200等
2359 * (3)parity参数指定奇偶校验方式,N表示无校验,E表示偶校验,O表示奇校验
2360 * (4)data_bit参数指定数据位数,允许的值为5、6、7和8
2361 * (5)stop_bit参数指定停止位数,允许的值为1和2
2362 *
2363 * 设备信息是TCP格式,例如:"ip address,port"
2364 * (1)ip address参数指定服务器的IP地址
2365 * (2)port参数指定服务器监听的端口号
2366 * @param slave_number 通常不使用,设置为255即可,但可以在0到255之间自由选择
2367 * @param signal_address
2368 * 指定新信号应该反映的线圈或寄存器的地址。请参考Modbus单元的配置以获取此信息。
2369 * @param signal_type 指定要添加的信号类型。0 = 数字输入,1 = 数字输出,2 =
2370 * 寄存器输入,3 = 寄存器输出。
2371 * @param signal_name
2372 * 唯一标识信号的名词。如果提供的字符串与已添加的信号相等,则新信号将替换旧信号。字符串的长度不能超过20个字符。
2373 * @param sequential_mode
2374 * 设置为True会强制Modbus客户端在发送下一个请求之前等待响应。某些fieldbus单元需要此模式。可选参数。
2375 * @return
2376 *
2377 * @par Python函数原型
2378 * modbusAddSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int,
2379 * arg2: int, arg3: int, arg4: str, arg5: bool) -> int
2380 *
2381 * @par Lua函数原型
2382 * modbusAddSignal(device_info: string, slave_number: number,
2383 * signal_address: number, signal_type: number, signal_name: string,
2384 * sequential_mode: boolean) -> nil
2385 *
2386 * @par Lua示例
2387 * modbusAddSignal("/dev/ttyRobotTool,115200,N,8,1", 1, signal_address:
2388 * number, 264, "Modbus_0", false)
2389 *
2390 * @par JSON-RPC请求示例
2391 * {"jsonrpc":"2.0","method":"RegisterControl.modbusAddSignal","params":["/dev/ttyRobotTool,115200,N,8,1",1,264,3,"Modbus_0",false],"id":1}
2392 *
2393 * @par JSON-RPC响应示例
2394 * {"id":1,"jsonrpc":"2.0","result":0}
2395 * \endchinese
2396 * \english
2397 * Adds a new modbus signal for the controller to supervise. Expects no
2398 * response.
2399 *
2400 * @param device_info is rtu format.
2401 * eg,"serial_port,baud,parity,data_bit,stop_bit"
2402 * (1)The serial_port argument specifies the name of the serial port eg. On
2403 * Linux ,"/dev/ttyS0" or "/dev/ttyUSB0". On Windows, "\.\COM10". (2)The
2404 * baud argument specifies the baud rate of the communication, eg. 9600,
2405 * 19200, 57600, 115200, etc. (3)parity:N for none,E for even,O for odd.
2406 * (4)data_bit:The data_bits argument specifies the number of bits of data,
2407 * the allowed values are 5, 6, 7 and 8. (5)stop_bit:The stop_bits argument
2408 * specifies the bits of stop, the allowed values are 1 and 2.
2409 *
2410 * device_info is tcp format.eg,"ip address,port"
2411 * (1)The ip address parameter specifies the ip address of the server
2412 * (2)The port parameter specifies the port number that the server is
2413 * listening on.
2414 * @param slave_number An integer normally not used and set to 255, but is a
2415 * free choice between 0 and 255.
2416 * @param signal_address An integer specifying the address of the either the
2417 * coil or the register that this new signal should reflect. Consult the
2418 * configuration of the modbus unit for this information.
2419 * @param signal_type An integer specifying the type of signal to add. 0 =
2420 * digital input, 1 = digital output, 2 = register input and 3 = register
2421 * output.
2422 * @param signal_name A string uniquely identifying the signal. If a string
2423 * is supplied which is equal to an already added signal, the new signal
2424 * will replace the old one. The length of the string cannot exceed 20
2425 * characters.
2426 * @param sequential_mode Setting to True forces the modbus client to wait
2427 * for a response before sending the next request. This mode is required by
2428 * some fieldbus units (Optional).
2429 * @return
2430 *
2431 * @par Python interface prototype
2432 * modbusAddSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1: int,
2433 * arg2: int, arg3: int, arg4: str, arg5: bool) -> int
2434 *
2435 * @par Lua interface prototype
2436 * modbusAddSignal(device_info: string, slave_number: number,
2437 * signal_address: number, signal_type: number, signal_name: string,
2438 * sequential_mode: boolean) -> nil
2439 *
2440 * @par Lua example
2441 * modbusAddSignal("/dev/ttyRobotTool,115200,N,8,1", 1, signal_address:
2442 * number, 264, "Modbus_0", false)
2443 *
2444 * @par JSON-RPC request example
2445 * {"jsonrpc":"2.0","method":"RegisterControl.modbusAddSignal","params":["/dev/ttyRobotTool,115200,N,8,1",1,264,3,"Modbus_0",false],"id":1}
2446 *
2447 * @par JSON-RPC response example
2448 * {"id":1,"jsonrpc":"2.0","result":0}
2449 * \endenglish
2450 */
2451 int modbusAddSignal(const std::string &device_info, int slave_number,
2452 int signal_address, int signal_type,
2453 const std::string &signal_name, bool sequential_mode);
2454
2455 /**
2456 * @ingroup RegisterControl
2457 * \chinese
2458 * 删除指定名称的信号。
2459 *
2460 * @param signal_name 要删除的信号的名称
2461 * @return
2462 *
2463 * @par Python函数原型
2464 * modbusDeleteSignal(self: pyaubo_sdk.RegisterControl, arg0: str) -> int
2465 *
2466 * @par Lua函数原型
2467 * modbusDeleteSignal(signal_name: string) -> nil
2468 *
2469 * @par Lua示例
2470 * modbusDeleteSignal("Modbus_1")
2471 *
2472 * @par JSON-RPC请求示例
2473 * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteSignal","params":["Modbus_1"],"id":1}
2474 *
2475 * @par JSON-RPC响应示例
2476 * {"id":1,"jsonrpc":"2.0","result":0}
2477 * \endchinese
2478 * \english
2479 * Deletes the signal identified by the supplied signal name.
2480 *
2481 * @param signal_name A string equal to the name of the signal that should
2482 * be deleted.
2483 * @return
2484 *
2485 * @par Python interface prototype
2486 * modbusDeleteSignal(self: pyaubo_sdk.RegisterControl, arg0: str) -> int
2487 *
2488 * @par Lua interface prototype
2489 * modbusDeleteSignal(signal_name: string) -> nil
2490 *
2491 * @par Lua example
2492 * modbusDeleteSignal("Modbus_1")
2493 *
2494 * @par JSON-RPC request example
2495 * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteSignal","params":["Modbus_1"],"id":1}
2496 *
2497 * @par JSON-RPC response example
2498 * {"id":1,"jsonrpc":"2.0","result":0}
2499 * \endenglish
2500 */
2501 int modbusDeleteSignal(const std::string &signal_name);
2502
2503 /**
2504 * @ingroup RegisterControl
2505 * \chinese
2506 * 删除所有modbus信号
2507 *
2508 * @return
2509 *
2510 * @par JSON-RPC请求示例
2511 * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteAllSignals","params":[],"id":1}
2512 *
2513 * @par JSON-RPC响应示例
2514 * {"id":1,"jsonrpc":"2.0","result":0}
2515 *
2516 * \endchinese
2517 * \english
2518 * Delete all modbus signals
2519 *
2520 * @return
2521 *
2522 * @par JSON-RPC request example
2523 * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteAllSignals","params":[],"id":1}
2524 *
2525 * @par JSON-RPC response example
2526 * {"id":1,"jsonrpc":"2.0","result":0}
2527 *
2528 * \endenglish
2529 */
2531
2532 /**
2533 * @ingroup RegisterControl
2534 * \chinese
2535 * 读取特定信号的当前值。
2536 *
2537 * @param signal_name 要获取值的信号的名称
2538 * @return 对于数字信号:1或0。
2539 * 对于寄存器信号:表示为整数的寄存器值。如果值为-1,则表示该信号不存在。
2540 *
2541 * @par Python函数原型
2542 * modbusGetSignalStatus(self: pyaubo_sdk.RegisterControl, arg0: str) -> int
2543 *
2544 * @par Lua函数原型
2545 * modbusGetSignalStatus(signal_name: string) -> number
2546 *
2547 * @par Lua示例
2548 * var0 = modbusGetSignalStatus("Modbus_0")
2549 *
2550 * @par JSON-RPC请求示例
2551 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalStatus","params":["Modbus_0"],"id":1}
2552 *
2553 * @par JSON-RPC响应示例
2554 * {"id":1,"jsonrpc":"2.0","result":1}
2555 * \endchinese
2556 * \english
2557 * Reads the current value of a specific signal.
2558 *
2559 * @param signal_name A string equal to the name of the signal for which the
2560 * value should be gotten.
2561 * @return An integer or a boolean. For digital signals: 1 or 0. For
2562 * register signals: The register value expressed as an integer. If the
2563 * value is -1, it means the signal does not exist.
2564 *
2565 * @par Python interface prototype
2566 * modbusGetSignalStatus(self: pyaubo_sdk.RegisterControl, arg0: str) -> int
2567 *
2568 * @par Lua interface prototype
2569 * modbusGetSignalStatus(signal_name: string) -> number
2570 *
2571 * @par Lua example
2572 * var0 = modbusGetSignalStatus("Modbus_0")
2573 *
2574 * @par JSON-RPC request example
2575 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalStatus","params":["Modbus_0"],"id":1}
2576 *
2577 * @par JSON-RPC response example
2578 * {"id":1,"jsonrpc":"2.0","result":1}
2579 * \endenglish
2580 */
2581 int modbusGetSignalStatus(const std::string &signal_name);
2582
2583 /**
2584 * @ingroup RegisterControl
2585 * \chinese
2586 * 获取所有信号的名字集合
2587 *
2588 * @return 所有信号的名字集合
2589 *
2590 * @par JSON-RPC请求示例
2591 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalNames","params":[],"id":1}
2592 *
2593 * @par JSON-RPC响应示例
2594 * {"id":1,"jsonrpc":"2.0","result":["Modbus_0"]}
2595 *
2596 * \endchinese
2597 * \english
2598 * Get the collection of all signal names
2599 *
2600 * @return Collection of all signal names
2601 *
2602 * @par JSON-RPC request example
2603 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalNames","params":[],"id":1}
2604 *
2605 * @par JSON-RPC response example
2606 * {"id":1,"jsonrpc":"2.0","result":["Modbus_0"]}
2607 *
2608 * \endenglish
2609 */
2610 std::vector<std::string> modbusGetSignalNames();
2611
2612 /**
2613 * @ingroup RegisterControl
2614 * \chinese
2615 * 获取所有信号的类型集合
2616 *
2617 * @return 所有信号的类型集合
2618 *
2619 * @par JSON-RPC请求示例
2620 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalTypes","params":[],"id":1}
2621 *
2622 * @par JSON-RPC响应示例
2623 * {"id":1,"jsonrpc":"2.0","result":[1,0,2,3]}
2624 *
2625 * \endchinese
2626 * \english
2627 * Get the collection of all signal types
2628 *
2629 * @return Collection of all signal types
2630 *
2631 * @par JSON-RPC request example
2632 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalTypes","params":[],"id":1}
2633 *
2634 * @par JSON-RPC response example
2635 * {"id":1,"jsonrpc":"2.0","result":[1,0,2,3]}
2636 *
2637 * \endenglish
2638 */
2639 std::vector<int> modbusGetSignalTypes();
2640
2641 /**
2642 * @ingroup RegisterControl
2643 * \chinese
2644 * 获取所有信号的数值集合
2645 *
2646 * @return 所有信号的数值集合
2647 *
2648 * @par JSON-RPC请求示例
2649 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalValues","params":[],"id":1}
2650 *
2651 * @par JSON-RPC响应示例
2652 * {"id":1,"jsonrpc":"2.0","result":[1,1,88,33]}
2653 *
2654 * \endchinese
2655 * \english
2656 * Get the collection of all signal values
2657 *
2658 * @return Collection of all signal values
2659 *
2660 * @par JSON-RPC request example
2661 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalValues","params":[],"id":1}
2662 *
2663 * @par JSON-RPC response example
2664 * {"id":1,"jsonrpc":"2.0","result":[1,1,88,33]}
2665 *
2666 * \endenglish
2667 */
2668 std::vector<int> modbusGetSignalValues();
2669
2670 /**
2671 * @ingroup RegisterControl
2672 * \chinese
2673 * 获取所有信号的请求是否有错误(0:无错误,其他:有错误)集合
2674 *
2675 * @return ModbusErrorNum
2676 *
2677 * @par JSON-RPC请求示例
2678 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalErrors","params":[],"id":1}
2679 *
2680 * @par JSON-RPC响应示例
2681 * {"id":1,"jsonrpc":"2.0","result":[6,6,6,6]}
2682 *
2683 * \endchinese
2684 * \english
2685 * Get the error status of all signal requests (0: no error, others: error)
2686 * as a collection
2687 *
2688 * @return ModbusErrorNum
2689 *
2690 * @par JSON-RPC request example
2691 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalErrors","params":[],"id":1}
2692 *
2693 * @par JSON-RPC response example
2694 * {"id":1,"jsonrpc":"2.0","result":[6,6,6,6]}
2695 *
2696 * \endenglish
2697 */
2698 std::vector<int> modbusGetSignalErrors();
2699
2700 /**
2701 * @ingroup RegisterControl
2702 * \chinese
2703 * 将用户指定的命令发送到指定IP地址上的Modbus单元。
2704 * 由于不会接收到响应,因此不能用于请求数据。
2705 * 用户负责提供对所提供的功能码有意义的数据。
2706 * 内置函数负责构建Modbus帧,因此用户不需要关心命令的长度。
2707 *
2708 * @param device_info 设备信息
2709 * 设备信息是RTU格式,例如:"serial_port,baud,parity,data_bit,stop_bit"
2710 * (1)serial_port参数指定串口的名称,例如,在Linux上为"/dev/ttyS0"或"/dev/ttyUSB0",在Windows上为"\.\COM10"
2711 * (2)baud参数指定通信的波特率,例如9600、19200、57600、115200等
2712 * (3)parity参数指定奇偶校验方式,N表示无校验,E表示偶校验,O表示奇校验
2713 * (4)data_bit参数指定数据位数,允许的值为5、6、7和8
2714 * (5)stop_bit参数指定停止位数,允许的值为1和2
2715 *
2716 * 设备信息是TCP格式,例如:"ip address,port"
2717 * (1)ip address参数指定服务器的IP地址
2718 * (2)port参数指定服务器监听的端口号
2719 * @param slave_number 指定用于自定义命令的从站号
2720 * @param function_code 指定自定义命令的功能码
2721 *
2722 * Modbus功能码
2723 * MODBUS_FC_READ_COILS 0x01
2724 * MODBUS_FC_READ_DISCRETE_INPUTS 0x02
2725 * MODBUS_FC_READ_HOLDING_REGISTERS 0x03
2726 * MODBUS_FC_READ_INPUT_REGISTERS 0x04
2727 * MODBUS_FC_WRITE_SINGLE_COIL 0x05
2728 * MODBUS_FC_WRITE_SINGLE_REGISTER 0x06
2729 * MODBUS_FC_READ_EXCEPTION_STATUS 0x07
2730 * MODBUS_FC_WRITE_MULTIPLE_COILS 0x0F
2731 * MODBUS_FC_WRITE_MULTIPLE_REGISTERS 0x10
2732 * MODBUS_FC_REPORT_SLAVE_ID 0x11
2733 * MODBUS_FC_MASK_WRITE_REGISTER 0x16
2734 * MODBUS_FC_WRITE_AND_READ_REGISTERS 0x17
2735 *
2736 * @param data 必须是有效的字节值(0-255)
2737 * @return
2738 *
2739 * @par Python函数原型
2740 * modbusSendCustomCommand(self: pyaubo_sdk.RegisterControl, arg0: str,
2741 * arg1: int, arg2: int, arg3: List[int]) -> int
2742 *
2743 * @par Lua函数原型
2744 * modbusSendCustomCommand(device_info: string, slave_number: number,
2745 * function_code: number, data: table) -> nil
2746 *
2747 * @par Lua示例
2748 * modbusSendCustomCommand("/dev/ttyRobotTool,115200,N,8,1", 1, 10,
2749 * {1,2,0,2,4,0,0,0,0}) -> nil
2750 *
2751 * @par JSON-RPC请求示例
2752 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSendCustomCommand","params":["/dev/ttyRobotTool,115200,N,8,1",1,10,[1,2,0,2,4,0,0,0,0]],"id":1}
2753 *
2754 * @par JSON-RPC响应示例
2755 * {"id":1,"jsonrpc":"2.0","result":0}
2756 * \endchinese
2757 * \english
2758 * Sends a command specified by the user to the modbus unit located on the
2759 * specified IP address. Cannot be used to request data, since the response
2760 * will not be received. The user is responsible for supplying data which
2761 * is meaningful to the supplied function code. The builtin function takes
2762 * care of constructing the modbus frame, so the user should not be
2763 * concerned with the length of the command.
2764 *
2765 * @param device_info is rtu format.
2766 * eg,"serial_port,baud,parity,data_bit,stop_bit"
2767 * (1)The serial_port argument specifies the name of the serial port eg. On
2768 * Linux ,"/dev/ttyS0" or "/dev/ttyUSB0". On Windows, "\.\COM10".
2769 * (2)The baud argument specifies the baud rate of the communication, eg.
2770 * 9600, 19200, 57600, 115200, etc.
2771 * (3)parity:N for none,E for even,O for odd.
2772 * (4)data_bit:The data_bits argument specifies the number of bits of data,
2773 * the allowed values are 5, 6, 7 and 8.
2774 * (5)stop_bit:The stop_bits argument
2775 * specifies the bits of stop, the allowed values are 1 and 2.
2776 *
2777 * device_info is tcp format.eg,"ip address,port"
2778 * (1)The ip address parameter specifies the ip address of the server
2779 * (2)The port parameter specifies the port number that the server is
2780 * listening on.
2781 * @param slave_number An integer specifying the slave number to use for
2782 * the custom command.
2783 * @param function_code An integer specifying the function code for the
2784 * custom command.
2785 *
2786 * Modbus function codes
2787 * MODBUS_FC_READ_COILS 0x01
2788 * MODBUS_FC_READ_DISCRETE_INPUTS 0x02
2789 * MODBUS_FC_READ_HOLDING_REGISTERS 0x03
2790 * MODBUS_FC_READ_INPUT_REGISTERS 0x04
2791 * MODBUS_FC_WRITE_SINGLE_COIL 0x05
2792 * MODBUS_FC_WRITE_SINGLE_REGISTER 0x06
2793 * MODBUS_FC_READ_EXCEPTION_STATUS 0x07
2794 * MODBUS_FC_WRITE_MULTIPLE_COILS 0x0F
2795 * MODBUS_FC_WRITE_MULTIPLE_REGISTERS 0x10
2796 * MODBUS_FC_REPORT_SLAVE_ID 0x11
2797 * MODBUS_FC_MASK_WRITE_REGISTER 0x16
2798 * MODBUS_FC_WRITE_AND_READ_REGISTERS 0x17
2799 *
2800 * @param data An array of integers in which each entry must be a valid
2801 * byte (0-255) value.
2802 * @return
2803 *
2804 * @par Python interface prototype
2805 * modbusSendCustomCommand(self: pyaubo_sdk.RegisterControl, arg0: str,
2806 * arg1: int, arg2: int, arg3: List[int]) -> int
2807 *
2808 * @par Lua interface prototype
2809 * modbusSendCustomCommand(device_info: string, slave_number: number,
2810 * function_code: number, data: table) -> nil
2811 *
2812 * @par Lua example
2813 * modbusSendCustomCommand("/dev/ttyRobotTool,115200,N,8,1", 1, 10,
2814 * {1,2,0,2,4,0,0,0,0}) -> nil
2815 *
2816 * @par JSON-RPC request example
2817 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSendCustomCommand","params":["/dev/ttyRobotTool,115200,N,8,1",1,10,[1,2,0,2,4,0,0,0,0]],"id":1}
2818 *
2819 * @par JSON-RPC response example
2820 * {"id":1,"jsonrpc":"2.0","result":0}
2821 * \endenglish
2822 */
2823 int modbusSendCustomCommand(const std::string &device_info,
2824 int slave_number, int function_code,
2825 const std::vector<uint8_t> &data);
2826
2827 /**
2828 * @ingroup RegisterControl
2829 * \chinese
2830 * 将选择的数字输入信号设置为“default”或“freedrive”
2831 *
2832 * @param robot_name 连接的机器人名称
2833 * @param signal_name 先前被添加的数字输入信号
2834 * @param action 操作类型。操作可以是“default”或“freedrive”
2835 * @return
2836 *
2837 * @par Python函数原型
2838 * modbusSetDigitalInputAction(self: pyaubo_sdk.RegisterControl, arg0: str,
2839 * arg1: str, arg2: int)
2840 *
2841 * @par Lua函数原型
2842 * modbusSetDigitalInputAction(robot_name: string, signal_name: string,
2843 * action: number) -> nil
2844 *
2845 * @par Lua示例
2846 * modbusSetDigitalInputAction("rob1", "Modbus_0","Handguide")
2847 *
2848 * @par JSON-RPC请求示例
2849 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetDigitalInputAction","params":["rob1","Modbus_0","Handguide"],"id":1}
2850 *
2851 * @par JSON-RPC响应示例
2852 * {"id":1,"jsonrpc":"2.0","result":0}
2853 * \endchinese
2854 * \english
2855 * Sets the selected digital input signal to either a "default" or
2856 * "freedrive" action.
2857 *
2858 * @param robot_name A string identifying a robot name that connected robot
2859 * @param signal_name A string identifying a digital input signal that was
2860 * previously added.
2861 * @param action The type of action. The action can either be "default" or
2862 * "freedrive". (string)
2863 * @return
2864 *
2865 * @par Python interface prototype
2866 * modbusSetDigitalInputAction(self: pyaubo_sdk.RegisterControl, arg0: str,
2867 * arg1: str, arg2: int)
2868 *
2869 * @par Lua interface prototype
2870 * modbusSetDigitalInputAction(robot_name: string, signal_name: string,
2871 * action: number) -> nil
2872 *
2873 * @par Lua example
2874 * modbusSetDigitalInputAction("rob1", "Modbus_0","Handguide")
2875 *
2876 * @par JSON-RPC request example
2877 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetDigitalInputAction","params":["rob1","Modbus_0","Handguide"],"id":1}
2878 *
2879 * @par JSON-RPC response example
2880 * {"id":1,"jsonrpc":"2.0","result":0}
2881 * \endenglish
2882 */
2883 int modbusSetDigitalInputAction(const std::string &robot_name,
2884 const std::string &signal_name,
2885 StandardInputAction action);
2886
2887 /**
2888 * @ingroup RegisterControl
2889 * \chinese
2890 * 设置 Modbus 信号输出动作
2891 *
2892 * @param robot_name
2893 * @param signal_name
2894 * @param runstate
2895 * @return
2896 *
2897 * @par JSON-RPC请求示例
2898 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputRunstate","params":["rob1","Modbus_0","None"],"id":1}
2899 *
2900 * @par JSON-RPC响应示例
2901 * {"id":1,"jsonrpc":"2.0","result":0}
2902 *
2903 * \endchinese
2904 * \english
2905 * Set Modbus signal output action
2906 *
2907 * @param robot_name
2908 * @param signal_name
2909 * @param runstate
2910 * @return
2911 *
2912 * @par JSON-RPC request example
2913 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputRunstate","params":["rob1","Modbus_0","None"],"id":1}
2914 *
2915 * @par JSON-RPC response example
2916 * {"id":1,"jsonrpc":"2.0","result":0}
2917 *
2918 * \endenglish
2919 */
2920 int modbusSetOutputRunstate(const std::string &robot_name,
2921 const std::string &signal_name,
2922 StandardOutputRunState runstate);
2923
2924 /**
2925 * @ingroup RegisterControl
2926 * \chinese
2927 * 将指定名称的输出寄存器信号设置为给定的值
2928 *
2929 * @param signal_name 提前被添加的输出寄存器信号
2930 * @param value 必须是有效的整数,范围是 0-65535
2931 * @return
2932 *
2933 * @par Python函数原型
2934 * modbusSetOutputSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
2935 * int) -> int
2936 *
2937 * @par Lua函数原型
2938 * modbusSetOutputSignal(signal_name: string, value: number) -> nil
2939 *
2940 * @par Lua示例
2941 * modbusSetOutputSignal("Modbus_0",0)
2942 *
2943 * @par JSON-RPC请求示例
2944 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignal","params":["Modbus_0",0],"id":1}
2945 *
2946 * @par JSON-RPC响应示例
2947 * {"id":1,"jsonrpc":"2.0","result":0}
2948 * \endchinese
2949 * \english
2950 * Sets the output register signal identified by the given name to the given
2951 * value.
2952 *
2953 * @param signal_name A string identifying an output register signal that in
2954 * advance has been added.
2955 * @param value An integer which must be a valid word (0-65535)
2956 * @return
2957 *
2958 * @par Python interface prototype
2959 * modbusSetOutputSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
2960 * int) -> int
2961 *
2962 * @par Lua interface prototype
2963 * modbusSetOutputSignal(signal_name: string, value: number) -> nil
2964 *
2965 * @par Lua example
2966 * modbusSetOutputSignal("Modbus_0",0)
2967 *
2968 * @par JSON-RPC request example
2969 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignal","params":["Modbus_0",0],"id":1}
2970 *
2971 * @par JSON-RPC response example
2972 * {"id":1,"jsonrpc":"2.0","result":0}
2973 * \endenglish
2974 */
2975 int modbusSetOutputSignal(const std::string &signal_name, uint16_t value);
2976
2977 /**
2978 * @ingroup RegisterControl
2979 * \chinese
2980 * 将从指定名称开始的若干个连续输出寄存器信号设置为给定的值
2981 *
2982 * @param signal_name 提前被添加的输出寄存器信号的起始名称
2983 * @param values 整数数组,每个元素范围是 0-65535,对应连续的多个信号
2984 * @return
2985 *
2986 * @par Python函数原型
2987 * modbusSetOutputSignal1(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
2988 * list[int]) -> int
2989 *
2990 * @par Lua函数原型
2991 * modbusSetOutputSignal1(signal_name: string, value: table) -> nil
2992 *
2993 * @par Lua示例
2994 * modbusSetOutputSignal1("Modbus_0", {0, 1, 2})
2995 *
2996 * @par JSON-RPC请求示例
2997 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignal1","params":["Modbus_0",[0,1,2]],"id":1}
2998 *
2999 * @par JSON-RPC响应示例
3000 * {"id":1,"jsonrpc":"2.0","result":0}
3001 * \endchinese
3002 * \english
3003 * Sets multiple consecutive output register signals starting from the given
3004 * name to the given values.
3005 *
3006 * @param signal_name A string identifying the starting output register
3007 * signal that in advance has been added.
3008 * @param values An array of integers where each element must be a valid
3009 * word (0-65535), corresponding to multiple consecutive signals
3010 * @return
3011 *
3012 * @par Python interface prototype
3013 * modbusSetOutputSignal1(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
3014 * list[int]) -> int
3015 *
3016 * @par Lua interface prototype
3017 * modbusSetOutputSignal1(signal_name: string, value: table) -> nil
3018 *
3019 * @par Lua example
3020 * modbusSetOutputSignal1("Modbus_0", {0, 1, 2})
3021 *
3022 * @par JSON-RPC request example
3023 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignal1","params":["Modbus_0",[0,1,2]],"id":1}
3024 *
3025 * @par JSON-RPC response example
3026 * {"id":1,"jsonrpc":"2.0","result":0}
3027 * \endenglish
3028 */
3029 int modbusSetOutputSignal1(const std::string &signal_name,
3030 const std::vector<uint16_t> &values);
3031
3032 /**
3033 * \chinese
3034 * 将指定名称的输出寄存器信号设置为给定的值,并且带超时判断
3035 *
3036 * @param signal_name 提前被添加的输出寄存器信号
3037 * @param value 必须是有效的整数,范围是 0-65535
3038 * @param timeout 超时时间,单位秒
3039 * @return
3040 *
3041 * @par Python函数原型
3042 * modbusSetOutputSignalWithTimeout(self: pyaubo_sdk.RegisterControl, arg0:
3043 * str, arg1: int, arg2: double) -> int
3044 *
3045 * @par Lua函数原型
3046 * modbusSetOutputSignalWithTimeout(signal_name: string, value: number,
3047 * timeout: number) -> nil
3048 *
3049 * @par Lua示例
3050 * modbusSetOutputSignalWithTimeout("Modbus_0",0,0.5)
3051 *
3052 * @par JSON-RPC请求示例
3053 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignalWithTimeout","params":["Modbus_0",0,0.5],"id":1}
3054 *
3055 * @par JSON-RPC响应示例
3056 * {"id":1,"jsonrpc":"2.0","result":0}
3057 * \endchinese
3058 * \english
3059 * Sets the output register signal identified by the given name to the
3060 * given, with timeout value.
3061 *
3062 * @param signal_name A string identifying an output register signal that in
3063 * advance has been added.
3064 * @param value An integer which must be a valid word (0-65535)
3065 * @param timeout seconds
3066 * @return
3067 *
3068 * @par Python interface prototype
3069 * modbusSetOutputSignalWithTimeout(self: pyaubo_sdk.RegisterControl, arg0:
3070 * str, arg1: int, arg2: timeout) -> int
3071 *
3072 * @par Lua interface prototype
3073 * modbusSetOutputSignalWithTimeout(signal_name: string, value: number,
3074 * timeout: number) -> nil
3075 *
3076 * @par Lua example
3077 * modbusSetOutputSignalWithTimeout("Modbus_0",0,0.5)
3078 *
3079 * @par JSON-RPC request example
3080 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignalWithTimeout","params":["Modbus_0",0,0.5],"id":1}
3081 *
3082 * @par JSON-RPC response example
3083 * {"id":1,"jsonrpc":"2.0","result":0}
3084 * \endenglish
3085 */
3086 int modbusSetOutputSignalWithTimeout(const std::string &signal_name,
3087 uint16_t value, double timeout);
3088
3089 /**
3090 * @ingroup RegisterControl
3091 * \chinese
3092 * 设置modbus信号输出脉冲(仅支持线圈输出类型)
3093 *
3094 * @param signal_name: 提前被添加的输出寄存器信号
3095 * @param value: 必须是有效的整数,范围是 0-65535
3096 * @param duration: 信号持续时间,单位为秒
3097 * @return
3098 *
3099 * @par Python函数原型
3100 * modbusSetOutputSignalPulse(self: pyaubo_sdk.RegisterControl, arg0: str,
3101 * arg1: int, arg2 double) -> int
3102 *
3103 * @par Lua函数原型
3104 * modbusSetOutputSignalPulse(signal_name: string, value: number, duration:
3105 * number) -> nil
3106 *
3107 * @par Lua示例
3108 * modbusSetOutputSignalPulse("Modbus_0",1,0.5)
3109 *
3110 * @par JSON-RPC请求示例
3111 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignalPulse","params":["Modbus_0",1,0.5],"id":1}
3112 *
3113 * @par JSON-RPC响应示例
3114 * {"id":1,"jsonrpc":"2.0","result":0}
3115 *
3116 * \endchinese
3117 * \english
3118 * Set modbus signal output pulse (only supports coil output type)
3119 *
3120 * @param signal_name: A string identifying an output register signal that
3121 * has been added in advance.
3122 * @param value: An integer which must be a valid word (0-65535)
3123 * @param duration: Duration of the signal, in seconds
3124 * @return
3125 *
3126 * @par Python interface prototype
3127 * modbusSetOutputSignalPulse(self: pyaubo_sdk.RegisterControl, arg0: str,
3128 * arg1: int, arg2: double) -> int
3129 *
3130 * @par Lua interface prototype
3131 * modbusSetOutputSignalPulse(signal_name: string, value: number, duration:
3132 * number) -> nil
3133 *
3134 * @par Lua example
3135 * modbusSetOutputSignalPulse("Modbus_0",1,0.5)
3136 *
3137 * @par JSON-RPC request example
3138 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignalPulse","params":["Modbus_0",1,0.5],"id":1}
3139 *
3140 * @par JSON-RPC response example
3141 * {"id":1,"jsonrpc":"2.0","result":0}
3142 *
3143 * \endenglish
3144 */
3145 int modbusSetOutputSignalPulse(const std::string &signal_name,
3146 uint16_t value, double duration);
3147
3148 /**
3149 * @ingroup RegisterControl
3150 * \chinese
3151 * 设置机器人向Modbus控制器发送请求的频率,用于读取或写入信号值
3152 *
3153 * @param signal_name 提前被添加的输出数字信号
3154 * @param update_frequency 更新频率(以赫兹为单位),范围是0-125
3155 * @return
3156 *
3157 * @par Python函数原型
3158 * modbusSetSignalUpdateFrequency(self: pyaubo_sdk.RegisterControl, arg0:
3159 * str, arg1: int) -> int
3160 *
3161 * @par Lua函数原型
3162 * modbusSetSignalUpdateFrequency(signal_name: string, update_frequency:
3163 * number) -> nil
3164 *
3165 * @par Lua示例
3166 * modbusSetSignalUpdateFrequency("Modbus_0",1)
3167 *
3168 * @par JSON-RPC请求示例
3169 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetSignalUpdateFrequency","params":["Modbus_0",1],"id":1}
3170 *
3171 * @par JSON-RPC响应示例
3172 * {"id":1,"jsonrpc":"2.0","result":0}
3173 * \endchinese
3174 * \english
3175 * Sets the frequency with which the robot will send requests to the Modbus
3176 * controller to either read or write the signal value.
3177 *
3178 * @param signal_name A string identifying an output digital signal that
3179 * in advance has been added.
3180 * @param update_frequency An integer in the range 0-125 specifying the
3181 * update frequency in Hz.
3182 * @return
3183 *
3184 * @par Python interface prototype
3185 * modbusSetSignalUpdateFrequency(self: pyaubo_sdk.RegisterControl, arg0:
3186 * str, arg1: int) -> int
3187 *
3188 * @par Lua interface prototype
3189 * modbusSetSignalUpdateFrequency(signal_name: string, update_frequency:
3190 * number) -> nil
3191 *
3192 * @par Lua example
3193 * modbusSetSignalUpdateFrequency("Modbus_0",1)
3194 *
3195 * @par JSON-RPC request example
3196 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetSignalUpdateFrequency","params":["Modbus_0",1],"id":1}
3197 *
3198 * @par JSON-RPC response example
3199 * {"id":1,"jsonrpc":"2.0","result":0}
3200 * \endenglish
3201 */
3202 int modbusSetSignalUpdateFrequency(const std::string &signal_name,
3203 int update_frequency);
3204
3205 /**
3206 * @ingroup RegisterControl
3207 * \chinese
3208 * 获取指定 modbus 信号索引,从0开始,不能存在则返回-1
3209 *
3210 * @param signal_name
3211 * @return
3212 *
3213 * @par JSON-RPC请求示例
3214 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalIndex","params":["Modbus_0"],"id":1}
3215 *
3216 * @par JSON-RPC响应示例
3217 * {"id":1,"jsonrpc":"2.0","result":0}
3218 *
3219 * \endchinese
3220 * \english
3221 * Get the index of the specified modbus signal, starting from 0. Returns -1
3222 * if it does not exist.
3223 *
3224 * @param signal_name
3225 * @return
3226 *
3227 * @par JSON-RPC request example
3228 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalIndex","params":["Modbus_0"],"id":1}
3229 *
3230 * @par JSON-RPC response example
3231 * {"id":1,"jsonrpc":"2.0","result":0}
3232 *
3233 * \endenglish
3234 */
3235 int modbusGetSignalIndex(const std::string &signal_name);
3236
3237 /**
3238 * @ingroup RegisterControl
3239 * \chinese
3240 * 获取指定 modbus 信号的错误状态
3241 *
3242 * @param signal_name
3243 * @return 返回错误代码 ModbusErrorNum
3244 *
3245 * @par JSON-RPC请求示例
3246 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalError","params":["Modbus_0"],"id":1}
3247 *
3248 * @par JSON-RPC响应示例
3249 * {"id":1,"jsonrpc":"2.0","result":6}
3250 * \endchinese
3251 * \english
3252 * Get the error status of the specified modbus signal
3253 *
3254 * @param signal_name
3255 * @return Returns error code ModbusErrorNum
3256 *
3257 * @par JSON-RPC request example
3258 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalError","params":["Modbus_0"],"id":1}
3259 *
3260 * @par JSON-RPC response example
3261 * {"id":1,"jsonrpc":"2.0","result":6}
3262 * \endenglish
3263 */
3264 int modbusGetSignalError(const std::string &signal_name);
3265
3266 /**
3267 * @ingroup RegisterControl
3268 * \chinese
3269 * 获取指定 modbus 设备的连接状态
3270 *
3271 * @param device_name
3272 * 设备名是TCP格式,"ip:port", 例如:"127.0.0.1:502" \n
3273 * 设备名是RTU格式,"serial_port", 例如:"/dev/ttyUSB0" \n
3274 *
3275 * @return
3276 * 0: 表示设备处于连接状态
3277 * -1: 表示设备不存在
3278 * -2: 表示设备处于断开状态
3279 *
3280 * @par JSON-RPC请求示例
3281 * {"jsonrpc":"2.0","method":"RegisterControl.getModbusDeviceStatus","params":["172.16.26.248:502"],"id":1}
3282 *
3283 * @par JSON-RPC响应示例
3284 * {"id":1,"jsonrpc":"2.0","result":0}
3285 *
3286 * \endchinese
3287 * \english
3288 * Get the connection status of the specified modbus device
3289 *
3290 * @param device_name
3291 * Device name in TCP format: "ip:port", e.g. "127.0.0.1:502" \n
3292 * Device name in RTU format: "serial_port", e.g. "/dev/ttyUSB0" \n
3293 *
3294 * @return
3295 * 0: Device is connected
3296 * -1: Device does not exist
3297 * -2: Device is disconnected
3298 *
3299 * @par JSON-RPC request example
3300 * {"jsonrpc":"2.0","method":"RegisterControl.getModbusDeviceStatus","params":["172.16.26.248:502"],"id":1}
3301 *
3302 * @par JSON-RPC response example
3303 * {"id":1,"jsonrpc":"2.0","result":0}
3304 *
3305 * \endenglish
3306 */
3307 int getModbusDeviceStatus(const std::string &device_name);
3308
3309 /**
3310 * @ingroup RegisterControl
3311 * \chinese
3312 * 将某个 modbus 寄存器信号作为编码器
3313 *
3314 * @param encoder_id 不能为0
3315 * @param signal_name modbus 信号名字,必须为寄存器类型
3316 * @return
3317 * \endchinese
3318 * \english
3319 * Use a modbus register signal as an encoder
3320 *
3321 * @param encoder_id Must not be 0
3322 * @param signal_name Name of the modbus signal, must be of register type
3323 * @return
3324 * \endenglish
3325 */
3326 int addModbusEncoder(int encoder_id, int range_id,
3327 const std::string &signal_name);
3328
3329 /**
3330 * @ingroup RegisterControl
3331 * \chinese
3332 * 添加Int32寄存器的虚拟编码器
3333 *
3334 * @param encoder_id 编码器ID
3335 * @param range_id 范围ID
3336 * @param key 变量名
3337 * @return
3338 * \endchinese
3339 * \english
3340 * Add a virtual encoder for an Int32 register
3341 *
3342 * @param encoder_id Encoder ID
3343 * @param range_id Range ID
3344 * @param key Variable name
3345 * @return
3346 * \endenglish
3347 */
3348 int addInt32RegEncoder(int encoder_id, int range_id,
3349 const std::string &key);
3350
3351 /**
3352 * @ingroup RegisterControl
3353 * \chinese
3354 * 删除虚拟编码器
3355 *
3356 * @param encoder_id
3357 * @return
3358 * \endchinese
3359 * \english
3360 * Delete virtual encoder
3361 *
3362 * @param encoder_id
3363 * @return
3364 * \endenglish
3365 */
3366 int deleteVirtualEncoder(int encoder_id);
3367
3368protected:
3369 void *d_;
3370};
3371using RegisterControlPtr = std::shared_ptr<RegisterControl>;
3372
3373} // namespace common_interface
3374} // namespace arcs
3375
3376#endif // AUBO_SDK_REGISTER_CONTROL_INTERFACE_H
int modbusSetOutputSignalWithTimeout(const std::string &signal_name, uint16_t value, double timeout)
将指定名称的输出寄存器信号设置为给定的值,并且带超时判断
float getFloatOutput(uint32_t address)
从一个输出寄存器中读取浮点数,也可以通过现场总线进行访问。 注意,它使用自己的内存空间。
int setVecChar(const std::string &key, const std::vector< char > &value)
设置/更新变量值
int getInt32Output(uint32_t address)
从一个输出寄存器中读取整数值,也可以通过现场总线进行访问。 注意,它使用自己的内存空间。
int setBool(const std::string &key, bool value)
设置/更新变量值
int deleteVirtualEncoder(int encoder_id)
删除虚拟编码器
int setVecFloat(const std::string &key, const std::vector< float > &value)
设置/更新变量值
int setVecInt32(const std::string &key, const std::vector< int32_t > &value)
设置/更新变量值
int getModbusDeviceStatus(const std::string &device_name)
获取指定 modbus 设备的连接状态
bool getBoolInput(uint32_t address)
从一个输入寄存器中读取布尔值,也可以通过现场总线进行访问。 注意,它使用自己的内存空间。
bool getBool(const std::string &key, bool default_value)
获取变量值
std::vector< double > getVecDouble(const std::string &key, const std::vector< double > &default_value)
获取变量值
int modbusDeleteAllSignals()
删除所有modbus信号
std::vector< int > modbusGetSignalErrors()
获取所有信号的请求是否有错误(0:无错误,其他:有错误)集合
double getDoubleOutput(uint32_t address)
从一个输出寄存器中读取双精度浮点数。
std::vector< int32_t > getVecInt32(const std::string &key, const std::vector< int32_t > &default_value)
获取变量值
int modbusGetSignalIndex(const std::string &signal_name)
获取指定 modbus 信号索引,从0开始,不能存在则返回-1
bool getInt16RegisterBit(uint32_t address, uint8_t bit_offset)
获取 Int16 寄存器的某个bit的状态
int setInt32(const std::string &key, int value)
设置/更新变量值
std::vector< std::string > modbusGetSignalNames()
获取所有信号的名字集合
int modbusAddSignal(const std::string &device_info, int slave_number, int signal_address, int signal_type, const std::string &signal_name, bool sequential_mode)
添加一个新的Modbus信号以供控制器监视。不需要返回响应。
int getWatchDogTimeout(const std::string &key)
获取看门狗超时时间
int getInt32Input(uint32_t address)
从一个输入寄存器中读取整数值,也可以通过现场总线进行访问。 注意,它使用自己的内存空间。
int setVecDouble(const std::string &key, const std::vector< double > &value)
设置/更新变量值
int setInt16Register(uint32_t address, int16_t value)
float getFloatInput(uint32_t address)
Reads the float from one of the input registers, which can also be accessed by a Field bus.
bool hasNamedVariable(const std::string &key)
具名变量是否存在
int getWatchDogAction(const std::string &key)
获取看门狗动作
std::string getNamedVariableType(const std::string &key)
获取具名变量的类型
std::vector< int > modbusGetSignalTypes()
获取所有信号的类型集合
int16_t getInt16Register(uint32_t address)
用于 Modbus Slave
int setInt32Input(uint32_t address, int value)
int getInt32(const std::string &key, int default_value)
获取变量值
int modbusSetOutputSignal(const std::string &signal_name, uint16_t value)
将指定名称的输出寄存器信号设置为给定的值
int setString(const std::string &key, const std::string &value)
设置/更新变量值
int modbusGetSignalError(const std::string &signal_name)
获取指定 modbus 信号的错误状态
int setFloat(const std::string &key, float value)
设置/更新变量值
int modbusSetOutputSignal1(const std::string &signal_name, const std::vector< uint16_t > &values)
将从指定名称开始的若干个连续输出寄存器信号设置为给定的值
int setDouble(const std::string &key, double value)
设置/更新变量值
int setWatchDog(const std::string &key, double timeout, int action)
设置看门狗
int modbusSetOutputRunstate(const std::string &robot_name, const std::string &signal_name, StandardOutputRunState runstate)
设置 Modbus 信号输出动作
int modbusSetOutputSignalPulse(const std::string &signal_name, uint16_t value, double duration)
设置modbus信号输出脉冲(仅支持线圈输出类型)
double getDouble(const std::string &key, double default_value)
获取变量值
int setInt16RegisterBit(uint32_t address, uint8_t bit_offset, bool value)
设置 Int16 寄存器的某个bit的状态
bool getBoolOutput(uint32_t address)
从一个输出寄存器中读取布尔值,也可以通过现场总线进行访问。 注意,它使用自己的内存空间。
int setDoubleOutput(uint32_t address, double value)
int modbusSendCustomCommand(const std::string &device_info, int slave_number, int function_code, const std::vector< uint8_t > &data)
将用户指定的命令发送到指定IP地址上的Modbus单元。 由于不会接收到响应,因此不能用于请求数据。 用户负责提供对所提供的功能码有意义的数据。 内置函数负责构建Modbus帧,因此用户不需要关心命令的...
bool variableUpdated(const std::string &key, uint64_t since)
具名变量是否更新
std::vector< float > getVecFloat(const std::string &key, const std::vector< float > &default_value)
获取变量值
std::vector< int > modbusGetSignalValues()
获取所有信号的数值集合
int addInt32RegEncoder(int encoder_id, int range_id, const std::string &key)
添加Int32寄存器的虚拟编码器
std::string getString(const std::string &key, const std::string &default_value)
获取变量值
int modbusGetSignalStatus(const std::string &signal_name)
读取特定信号的当前值。
int addModbusEncoder(int encoder_id, int range_id, const std::string &signal_name)
将某个 modbus 寄存器信号作为编码器
double getDoubleInput(uint32_t address)
从一个输入寄存器中读取双精度浮点数,也可以通过现场总线进行访问。 注意,它使用自己的内存空间。
int clearNamedVariable(const std::string &key)
清除变量
int modbusSetSignalUpdateFrequency(const std::string &signal_name, int update_frequency)
设置机器人向Modbus控制器发送请求的频率,用于读取或写入信号值
int setBoolInput(uint32_t address, bool value)
int setInt32Output(uint32_t address, int value)
int setFloatInput(uint32_t address, float value)
int setBoolOutput(uint32_t address, bool value)
int modbusDeleteSignal(const std::string &signal_name)
删除指定名称的信号。
int setDoubleInput(uint32_t address, double value)
int setFloatOutput(uint32_t address, float value)
int modbusSetDigitalInputAction(const std::string &robot_name, const std::string &signal_name, StandardInputAction action)
将选择的数字输入信号设置为“default”或“freedrive”
std::vector< char > getVecChar(const std::string &key, const std::vector< char > &default_value)
获取变量值
float getFloat(const std::string &key, float default_value)
获取变量值
StandardInputAction
The StandardInputAction enum
StandardOutputRunState
标准输出运行状态
std::shared_ptr< RegisterControl > RegisterControlPtr
@ MB_ERR_NOT_INIT
MODBUS unit not initiallized
@ MB_ERR_SLAVE_DEVICE_BUSY
Specialized use in conjunction with programming commands sent to the remote MODBUS unit,...
@ MB_ERR_ILLEGAL_FUNCTION
The function code received in the query is not an allowable action for the server (or slave).
@ MB_ERR_ILLEGAL_DATA_ADDRESS
The function code received in the query is not an allowable action for the server (or slave),...
@ MB_ERR_DISCONNECTED
MODBUS unit disconnected
@ MB_ERR_SLAVE_DEVICE_FAILURE
An unrecoverable error occurred while the server (or slave) was attempting to perform the requested a...
@ MB_ERR_ILLEGAL_DATA_VALUE
A value contained in the query data field is not an allowable value for server (or slave),...
@ MB_ERR_ACKNOWLEDGE
Specialized use in conjunction with programming commands sent to the remote MODBUS unit.
数据类型的定义