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