在ABB机器人编程中会用到很多自带的函数(Function),例如: clkRead(读取时钟), NumToStr(转换数值为字符串), Crobt(读取当前位置)等。也可以根据自己的需要创建自定义函数。
下面介绍创建自定义函数(Function)的说明:
Function必须通过return指令终止运行,return返回的数据类型必须和function的数据类型一致。
Function必须通过表达式来完成调用,如赋值指令,不能通过ProcCall来完成的。在调用带有参数的Function 时,强制参数必须指定,而且参数的顺序要正确;可选参数可以缺省。

In ABB robot programming, many built-in functions are used, such as clkRead (read clock), NumToStr (convert value to string), Crobt (read current position), etc. You can also create custom functions according to your own needs.
Below are instructions for creating custom functions:
The function must be terminated by the return instruction, and the data type returned by the return must match the data type of the function.
Functions must be called through expressions, such as assignment instructions, and cannot be called through ProcCall. When calling a Function with parameters, it is mandatory to specify the parameters and ensure that the order of the parameters is correct; Optional parameters can be defaulted.
