在ABB機(jī)器人編程中會(huì)用到很多自帶的函數(shù)(Function),例如: clkRead(讀取時(shí)鐘), NumToStr(轉(zhuǎn)換數(shù)值為字符串), Crobt(讀取當(dāng)前位置)等。也可以根據(jù)自己的需要?jiǎng)?chuàng)建自定義函數(shù)。
下面介紹創(chuàng)建自定義函數(shù)(Function)的說(shuō)明:
Function必須通過(guò)return指令終止運(yùn)行,return返回的數(shù)據(jù)類(lèi)型必須和function的數(shù)據(jù)類(lèi)型一致。
Function必須通過(guò)表達(dá)式來(lái)完成調(diào)用,如賦值指令,不能通過(guò)ProcCall來(lái)完成的。在調(diào)用帶有參數(shù)的Function 時(shí),強(qiáng)制參數(shù)必須指定,而且參數(shù)的順序要正確;可選參數(shù)可以缺省。

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.
