12.07.2015 Views

RAPID reference manual - Technology

RAPID reference manual - Technology

RAPID reference manual - Technology

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

IOEnableRobotWare-OSInstructionError handlingFollowing recoverable errors can be generated. The errors can be handled in an errorhandler. The system variable ERRNO will be set to:ERR_IOENABLEERR_CALLIO_INTERERR_NAME_INVALIDif the time out time runs out before the unit isenabled.if an IOEnable or IODisable request is interruptedby another request to the same unit.if the unit name don’t exist or if the unit isn’tallowed to be disabled.ExampleIOEnable can also be used to check whether some I/O unit is disconnected for somereason.VAR num max_retry:=0;...IOEnable “cell1”, 0;SetDO cell1_sig3, 1;...ERRORIF ERRNO = ERR_IOENABLE THENIF max_retry < 5 THENWaitTime 1;max_retry := max_retry + 1;RETRY;ELSERAISE;ENDIFENDIFBefore using signals on the I/O unit cell1, a test is done by trying to enable the I/O unit with timeout after 0 sec. If the test fails, a jump is made to the error handler.In the error handler, the program execution waits for 1 sec. and a new retryis made. After 5 retry attempts the error ERR_IOENABLE is propagated to thecaller of this routine.SyntaxIOEnable[ UnitName ’:=’ ] < expression (IN) of string> ’,’[ MaxTime ’:=’ ] < expression (IN) of num > ’;’174 <strong>RAPID</strong> <strong>reference</strong> <strong>manual</strong> - part 1a, Instructions A-R

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

Saved successfully!

Ooh no, something went wrong!