Error handler

  • I have a procedure in IRC5 RW6, where a SearchL instruction is used.
    SearchL\Stop, diSearch\NegFlank, pRobFound, pRobEnd, v10, tGripper\WObj:=wobj1;
    The documentation in the help is not completely clear to me.
    If the signal diSearch is already low when the instruction SearchL is called, will an error ERR_SIGSUPSEARCH
    be generated? Or will the search movement go through until pRobEnd is reached.
    If the ERR_SIGSUPSEARCH would be generated, and there is an error handler at the bottom of the procedure, but the code in the error handler is empty, what will happen then?


  • Within the error handler you would do something like:


    Test ERRNO
    CASE ERR_SIGSUPSEARCH:
    ! Do something here like move back to search start position or modify it somehow
    DEFAULT
    Stop;
    ! check the value of ERRNO to determine the cause of error so you can fix it
    EndTest

  • Lemster,


    Thanks for the info.W
    The code is however now in a robot in production (installation from other manufacturer) and we don't have acces to it just now.
    What will exactly happen in the cycle if the error handler is called but nothing is done in it?
    Will the robot stop?
    And will the instruction as is actually in the robot generate the error ERR_SIGSUPSEARCH if the instruction is called when the digital input is already low before?
    SearchL\Stop, diSearch\NegFlank, pRobFound, pRobEnd, v10, tGripper\WObj:=wobj1;
    It is not completely clear to me from the help is with these arguments the ERR_SIGSUPSEARCH is generated.


    Thanks

  • SearchL is a very rough tool, it lacks the finesse you need many times.


    You're better off using/writing your own search routine/instruction with an error handler built in (Smartac for example) which handles all the issues / errors for you. I've attached an old file that I used to use back in the day.


    As an example, what it does is that it runs through an init cycle and if there's contact from the start it backs out a few mm to retry and it keeps doing that a few times until it either fails (throws an error) or clears the part (start the search).



Advertising from our partners