AUBO SDK  0.26.0
register_control.h
Go to the documentation of this file.
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 * 为指定Modbus寄存器信号创建固定读取分组,优化连续地址的批量读取效率
2459 *
2460 * 功能:根据传入的起始信号名定位到对应的16位Modbus寄存器地址,
2461 * 并基于该起始地址和连续数量创建“不可扩展的固定分组”,该分组会被独立管理,
2462 * 不会与其他普通分组合并或扩展,适用于需要稳定、原子化读取的连续寄存器地址段;
2463 * 固定分组创建后,对该段地址的读取操作会严格按照分组范围执行,避免因动态分组扩展导致的读取范围变化。
2464 *
2465 * @param signal_name
2466 * 起始信号名(作为固定分组的基准信号,需为已通过modbusAddSignal创建的16位Modbus寄存器信号,
2467 * 支持保持寄存器/输入寄存器类型,不支持数字量信号)
2468 * @param count 固定分组包含的连续信号(寄存器)数量(大于等于1):
2469 * - 值为1:
2470 * 仅包含起始信号对应的单个寄存器地址(取消包含该信号的固定分组);
2471 * - 值>1:
2472 * 从起始信号地址开始的连续count个寄存器地址,需确保地址连续且不超出设备支持范围;
2473 *
2474 * @return 成功返回0,失败返回错误码。
2475 *
2476 * @note
2477 * 1. 该接口仅针对16位Modbus寄存器信号(signal_type为2/3)生效;
2478 * 2. 单个固定分组的最大连续数量受设备限制(默认最大30个);
2479 * 3. 重复为同一信号创建固定分组会覆盖原有配置(以最后一次的count值为准)。
2480 *
2481 * @par Python接口原型
2482 * addFixedModbusGroup(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
2483 * int) -> int
2484 *
2485 * @par Lua接口原型
2486 * addFixedModbusGroup(signal_name: string, count: number) -> nil
2487 *
2488 * @par Lua示例
2489 * -- 为起始信号"Modbus_0"创建包含10个连续寄存器的固定分组
2490 * addFixedModbusGroup("Modbus_0", 10)
2491 *
2492 * @par JSON-RPC请求示例
2493 * {"jsonrpc":"2.0","method":"RegisterControl.addFixedModbusGroup","params":["Modbus_0",10],"id":1}
2494 *
2495 * @par JSON-RPC响应示例
2496 * {"id":1,"jsonrpc":"2.0","result":0}
2497 * \endchinese
2498 * \english
2499 * Create a fixed read group for the specified Modbus register signal to
2500 * optimize the batch reading efficiency of continuous addresses
2501 *
2502 * Function: Locate the address of the corresponding 16-bit Modbus register
2503 * according to the input start signal name, and create a "non-extensible
2504 * fixed group" based on the start address and continuous count. This group
2505 * will be managed independently, and will not be merged or expanded with
2506 * other normal groups. It is suitable for continuous register address
2507 * segments that require stable and atomic reading; After the fixed group is
2508 * created, the read operation for this address segment will be strictly
2509 * executed according to the group range, avoiding read range changes caused
2510 * by dynamic group expansion.
2511 *
2512 * @param signal_name
2513 * Start signal name (used as the reference signal for the fixed group, must
2514 * be a 16-bit Modbus register signal created via modbusAddSignal,
2515 * supporting holding register/input register types, not supporting digital
2516 * signals)
2517 * @param count Number of continuous signals (registers) contained in the
2518 * fixed group (greater than or equal to 1):
2519 * - Value = 1: Only include the single register address
2520 * corresponding to the start signal (cancel the fixed group containing this
2521 * signal);
2522 * - Value > 1: Continuous count register addresses starting
2523 * from the start signal address, ensure the addresses are continuous and do
2524 * not exceed the device support range;
2525 *
2526 * @return Returns 0 on success, returns an error code on failure.
2527 *
2528 * @note
2529 * 1. This interface only takes effect for 16-bit Modbus register signals
2530 * (signal_type is 2/3);
2531 * 2. The maximum continuous count of a single fixed group is limited by the
2532 * device (default maximum 30);
2533 * 3. Repeated creation of a fixed group for the same start signal will
2534 * overwrite the original configuration (the last count value shall
2535 * prevail).
2536 *
2537 * @par Python interface prototype
2538 * addFixedModbusGroup(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
2539 * int) -> int
2540 *
2541 * @par Lua interface prototype
2542 * addFixedModbusGroup(signal_name: string, count: number) -> nil
2543 *
2544 * @par Lua example
2545 * -- Create a fixed group containing 10 consecutive registers for the start
2546 * signal "Modbus_0" addFixedModbusGroup("Modbus_0", 10)
2547 *
2548 * @par JSON-RPC request example
2549 * {"jsonrpc":"2.0","method":"RegisterControl.addFixedModbusGroup","params":["Modbus_0",10],"id":1}
2550 *
2551 * @par JSON-RPC response example
2552 * {"id":1,"jsonrpc":"2.0","result":0}
2553 * \endenglish
2554 */
2555 int addFixedModbusGroup(const std::string &signal_name, int count);
2556
2557 /**
2558 * @ingroup RegisterControl
2559 * \chinese
2560 * 删除指定名称的信号。
2561 *
2562 * @param signal_name 要删除的信号的名称
2563 * @return
2564 *
2565 * @par Python函数原型
2566 * modbusDeleteSignal(self: pyaubo_sdk.RegisterControl, arg0: str) -> int
2567 *
2568 * @par Lua函数原型
2569 * modbusDeleteSignal(signal_name: string) -> nil
2570 *
2571 * @par Lua示例
2572 * modbusDeleteSignal("Modbus_1")
2573 *
2574 * @par JSON-RPC请求示例
2575 * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteSignal","params":["Modbus_1"],"id":1}
2576 *
2577 * @par JSON-RPC响应示例
2578 * {"id":1,"jsonrpc":"2.0","result":0}
2579 * \endchinese
2580 * \english
2581 * Deletes the signal identified by the supplied signal name.
2582 *
2583 * @param signal_name A string equal to the name of the signal that should
2584 * be deleted.
2585 * @return
2586 *
2587 * @par Python interface prototype
2588 * modbusDeleteSignal(self: pyaubo_sdk.RegisterControl, arg0: str) -> int
2589 *
2590 * @par Lua interface prototype
2591 * modbusDeleteSignal(signal_name: string) -> nil
2592 *
2593 * @par Lua example
2594 * modbusDeleteSignal("Modbus_1")
2595 *
2596 * @par JSON-RPC request example
2597 * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteSignal","params":["Modbus_1"],"id":1}
2598 *
2599 * @par JSON-RPC response example
2600 * {"id":1,"jsonrpc":"2.0","result":0}
2601 * \endenglish
2602 */
2603 int modbusDeleteSignal(const std::string &signal_name);
2604
2605 /**
2606 * @ingroup RegisterControl
2607 * \chinese
2608 * 删除所有modbus信号
2609 *
2610 * @return
2611 *
2612 * @par JSON-RPC请求示例
2613 * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteAllSignals","params":[],"id":1}
2614 *
2615 * @par JSON-RPC响应示例
2616 * {"id":1,"jsonrpc":"2.0","result":0}
2617 *
2618 * \endchinese
2619 * \english
2620 * Delete all modbus signals
2621 *
2622 * @return
2623 *
2624 * @par JSON-RPC request example
2625 * {"jsonrpc":"2.0","method":"RegisterControl.modbusDeleteAllSignals","params":[],"id":1}
2626 *
2627 * @par JSON-RPC response example
2628 * {"id":1,"jsonrpc":"2.0","result":0}
2629 *
2630 * \endenglish
2631 */
2633
2634 /**
2635 * @ingroup RegisterControl
2636 * \chinese
2637 * 读取特定信号的当前值。
2638 *
2639 * @param signal_name 要获取值的信号的名称
2640 * @return 对于数字信号:1或0。
2641 * 对于寄存器信号:表示为整数的寄存器值。如果值为-1,则表示该信号不存在。
2642 *
2643 * @par Python函数原型
2644 * modbusGetSignalStatus(self: pyaubo_sdk.RegisterControl, arg0: str) -> int
2645 *
2646 * @par Lua函数原型
2647 * modbusGetSignalStatus(signal_name: string) -> number
2648 *
2649 * @par Lua示例
2650 * var0 = modbusGetSignalStatus("Modbus_0")
2651 *
2652 * @par JSON-RPC请求示例
2653 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalStatus","params":["Modbus_0"],"id":1}
2654 *
2655 * @par JSON-RPC响应示例
2656 * {"id":1,"jsonrpc":"2.0","result":1}
2657 * \endchinese
2658 * \english
2659 * Reads the current value of a specific signal.
2660 *
2661 * @param signal_name A string equal to the name of the signal for which the
2662 * value should be gotten.
2663 * @return An integer or a boolean. For digital signals: 1 or 0. For
2664 * register signals: The register value expressed as an integer. If the
2665 * value is -1, it means the signal does not exist.
2666 *
2667 * @par Python interface prototype
2668 * modbusGetSignalStatus(self: pyaubo_sdk.RegisterControl, arg0: str) -> int
2669 *
2670 * @par Lua interface prototype
2671 * modbusGetSignalStatus(signal_name: string) -> number
2672 *
2673 * @par Lua example
2674 * var0 = modbusGetSignalStatus("Modbus_0")
2675 *
2676 * @par JSON-RPC request example
2677 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalStatus","params":["Modbus_0"],"id":1}
2678 *
2679 * @par JSON-RPC response example
2680 * {"id":1,"jsonrpc":"2.0","result":1}
2681 * \endenglish
2682 */
2683 int modbusGetSignalStatus(const std::string &signal_name);
2684
2685 /**
2686 * @ingroup RegisterControl
2687 * \chinese
2688 * 获取所有信号的名字集合
2689 *
2690 * @return 所有信号的名字集合
2691 *
2692 * @par JSON-RPC请求示例
2693 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalNames","params":[],"id":1}
2694 *
2695 * @par JSON-RPC响应示例
2696 * {"id":1,"jsonrpc":"2.0","result":["Modbus_0"]}
2697 *
2698 * \endchinese
2699 * \english
2700 * Get the collection of all signal names
2701 *
2702 * @return Collection of all signal names
2703 *
2704 * @par JSON-RPC request example
2705 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalNames","params":[],"id":1}
2706 *
2707 * @par JSON-RPC response example
2708 * {"id":1,"jsonrpc":"2.0","result":["Modbus_0"]}
2709 *
2710 * \endenglish
2711 */
2712 std::vector<std::string> modbusGetSignalNames();
2713
2714 /**
2715 * @ingroup RegisterControl
2716 * \chinese
2717 * 获取所有信号的类型集合
2718 *
2719 * @return 所有信号的类型集合
2720 *
2721 * @par JSON-RPC请求示例
2722 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalTypes","params":[],"id":1}
2723 *
2724 * @par JSON-RPC响应示例
2725 * {"id":1,"jsonrpc":"2.0","result":[1,0,2,3]}
2726 *
2727 * \endchinese
2728 * \english
2729 * Get the collection of all signal types
2730 *
2731 * @return Collection of all signal types
2732 *
2733 * @par JSON-RPC request example
2734 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalTypes","params":[],"id":1}
2735 *
2736 * @par JSON-RPC response example
2737 * {"id":1,"jsonrpc":"2.0","result":[1,0,2,3]}
2738 *
2739 * \endenglish
2740 */
2741 std::vector<int> modbusGetSignalTypes();
2742
2743 /**
2744 * @ingroup RegisterControl
2745 * \chinese
2746 * 获取所有信号的数值集合
2747 *
2748 * @return 所有信号的数值集合
2749 *
2750 * @par JSON-RPC请求示例
2751 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalValues","params":[],"id":1}
2752 *
2753 * @par JSON-RPC响应示例
2754 * {"id":1,"jsonrpc":"2.0","result":[1,1,88,33]}
2755 *
2756 * \endchinese
2757 * \english
2758 * Get the collection of all signal values
2759 *
2760 * @return Collection of all signal values
2761 *
2762 * @par JSON-RPC request example
2763 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalValues","params":[],"id":1}
2764 *
2765 * @par JSON-RPC response example
2766 * {"id":1,"jsonrpc":"2.0","result":[1,1,88,33]}
2767 *
2768 * \endenglish
2769 */
2770 std::vector<int> modbusGetSignalValues();
2771
2772 /**
2773 * @ingroup RegisterControl
2774 * \chinese
2775 * 获取所有信号的请求是否有错误(0:无错误,其他:有错误)集合
2776 *
2777 * @return ModbusErrorNum
2778 *
2779 * @par JSON-RPC请求示例
2780 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalErrors","params":[],"id":1}
2781 *
2782 * @par JSON-RPC响应示例
2783 * {"id":1,"jsonrpc":"2.0","result":[6,6,6,6]}
2784 *
2785 * \endchinese
2786 * \english
2787 * Get the error status of all signal requests (0: no error, others: error)
2788 * as a collection
2789 *
2790 * @return ModbusErrorNum
2791 *
2792 * @par JSON-RPC request example
2793 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalErrors","params":[],"id":1}
2794 *
2795 * @par JSON-RPC response example
2796 * {"id":1,"jsonrpc":"2.0","result":[6,6,6,6]}
2797 *
2798 * \endenglish
2799 */
2800 std::vector<int> modbusGetSignalErrors();
2801
2802 /**
2803 * @ingroup RegisterControl
2804 * \chinese
2805 * 将用户指定的命令发送到指定IP地址上的Modbus单元。
2806 * 由于不会接收到响应,因此不能用于请求数据。
2807 * 用户负责提供对所提供的功能码有意义的数据。
2808 * 内置函数负责构建Modbus帧,因此用户不需要关心命令的长度。
2809 *
2810 * @param device_info 设备信息
2811 * 设备信息是RTU格式,例如:"serial_port,baud,parity,data_bit,stop_bit"
2812 * (1)serial_port参数指定串口的名称,例如,在Linux上为"/dev/ttyS0"或"/dev/ttyUSB0",在Windows上为"\.\COM10"
2813 * (2)baud参数指定通信的波特率,例如9600、19200、57600、115200等
2814 * (3)parity参数指定奇偶校验方式,N表示无校验,E表示偶校验,O表示奇校验
2815 * (4)data_bit参数指定数据位数,允许的值为5、6、7和8
2816 * (5)stop_bit参数指定停止位数,允许的值为1和2
2817 *
2818 * 设备信息是TCP格式,例如:"ip address,port"
2819 * (1)ip address参数指定服务器的IP地址
2820 * (2)port参数指定服务器监听的端口号
2821 * @param slave_number 指定用于自定义命令的从站号
2822 * @param function_code 指定自定义命令的功能码
2823 *
2824 * Modbus功能码
2825 * MODBUS_FC_READ_COILS 0x01
2826 * MODBUS_FC_READ_DISCRETE_INPUTS 0x02
2827 * MODBUS_FC_READ_HOLDING_REGISTERS 0x03
2828 * MODBUS_FC_READ_INPUT_REGISTERS 0x04
2829 * MODBUS_FC_WRITE_SINGLE_COIL 0x05
2830 * MODBUS_FC_WRITE_SINGLE_REGISTER 0x06
2831 * MODBUS_FC_READ_EXCEPTION_STATUS 0x07
2832 * MODBUS_FC_WRITE_MULTIPLE_COILS 0x0F
2833 * MODBUS_FC_WRITE_MULTIPLE_REGISTERS 0x10
2834 * MODBUS_FC_REPORT_SLAVE_ID 0x11
2835 * MODBUS_FC_MASK_WRITE_REGISTER 0x16
2836 * MODBUS_FC_WRITE_AND_READ_REGISTERS 0x17
2837 *
2838 * @param data 必须是有效的字节值(0-255)
2839 * @return
2840 *
2841 * @par Python函数原型
2842 * modbusSendCustomCommand(self: pyaubo_sdk.RegisterControl, arg0: str,
2843 * arg1: int, arg2: int, arg3: List[int]) -> int
2844 *
2845 * @par Lua函数原型
2846 * modbusSendCustomCommand(device_info: string, slave_number: number,
2847 * function_code: number, data: table) -> nil
2848 *
2849 * @par Lua示例
2850 * modbusSendCustomCommand("/dev/ttyRobotTool,115200,N,8,1", 1, 10,
2851 * {1,2,0,2,4,0,0,0,0}) -> nil
2852 *
2853 * @par JSON-RPC请求示例
2854 * {"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}
2855 *
2856 * @par JSON-RPC响应示例
2857 * {"id":1,"jsonrpc":"2.0","result":0}
2858 * \endchinese
2859 * \english
2860 * Sends a command specified by the user to the modbus unit located on the
2861 * specified IP address. Cannot be used to request data, since the response
2862 * will not be received. The user is responsible for supplying data which
2863 * is meaningful to the supplied function code. The builtin function takes
2864 * care of constructing the modbus frame, so the user should not be
2865 * concerned with the length of the command.
2866 *
2867 * @param device_info is rtu format.
2868 * eg,"serial_port,baud,parity,data_bit,stop_bit"
2869 * (1)The serial_port argument specifies the name of the serial port eg. On
2870 * Linux ,"/dev/ttyS0" or "/dev/ttyUSB0". On Windows, "\.\COM10".
2871 * (2)The baud argument specifies the baud rate of the communication, eg.
2872 * 9600, 19200, 57600, 115200, etc.
2873 * (3)parity:N for none,E for even,O for odd.
2874 * (4)data_bit:The data_bits argument specifies the number of bits of data,
2875 * the allowed values are 5, 6, 7 and 8.
2876 * (5)stop_bit:The stop_bits argument
2877 * specifies the bits of stop, the allowed values are 1 and 2.
2878 *
2879 * device_info is tcp format.eg,"ip address,port"
2880 * (1)The ip address parameter specifies the ip address of the server
2881 * (2)The port parameter specifies the port number that the server is
2882 * listening on.
2883 * @param slave_number An integer specifying the slave number to use for
2884 * the custom command.
2885 * @param function_code An integer specifying the function code for the
2886 * custom command.
2887 *
2888 * Modbus function codes
2889 * MODBUS_FC_READ_COILS 0x01
2890 * MODBUS_FC_READ_DISCRETE_INPUTS 0x02
2891 * MODBUS_FC_READ_HOLDING_REGISTERS 0x03
2892 * MODBUS_FC_READ_INPUT_REGISTERS 0x04
2893 * MODBUS_FC_WRITE_SINGLE_COIL 0x05
2894 * MODBUS_FC_WRITE_SINGLE_REGISTER 0x06
2895 * MODBUS_FC_READ_EXCEPTION_STATUS 0x07
2896 * MODBUS_FC_WRITE_MULTIPLE_COILS 0x0F
2897 * MODBUS_FC_WRITE_MULTIPLE_REGISTERS 0x10
2898 * MODBUS_FC_REPORT_SLAVE_ID 0x11
2899 * MODBUS_FC_MASK_WRITE_REGISTER 0x16
2900 * MODBUS_FC_WRITE_AND_READ_REGISTERS 0x17
2901 *
2902 * @param data An array of integers in which each entry must be a valid
2903 * byte (0-255) value.
2904 * @return
2905 *
2906 * @par Python interface prototype
2907 * modbusSendCustomCommand(self: pyaubo_sdk.RegisterControl, arg0: str,
2908 * arg1: int, arg2: int, arg3: List[int]) -> int
2909 *
2910 * @par Lua interface prototype
2911 * modbusSendCustomCommand(device_info: string, slave_number: number,
2912 * function_code: number, data: table) -> nil
2913 *
2914 * @par Lua example
2915 * modbusSendCustomCommand("/dev/ttyRobotTool,115200,N,8,1", 1, 10,
2916 * {1,2,0,2,4,0,0,0,0}) -> nil
2917 *
2918 * @par JSON-RPC request example
2919 * {"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}
2920 *
2921 * @par JSON-RPC response example
2922 * {"id":1,"jsonrpc":"2.0","result":0}
2923 * \endenglish
2924 */
2925 int modbusSendCustomCommand(const std::string &device_info,
2926 int slave_number, int function_code,
2927 const std::vector<uint8_t> &data);
2928
2929 /**
2930 * @ingroup RegisterControl
2931 * \chinese
2932 * 将选择的数字输入信号设置为“default”或“freedrive”
2933 *
2934 * @param robot_name 连接的机器人名称
2935 * @param signal_name 先前被添加的数字输入信号
2936 * @param action 操作类型。操作可以是“default”或“freedrive”
2937 * @return
2938 *
2939 * @par Python函数原型
2940 * modbusSetDigitalInputAction(self: pyaubo_sdk.RegisterControl, arg0: str,
2941 * arg1: str, arg2: int)
2942 *
2943 * @par Lua函数原型
2944 * modbusSetDigitalInputAction(robot_name: string, signal_name: string,
2945 * action: number) -> nil
2946 *
2947 * @par Lua示例
2948 * modbusSetDigitalInputAction("rob1", "Modbus_0","Handguide")
2949 *
2950 * @par JSON-RPC请求示例
2951 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetDigitalInputAction","params":["rob1","Modbus_0","Handguide"],"id":1}
2952 *
2953 * @par JSON-RPC响应示例
2954 * {"id":1,"jsonrpc":"2.0","result":0}
2955 * \endchinese
2956 * \english
2957 * Sets the selected digital input signal to either a "default" or
2958 * "freedrive" action.
2959 *
2960 * @param robot_name A string identifying a robot name that connected robot
2961 * @param signal_name A string identifying a digital input signal that was
2962 * previously added.
2963 * @param action The type of action. The action can either be "default" or
2964 * "freedrive". (string)
2965 * @return
2966 *
2967 * @par Python interface prototype
2968 * modbusSetDigitalInputAction(self: pyaubo_sdk.RegisterControl, arg0: str,
2969 * arg1: str, arg2: int)
2970 *
2971 * @par Lua interface prototype
2972 * modbusSetDigitalInputAction(robot_name: string, signal_name: string,
2973 * action: number) -> nil
2974 *
2975 * @par Lua example
2976 * modbusSetDigitalInputAction("rob1", "Modbus_0","Handguide")
2977 *
2978 * @par JSON-RPC request example
2979 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetDigitalInputAction","params":["rob1","Modbus_0","Handguide"],"id":1}
2980 *
2981 * @par JSON-RPC response example
2982 * {"id":1,"jsonrpc":"2.0","result":0}
2983 * \endenglish
2984 */
2985 int modbusSetDigitalInputAction(const std::string &robot_name,
2986 const std::string &signal_name,
2987 StandardInputAction action);
2988
2989 /**
2990 * @ingroup RegisterControl
2991 * \chinese
2992 * 设置 Modbus 信号输出动作
2993 *
2994 * @param robot_name
2995 * @param signal_name
2996 * @param runstate
2997 * @return
2998 *
2999 * @par JSON-RPC请求示例
3000 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputRunstate","params":["rob1","Modbus_0","None"],"id":1}
3001 *
3002 * @par JSON-RPC响应示例
3003 * {"id":1,"jsonrpc":"2.0","result":0}
3004 *
3005 * \endchinese
3006 * \english
3007 * Set Modbus signal output action
3008 *
3009 * @param robot_name
3010 * @param signal_name
3011 * @param runstate
3012 * @return
3013 *
3014 * @par JSON-RPC request example
3015 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputRunstate","params":["rob1","Modbus_0","None"],"id":1}
3016 *
3017 * @par JSON-RPC response example
3018 * {"id":1,"jsonrpc":"2.0","result":0}
3019 *
3020 * \endenglish
3021 */
3022 int modbusSetOutputRunstate(const std::string &robot_name,
3023 const std::string &signal_name,
3024 StandardOutputRunState runstate);
3025
3026 /**
3027 * @ingroup RegisterControl
3028 * \chinese
3029 * 将指定名称的输出寄存器信号设置为给定的值
3030 *
3031 * @param signal_name 提前被添加的输出寄存器信号
3032 * @param value 必须是有效的整数,范围是 0-65535
3033 * @return
3034 *
3035 * @par Python函数原型
3036 * modbusSetOutputSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
3037 * int) -> int
3038 *
3039 * @par Lua函数原型
3040 * modbusSetOutputSignal(signal_name: string, value: number) -> nil
3041 *
3042 * @par Lua示例
3043 * modbusSetOutputSignal("Modbus_0",0)
3044 *
3045 * @par JSON-RPC请求示例
3046 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignal","params":["Modbus_0",0],"id":1}
3047 *
3048 * @par JSON-RPC响应示例
3049 * {"id":1,"jsonrpc":"2.0","result":0}
3050 * \endchinese
3051 * \english
3052 * Sets the output register signal identified by the given name to the given
3053 * value.
3054 *
3055 * @param signal_name A string identifying an output register signal that in
3056 * advance has been added.
3057 * @param value An integer which must be a valid word (0-65535)
3058 * @return
3059 *
3060 * @par Python interface prototype
3061 * modbusSetOutputSignal(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
3062 * int) -> int
3063 *
3064 * @par Lua interface prototype
3065 * modbusSetOutputSignal(signal_name: string, value: number) -> nil
3066 *
3067 * @par Lua example
3068 * modbusSetOutputSignal("Modbus_0",0)
3069 *
3070 * @par JSON-RPC request example
3071 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignal","params":["Modbus_0",0],"id":1}
3072 *
3073 * @par JSON-RPC response example
3074 * {"id":1,"jsonrpc":"2.0","result":0}
3075 * \endenglish
3076 */
3077 int modbusSetOutputSignal(const std::string &signal_name, uint16_t value);
3078
3079 /**
3080 * @ingroup RegisterControl
3081 * \chinese
3082 * 将从指定名称开始的若干个连续输出寄存器信号设置为给定的值
3083 *
3084 * @param signal_name 提前被添加的输出寄存器信号的起始名称
3085 * @param values 整数数组,每个元素范围是 0-65535,对应连续的多个信号
3086 * @return
3087 *
3088 * @par Python函数原型
3089 * modbusSetOutputSignal1(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
3090 * list[int]) -> int
3091 *
3092 * @par Lua函数原型
3093 * modbusSetOutputSignal1(signal_name: string, value: table) -> nil
3094 *
3095 * @par Lua示例
3096 * modbusSetOutputSignal1("Modbus_0", {0, 1, 2})
3097 *
3098 * @par JSON-RPC请求示例
3099 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignal1","params":["Modbus_0",[0,1,2]],"id":1}
3100 *
3101 * @par JSON-RPC响应示例
3102 * {"id":1,"jsonrpc":"2.0","result":0}
3103 * \endchinese
3104 * \english
3105 * Sets multiple consecutive output register signals starting from the given
3106 * name to the given values.
3107 *
3108 * @param signal_name A string identifying the starting output register
3109 * signal that in advance has been added.
3110 * @param values An array of integers where each element must be a valid
3111 * word (0-65535), corresponding to multiple consecutive signals
3112 * @return
3113 *
3114 * @par Python interface prototype
3115 * modbusSetOutputSignal1(self: pyaubo_sdk.RegisterControl, arg0: str, arg1:
3116 * list[int]) -> int
3117 *
3118 * @par Lua interface prototype
3119 * modbusSetOutputSignal1(signal_name: string, value: table) -> nil
3120 *
3121 * @par Lua example
3122 * modbusSetOutputSignal1("Modbus_0", {0, 1, 2})
3123 *
3124 * @par JSON-RPC request example
3125 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignal1","params":["Modbus_0",[0,1,2]],"id":1}
3126 *
3127 * @par JSON-RPC response example
3128 * {"id":1,"jsonrpc":"2.0","result":0}
3129 * \endenglish
3130 */
3131 int modbusSetOutputSignal1(const std::string &signal_name,
3132 const std::vector<uint16_t> &values);
3133
3134 /**
3135 * \chinese
3136 * 将指定名称的输出寄存器信号设置为给定的值,并且带超时判断
3137 *
3138 * @param signal_name 提前被添加的输出寄存器信号
3139 * @param value 必须是有效的整数,范围是 0-65535
3140 * @param timeout 超时时间,单位秒
3141 * @return
3142 *
3143 * @par Python函数原型
3144 * modbusSetOutputSignalWithTimeout(self: pyaubo_sdk.RegisterControl, arg0:
3145 * str, arg1: int, arg2: double) -> int
3146 *
3147 * @par Lua函数原型
3148 * modbusSetOutputSignalWithTimeout(signal_name: string, value: number,
3149 * timeout: number) -> nil
3150 *
3151 * @par Lua示例
3152 * modbusSetOutputSignalWithTimeout("Modbus_0",0,0.5)
3153 *
3154 * @par JSON-RPC请求示例
3155 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignalWithTimeout","params":["Modbus_0",0,0.5],"id":1}
3156 *
3157 * @par JSON-RPC响应示例
3158 * {"id":1,"jsonrpc":"2.0","result":0}
3159 * \endchinese
3160 * \english
3161 * Sets the output register signal identified by the given name to the
3162 * given, with timeout value.
3163 *
3164 * @param signal_name A string identifying an output register signal that in
3165 * advance has been added.
3166 * @param value An integer which must be a valid word (0-65535)
3167 * @param timeout seconds
3168 * @return
3169 *
3170 * @par Python interface prototype
3171 * modbusSetOutputSignalWithTimeout(self: pyaubo_sdk.RegisterControl, arg0:
3172 * str, arg1: int, arg2: timeout) -> int
3173 *
3174 * @par Lua interface prototype
3175 * modbusSetOutputSignalWithTimeout(signal_name: string, value: number,
3176 * timeout: number) -> nil
3177 *
3178 * @par Lua example
3179 * modbusSetOutputSignalWithTimeout("Modbus_0",0,0.5)
3180 *
3181 * @par JSON-RPC request example
3182 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignalWithTimeout","params":["Modbus_0",0,0.5],"id":1}
3183 *
3184 * @par JSON-RPC response example
3185 * {"id":1,"jsonrpc":"2.0","result":0}
3186 * \endenglish
3187 */
3188 int modbusSetOutputSignalWithTimeout(const std::string &signal_name,
3189 uint16_t value, double timeout);
3190
3191 /**
3192 * @ingroup RegisterControl
3193 * \chinese
3194 * 设置modbus信号输出脉冲(仅支持线圈输出类型)
3195 *
3196 * @param signal_name: 提前被添加的输出寄存器信号
3197 * @param value: 必须是有效的整数,范围是 0-65535
3198 * @param duration: 信号持续时间,单位为秒
3199 * @return
3200 *
3201 * @par Python函数原型
3202 * modbusSetOutputSignalPulse(self: pyaubo_sdk.RegisterControl, arg0: str,
3203 * arg1: int, arg2 double) -> int
3204 *
3205 * @par Lua函数原型
3206 * modbusSetOutputSignalPulse(signal_name: string, value: number, duration:
3207 * number) -> nil
3208 *
3209 * @par Lua示例
3210 * modbusSetOutputSignalPulse("Modbus_0",1,0.5)
3211 *
3212 * @par JSON-RPC请求示例
3213 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignalPulse","params":["Modbus_0",1,0.5],"id":1}
3214 *
3215 * @par JSON-RPC响应示例
3216 * {"id":1,"jsonrpc":"2.0","result":0}
3217 *
3218 * \endchinese
3219 * \english
3220 * Set modbus signal output pulse (only supports coil output type)
3221 *
3222 * @param signal_name: A string identifying an output register signal that
3223 * has been added in advance.
3224 * @param value: An integer which must be a valid word (0-65535)
3225 * @param duration: Duration of the signal, in seconds
3226 * @return
3227 *
3228 * @par Python interface prototype
3229 * modbusSetOutputSignalPulse(self: pyaubo_sdk.RegisterControl, arg0: str,
3230 * arg1: int, arg2: double) -> int
3231 *
3232 * @par Lua interface prototype
3233 * modbusSetOutputSignalPulse(signal_name: string, value: number, duration:
3234 * number) -> nil
3235 *
3236 * @par Lua example
3237 * modbusSetOutputSignalPulse("Modbus_0",1,0.5)
3238 *
3239 * @par JSON-RPC request example
3240 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetOutputSignalPulse","params":["Modbus_0",1,0.5],"id":1}
3241 *
3242 * @par JSON-RPC response example
3243 * {"id":1,"jsonrpc":"2.0","result":0}
3244 *
3245 * \endenglish
3246 */
3247 int modbusSetOutputSignalPulse(const std::string &signal_name,
3248 uint16_t value, double duration);
3249
3250 /**
3251 * @ingroup RegisterControl
3252 * \chinese
3253 * 设置机器人向Modbus控制器发送请求的频率,用于读取或写入信号值
3254 *
3255 * @param signal_name 提前被添加的输出数字信号
3256 * @param update_frequency 更新频率(以赫兹为单位),范围是0-125
3257 * @return
3258 *
3259 * @par Python函数原型
3260 * modbusSetSignalUpdateFrequency(self: pyaubo_sdk.RegisterControl, arg0:
3261 * str, arg1: int) -> int
3262 *
3263 * @par Lua函数原型
3264 * modbusSetSignalUpdateFrequency(signal_name: string, update_frequency:
3265 * number) -> nil
3266 *
3267 * @par Lua示例
3268 * modbusSetSignalUpdateFrequency("Modbus_0",1)
3269 *
3270 * @par JSON-RPC请求示例
3271 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetSignalUpdateFrequency","params":["Modbus_0",1],"id":1}
3272 *
3273 * @par JSON-RPC响应示例
3274 * {"id":1,"jsonrpc":"2.0","result":0}
3275 * \endchinese
3276 * \english
3277 * Sets the frequency with which the robot will send requests to the Modbus
3278 * controller to either read or write the signal value.
3279 *
3280 * @param signal_name A string identifying an output digital signal that
3281 * in advance has been added.
3282 * @param update_frequency An integer in the range 0-125 specifying the
3283 * update frequency in Hz.
3284 * @return
3285 *
3286 * @par Python interface prototype
3287 * modbusSetSignalUpdateFrequency(self: pyaubo_sdk.RegisterControl, arg0:
3288 * str, arg1: int) -> int
3289 *
3290 * @par Lua interface prototype
3291 * modbusSetSignalUpdateFrequency(signal_name: string, update_frequency:
3292 * number) -> nil
3293 *
3294 * @par Lua example
3295 * modbusSetSignalUpdateFrequency("Modbus_0",1)
3296 *
3297 * @par JSON-RPC request example
3298 * {"jsonrpc":"2.0","method":"RegisterControl.modbusSetSignalUpdateFrequency","params":["Modbus_0",1],"id":1}
3299 *
3300 * @par JSON-RPC response example
3301 * {"id":1,"jsonrpc":"2.0","result":0}
3302 * \endenglish
3303 */
3304 int modbusSetSignalUpdateFrequency(const std::string &signal_name,
3305 int update_frequency);
3306
3307 /**
3308 * @ingroup RegisterControl
3309 * \chinese
3310 * 获取指定 modbus 信号索引,从0开始,不能存在则返回-1
3311 *
3312 * @param signal_name
3313 * @return
3314 *
3315 * @par JSON-RPC请求示例
3316 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalIndex","params":["Modbus_0"],"id":1}
3317 *
3318 * @par JSON-RPC响应示例
3319 * {"id":1,"jsonrpc":"2.0","result":0}
3320 *
3321 * \endchinese
3322 * \english
3323 * Get the index of the specified modbus signal, starting from 0. Returns -1
3324 * if it does not exist.
3325 *
3326 * @param signal_name
3327 * @return
3328 *
3329 * @par JSON-RPC request example
3330 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalIndex","params":["Modbus_0"],"id":1}
3331 *
3332 * @par JSON-RPC response example
3333 * {"id":1,"jsonrpc":"2.0","result":0}
3334 *
3335 * \endenglish
3336 */
3337 int modbusGetSignalIndex(const std::string &signal_name);
3338
3339 /**
3340 * @ingroup RegisterControl
3341 * \chinese
3342 * 获取指定 modbus 信号的错误状态
3343 *
3344 * @param signal_name
3345 * @return 返回错误代码 ModbusErrorNum
3346 *
3347 * @par JSON-RPC请求示例
3348 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalError","params":["Modbus_0"],"id":1}
3349 *
3350 * @par JSON-RPC响应示例
3351 * {"id":1,"jsonrpc":"2.0","result":6}
3352 * \endchinese
3353 * \english
3354 * Get the error status of the specified modbus signal
3355 *
3356 * @param signal_name
3357 * @return Returns error code ModbusErrorNum
3358 *
3359 * @par JSON-RPC request example
3360 * {"jsonrpc":"2.0","method":"RegisterControl.modbusGetSignalError","params":["Modbus_0"],"id":1}
3361 *
3362 * @par JSON-RPC response example
3363 * {"id":1,"jsonrpc":"2.0","result":6}
3364 * \endenglish
3365 */
3366 int modbusGetSignalError(const std::string &signal_name);
3367
3368 /**
3369 * @ingroup RegisterControl
3370 * \chinese
3371 * 获取指定 modbus 设备的连接状态
3372 *
3373 * @param device_name
3374 * 设备名是TCP格式,"ip:port", 例如:"127.0.0.1:502" \n
3375 * 设备名是RTU格式,"serial_port", 例如:"/dev/ttyUSB0" \n
3376 *
3377 * @return
3378 * 0: 表示设备处于连接状态
3379 * -1: 表示设备不存在
3380 * -2: 表示设备处于断开状态
3381 *
3382 * @par JSON-RPC请求示例
3383 * {"jsonrpc":"2.0","method":"RegisterControl.getModbusDeviceStatus","params":["172.16.26.248:502"],"id":1}
3384 *
3385 * @par JSON-RPC响应示例
3386 * {"id":1,"jsonrpc":"2.0","result":0}
3387 *
3388 * \endchinese
3389 * \english
3390 * Get the connection status of the specified modbus device
3391 *
3392 * @param device_name
3393 * Device name in TCP format: "ip:port", e.g. "127.0.0.1:502" \n
3394 * Device name in RTU format: "serial_port", e.g. "/dev/ttyUSB0" \n
3395 *
3396 * @return
3397 * 0: Device is connected
3398 * -1: Device does not exist
3399 * -2: Device is disconnected
3400 *
3401 * @par JSON-RPC request example
3402 * {"jsonrpc":"2.0","method":"RegisterControl.getModbusDeviceStatus","params":["172.16.26.248:502"],"id":1}
3403 *
3404 * @par JSON-RPC response example
3405 * {"id":1,"jsonrpc":"2.0","result":0}
3406 *
3407 * \endenglish
3408 */
3409 int getModbusDeviceStatus(const std::string &device_name);
3410
3411 /**
3412 * @ingroup RegisterControl
3413 * \chinese
3414 * 将某个 modbus 寄存器信号作为编码器
3415 *
3416 * @param encoder_id 不能为0
3417 * @param signal_name modbus 信号名字,必须为寄存器类型
3418 * @return
3419 * \endchinese
3420 * \english
3421 * Use a modbus register signal as an encoder
3422 *
3423 * @param encoder_id Must not be 0
3424 * @param signal_name Name of the modbus signal, must be of register type
3425 * @return
3426 * \endenglish
3427 */
3428 int addModbusEncoder(int encoder_id, int range_id,
3429 const std::string &signal_name);
3430
3431 /**
3432 * @ingroup RegisterControl
3433 * \chinese
3434 * 添加Int32寄存器的虚拟编码器
3435 *
3436 * @param encoder_id 编码器ID
3437 * @param range_id 范围ID
3438 * @param key 变量名
3439 * @return
3440 * \endchinese
3441 * \english
3442 * Add a virtual encoder for an Int32 register
3443 *
3444 * @param encoder_id Encoder ID
3445 * @param range_id Range ID
3446 * @param key Variable name
3447 * @return
3448 * \endenglish
3449 */
3450 int addInt32RegEncoder(int encoder_id, int range_id,
3451 const std::string &key);
3452
3453 /**
3454 * @ingroup RegisterControl
3455 * \chinese
3456 * 删除虚拟编码器
3457 *
3458 * @param encoder_id
3459 * @return
3460 * \endchinese
3461 * \english
3462 * Delete virtual encoder
3463 *
3464 * @param encoder_id
3465 * @return
3466 * \endenglish
3467 */
3468 int deleteVirtualEncoder(int encoder_id);
3469
3470protected:
3471 void *d_;
3472};
3473using RegisterControlPtr = std::shared_ptr<RegisterControl>;
3474
3475} // namespace common_interface
3476} // namespace arcs
3477
3478#endif // AUBO_SDK_REGISTER_CONTROL_INTERFACE_H
int modbusSetOutputSignalWithTimeout(const std::string &signal_name, uint16_t value, double timeout)
Sets the output register signal identified by the given name to the given, with timeout value.
float getFloatOutput(uint32_t address)
Reads the float from one of the output registers, which can also be accessed by a FieldBus.
int setVecChar(const std::string &key, const std::vector< char > &value)
Set or update the variable value
int getInt32Output(uint32_t address)
Reads the integer from one of the output registers, which can also be accessed by a FieldBus.
int setBool(const std::string &key, bool value)
Set or update the variable value
int deleteVirtualEncoder(int encoder_id)
Delete virtual encoder
int setVecFloat(const std::string &key, const std::vector< float > &value)
Set or update the variable value
int setVecInt32(const std::string &key, const std::vector< int32_t > &value)
Set or update the variable value
int getModbusDeviceStatus(const std::string &device_name)
Get the connection status of the specified modbus device
bool getBoolInput(uint32_t address)
Reads the boolean from one of the input registers, which can also be accessed by a Field bus.
bool getBool(const std::string &key, bool default_value)
Get variable value
std::vector< double > getVecDouble(const std::string &key, const std::vector< double > &default_value)
Get variable value
int modbusDeleteAllSignals()
Delete all modbus signals
std::vector< int > modbusGetSignalErrors()
Get the error status of all signal requests (0: no error, others: error) as a collection
double getDoubleOutput(uint32_t address)
Reads the double value from one of the output registers.
std::vector< int32_t > getVecInt32(const std::string &key, const std::vector< int32_t > &default_value)
Get variable value
int modbusGetSignalIndex(const std::string &signal_name)
Get the index of the specified modbus signal, starting from 0.
bool getInt16RegisterBit(uint32_t address, uint8_t bit_offset)
Get the status of a specific bit in an Int16 register
int setInt32(const std::string &key, int value)
Set or update the variable value
std::vector< std::string > modbusGetSignalNames()
Get the collection of all signal names
int modbusAddSignal(const std::string &device_info, int slave_number, int signal_address, int signal_type, const std::string &signal_name, bool sequential_mode)
Adds a new modbus signal for the controller to supervise.
int getWatchDogTimeout(const std::string &key)
Get the watchdog timeout value
int getInt32Input(uint32_t address)
Reads the integer from one of the input registers, which can also be accessed by a FieldBus.
int setVecDouble(const std::string &key, const std::vector< double > &value)
Set or update the variable 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)
Whether the named variable exists
int getWatchDogAction(const std::string &key)
Get the watchdog action
std::string getNamedVariableType(const std::string &key)
Get the type of a named variable
std::vector< int > modbusGetSignalTypes()
Get the collection of all signal types
int16_t getInt16Register(uint32_t address)
Used for Modbus Slave
int setInt32Input(uint32_t address, int value)
int getInt32(const std::string &key, int default_value)
Get variable value
int modbusSetOutputSignal(const std::string &signal_name, uint16_t value)
Sets the output register signal identified by the given name to the given value.
int setString(const std::string &key, const std::string &value)
Set or update the variable value
int modbusGetSignalError(const std::string &signal_name)
Get the error status of the specified modbus signal
int setFloat(const std::string &key, float value)
Set or update the variable value
int modbusSetOutputSignal1(const std::string &signal_name, const std::vector< uint16_t > &values)
Sets multiple consecutive output register signals starting from the given name to the given values.
int setDouble(const std::string &key, double value)
Set or update the variable value
int setWatchDog(const std::string &key, double timeout, int action)
Set the watchdog
int modbusSetOutputRunstate(const std::string &robot_name, const std::string &signal_name, StandardOutputRunState runstate)
Set Modbus signal output action
int modbusSetOutputSignalPulse(const std::string &signal_name, uint16_t value, double duration)
Set modbus signal output pulse (only supports coil output type)
double getDouble(const std::string &key, double default_value)
Get variable value
int setInt16RegisterBit(uint32_t address, uint8_t bit_offset, bool value)
Set the status of a specific bit in an Int16 register
bool getBoolOutput(uint32_t address)
Reads the boolean from one of the output registers, which can also be accessed by a Field bus.
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)
Sends a command specified by the user to the modbus unit located on the specified IP address.
bool variableUpdated(const std::string &key, uint64_t since)
Whether the named variable has been updated
std::vector< float > getVecFloat(const std::string &key, const std::vector< float > &default_value)
Get variable value
std::vector< int > modbusGetSignalValues()
Get the collection of all signal values
int addInt32RegEncoder(int encoder_id, int range_id, const std::string &key)
Add a virtual encoder for an Int32 register
std::string getString(const std::string &key, const std::string &default_value)
Get variable value
int modbusGetSignalStatus(const std::string &signal_name)
Reads the current value of a specific signal.
int addModbusEncoder(int encoder_id, int range_id, const std::string &signal_name)
Use a modbus register signal as an encoder
double getDoubleInput(uint32_t address)
Reads the double value from one of the input registers, which can also be accessed by a FieldBus.
int clearNamedVariable(const std::string &key)
Clear variable
int modbusSetSignalUpdateFrequency(const std::string &signal_name, int update_frequency)
Sets the frequency with which the robot will send requests to the Modbus controller to either read or...
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)
Deletes the signal identified by the supplied signal name.
int addFixedModbusGroup(const std::string &signal_name, int count)
Create a fixed read group for the specified Modbus register signal to optimize the batch reading effi...
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)
Sets the selected digital input signal to either a "default" or "freedrive" action.
std::vector< char > getVecChar(const std::string &key, const std::vector< char > &default_value)
Get variable value
float getFloat(const std::string &key, float default_value)
Get variable value
StandardInputAction
The StandardInputAction enum.
Definition type_def.h:620
StandardOutputRunState
Standard Output Run State.
Definition type_def.h:612
std::shared_ptr< RegisterControl > RegisterControlPtr
ModbusErrorNum
@ 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.
enum type definitions