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