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