Hi,
I have a little question about Errorhandling.
This is an example procedure which at start checks if the output on the gripper is "Closed". If not, i'd like to raise my own Errno which triggers a UIMsgBox that the operator can choose if he/she would like to close the gripper.
Afterwards, i'd like to "RETRY" to jump back and actually check again to see if the output still is 0.
The problem is that the Errorhandler triggers again and again even though doCloseStatorGrip=1. Why? Anyone? Am I Unable to use "Raise" if it's "my own" errno? I don't want to use TRYNEXT because I actually want to check the statement once again when the gripper has closed.
Code
Proc rPickDetail()
!Raise an "Const" Error if Gripper is open during call
IF doCloseStatorGrip=0 RAISE errGripOpen;
ERROR
TEST ERRNO
CASE errGripOpen:
UIMsgBox\Header:="Gripper-State Fault",
"Gripper is in wrong state for picking Detail from index"
\MsgLine2:="Would you like to reset the gripper?"
\Buttons:=btnYesNo\Icon:=iconError\Result:=resAnswer;
IF resAnswer=resYes THEN
!Set gripper, Close
SetGripper GripClose,1;
RETRY;
ENDIF
ENDPROC
Display More