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