RobotStudio event

OptSearch_1D Restart?

Is it possible to create my own error handler with the OptSearch_1D search? I want to be able to restart a search automatically if I don't find a feature. Right now it stops and I don't get an error message to use in a handler. Normally I use something like this but it never gets to the error handler when using OptSearch_1D. 
     ERROR
            IF ERRNO=ERR_WHLSEARCH THEN
                TPWrite "Measurement number " + ValToStr(nMeasCount) + " Missed.";
                bMissed := TRUE;
                RETRY;
            ENDIF
    ENDPROC

Best Answer

Answers

  • You could try and add an ELSE to your IF statement and then put a STOP instruction as the ELSE result.  Then if the cause of the error does look in the error handler, you could look at the value of ERRNO.  As it obviously isn't ERR_WHLSEARCH, if it has a different error you can then handle that.

    ERROR
                IF ERRNO=ERR_WHLSEARCH THEN
                    TPWrite "Measurement number " + ValToStr(nMeasCount) + " Missed.";
                    bMissed := TRUE;
                    RETRY;
               ELSE
                    STOP;
                    !  Now look at the ERRNO value
                ENDIF
        ENDPROC
  • pat.cliftion,

    I gave that a try. No luck, it never leaves the instruction. It looks like ABB has incorporated a UIMessageBox that's got it stuck. The operator has to choose an option on the message box. The robot never goes to a stopped state. 

    Is it possible to disable UIMessageBox when in auto? Or possibly a way to close one down with a background task?
  • Dont think you can disable the UIMessagebox, as its probably being called in the built in code of the instruction.  If you know what variable is being checked in the message box, you may be able to get it close down, not sure.  Problem with doing that may be that the robot then carries on its execution incorrectly. 
  • Graemepaulin,

    That worked. Now i'm able to handle errors like I intended to. May put together a custom instruction to simplify what an operator sees. Thanks for the advice. 

    Teubert