Era Function
Returns the joint number for which an error occurred.
Syntax
Era[(taskNum)]
Parameters
- taskNum
- Specify the task number as an integer from 0 to 32. Task number omission or “0” specifies the current task.
Return Values
The joint number that caused the error in the range 0 to 9 as described below:
- 0 - The current error was not caused by a servo axis.
- 1 - The error was caused by joint number 1
- 2 - The error was caused by joint number 2
- 3 - The error was caused by joint number 3
- 4 - The error was caused by joint number 4
- 5 - The error was caused by joint number 5
- 6 - The error was caused by joint number 6
- 7 - The error was caused by joint number 7
- 8 - The error was caused by joint number 8 (additional S axis)
- 9 - The error was caused by joint number 9 (additional T axis)
Description
Era is used when an error occurs to determine if the error was caused by one of the robot joints and to return the number of the joint which caused the error. If the current error was not caused by any joint, Era returns “0”.
When the event “Error during Auto Mode” occurs, normal task and NoPause task in AUTO mode stop execution and end the task. If the target task has already ended when using this function for NoEmgAbort task or background task, “Error 2261” is occurred. Use OnErr to acquire information before the task ends.
See Also
Erl, Err, ErrMsg$, Ert, OnErr, Trap
Era Function Example
Function main
OnErr Goto eHandler
Do
Call PickPlace
Loop
Exit Function
eHandler:
Print "The Error code is ", Err
Print "The Error Message is ", ErrMsg$(Err)
errTask = Ert
If errTask > 0 Then
Print "Task number in which error occurred is ", errTask
Print "The line where the error occurred is Line ", Erl(errTask)
If Era(errTask) > 0 Then
Print "Joint which caused the error is ", Era(errTask)
EndIf
EndIf
Fend