Motion In Error Handlers / Traps

  • I have a minor function in my robot where if it is idle for a set amount of time, it will do a little dance, log an error message with the total idle time, then continue waiting at the HOME position. Sounds silly, but we have reasons for it.


    I originally wrote it as a timed interrupt, but kept getting errors because I wasn't using StorePath first. (Robot is sitting at the home position with no planned motion, so I thought that wouldn't be necessary.) It works as intended in RobotStudio, but I am getting a separate error message for each of the move instructions in the "idle dance".


    I shifted over to an error handler in my MAIN routine, and played around until it ran with no errors. What I have is copied below, but based on examples in the Instructions, Functions, and Data Types manual, this seems excessive. Is there a cleaner way to do this??



    If I don't have all of the commands in RED, I get several errors, including Path Limitation (40649), Execution Error (40223), and Missing Error Handler (40357).


    The end result is working exactly how I want, it just seems very clunky. And I would like to get it back to an Interrupt to keep my MAIN module a little cleaner.

  • Place your Ad here!
  • Follow-up... Adding the same instructions (in red) as above, and replacing the RETRY with RETURN, my interrupt works the same way with no issues. Still just seems like it's more cluttered than it should be with all the SKIP/RESTO/STOP/CLEAR/STORE all just so I can make some other motions then come back to the WAIT instruction.

  • Code: Interrupt Declarations
    CONNECT int_IDLE WITH tr_IdleCheck;
    ITimer IdleCheckTime,int_IDLE;


  • Works from a normal routine as well, but i still have to have that litany of instructions to prevent this error...


    41739: StorePath required

    Description

    Task: T_ROB1.

    Instruction MoveJ is executing in an error handler or a trap routine. Use StorePath before using a movement instruction on other level than base.

    Program ref: /SERVICE/IdleDance/MoveJ/188.


    Causes

    A movement instruction executed without having the path stored.


    Actions

    Execute StorePath before using movement instruction MoveJ. Read Programming type examples in the RAPID manual to see how to use movement instructions in TRAP routines and error handlers.


    -------------


    Do I really need all this, just to move the robot in an error handler??

  • Don't know what your problem is :hmmm:.

    You have a working solution with round about 10 lines of code, now you want to have a solution where you can spare 3 or 4 lines :fine:. Have a drink and be happy with your solution.

    Try to stick the complete error handling into a routine, then you have only one line of code in main error handler.

  • You have a working solution with round about 10 lines of code, now you want to have a solution where you can spare 3 or 4 lines :fine:. Have a drink and be happy with your solution.

    I see your point. I just felt like I was maybe missing something because it seems like it should be cleaner and easier to move in an error handler. I will go sip my coffee now.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now

Advertising from our partners