Program hangs after interrupt triggered

  • Hi,


    Robot: Agilus KR10-R1100 HM-SC

    Controller: KRC4 small size

    KSS: V8.5.7 HF1



    I have an interrupt which is triggered by a collision sensor coupled between the robot and the tool. I have a 20second wait in the interrupt, once the interrupt is completed it jumps back to the program but hangs on the next line of code. The R icon at the top also changes from Green to red. The program is running in External mode.


    Imaged attached shows the line the program hangs on.

    Any help is much appreciated.


    Code
    DEF washCrash( )
    MSGNOTIFY("WASH CRASH ISR ACTIVATED")
    INTERRUPT OFF 2
    BRAKE F
    WAIT SEC 20
    INTERRUPT ON 2
    END

    Edited 2 times, last by aes ().

  • AD
  • Does the message appear?

    May be the external control stops the program after crash sensor triggered?

    You should switch off interrupt before msgnotify.

    Does it make sense just to wait for 20 seconds after a crash sensor has been triggered? Self healing crash? :)

  • I have tried BRAKE, that doesn't help.


    I checked the auto external I/O's and nothing changed when the problem arises.


    I changed the timer to 10 seconds and the problem went away. any ideas why the timer would do that.


    Thanks

  • I checked the auto external I/O's and nothing changed when the problem arises.

    How did you do that? Looking on the robots HMI doesn't show short peaks.

    You should check that again.

    There is no reason for the robot system to stop during wait statement.

    Except, may be a cwrite statement to the command channel in sps.sub.

  • You still didn't answer the question: with the timer set to 20sec, does the Notify Message show up in the message window or not?

  • Does the message appear?

    May be the external control stops the program after crash sensor triggered?

    You should switch off interrupt before msgnotify.

    Does it make sense just to wait for 20 seconds after a crash sensor has been triggered? Self healing crash? :)

    No notification/error messages come up. The only thing that changes is the "R" icon goes to red.

  • you are testing it in EXT mode which is not good...


    this mode utilizes handshaking with external controller and glitches in that external (PLC) code could be causing what you see. your interrupt code looks ok but then again.. your posted code and screenshot show two different versions so... that's not good.


    you don't need to post your entire program, in fact it is a good idea to create slimmed down version that still demonstrates and nd allows reproducing of the problem. but make sure that your screenshot shows the exact same code that you are posting here. don't waste time of volunteers trying to help you, we have no time to chase unicorns and do a marathon questioning just to sort out what are the facts... so be a pal and collaborate if you want help...


    as already mentioned, i would say try to temporarily change AutoExtern configuration so that key signals like move enable and drives off are set to 1025. then try running the same program in some other mode (AUT if you like) and see if the program stops there. this should tell you if problem is due to handshake signals dropping out unexpectedly (could be momentarily and such changes cannot be caught by eye). you would need to add code to detect them or monitor signals using Trace option.


    your ISR should not start with MsgNotify. this calls sub/functions in external library and by definition - this is slow and completely against spirit of using interrupts. that means while robot interpreter is processing MsgNotify, you may be getting additional triggers on same or other interrupts. the whole idea behind INTERRUPT OFF inside ISR is to prevent re-triggering (contact bunce). so this should be the first line in there and followed by BRAKE (or BRAKE F) to stop the robot. then while you are siting there idle and preparing for a 20 second delay, it may be a good time to display a message...


    and what is the deal with people using interrupt levels 1 and 2? those are highest priority interrupts, they are even higher priority than interrupt 3 which is used in case of a serious problem such as collision, malfunction etc. are you really really sure YOUR situation is more important than having robot come to a stop due to collision or malfunction? open any program module that has INI and look inside. there is a global interrupt 3.


    also note that with higher the priority, the quicker ISR need to be. otherwise ISR that takes long to execute will be blocking all lower interrupts (more than 120 of them) including already mentioned interrupt 3. those top priority interrupts are to be used with extreme care and only in extreme circumstances, not casual use like "start the wash"...for that use lower priority interrupts, maybe something in range 100-120.... or even 10-15 if you must but - i guarantee you that whatever you do, it is NOT more important than interrupt 3. so use lower priority interrupt number (larger value than 3...) and avoid one already used or reserved range (40-80)


    and while there, why not check call stack and any other interrupts in use...

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

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