12.07.2015 Views

RAPID reference manual - Technology

RAPID reference manual - Technology

RAPID reference manual - Technology

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

InstructionRETRYRobotWare-OSRETRY - Resume execution after an errorThe RETRY instruction is used to resume program execution after an error, startingwith (re-executing) the instruction that caused the error.Examplereg2 := reg3/reg4;.ERRORIF ERRNO = ERR_DIVZERO THENreg4 := 1;RETRY;ENDIFAn attempt is made to divide reg3 by reg4. If reg4 is equal to 0 (division by zero),a jump is made to the error handler, which initialises reg4. The RETRY instructionis then used to jump from the error handler and another attempt is made tocomplete the division.Program executionProgram execution continues with (re-executes) the instruction that caused the error.Error handlingIf the maximum number of retries (4 retries) is exceeded, the program execution stopswith an error message. The maximum number of retries can be configured in System Parameters (System miscellaneous).LimitationsThe instruction can only exist in a routine’s error handler. If the error was created usinga RAISE instruction, program execution cannot be restarted with a RETRY instruction,then the instruction TRYNEXT should be used.SyntaxRETRY ’;’<strong>RAPID</strong> <strong>reference</strong> <strong>manual</strong> - part 1a, Instructions A-R 405

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!