Interrupt Issues

  • Controller: KRC4
    WV: V3.1.8_Build22




    I have searched the forum's and followed what I have found here as well as what I could find in the Systems Integrator manual for programming Interrupts.
    By what I can see these 2 interrupts should work, but neither is triggered.



    We are using a vacuum sensor on $IN[82] and a Prox sensor on $IN[81].
    I have tested both of them outside of this program and they both show as working on the teach pendents I/O display.


    When I run the below program the Vacuum sensor triggers but it does not start the interrupt. I have manually triggered the Prox sensor to show true by placing an object infront of it and it doesnt trigger its interrupt either


    Any help anyone can provide me would be very much appreciated


  • Your INTERRUPT ON commands should be in the FindSheet subroutine, not the main routine. Your Interrupt routines need BRAKE commands and INTERRUPT OFFs at the beginning. Your FindSheet routine needs a WAIT FOR TRUE at the end to ensure that the advance pointer does not make it back to the main routine before an interrupt triggers.


    Beyond that, you need to ensure that the Inputs experience a False-to-True transition during the search motion.

  • Thank you both for the help,


    SkyFire, I added in the recommended lines and it worked perfectly. I got confused and didnt realize the Interrupts needed to be started in the first subprogram not the main.


    Thank you again



    EDIT: So I have done this, and now the interrupts are working, but it is coming out of the interrupt at the same point in the main program which causes the robot to move in the same direction that initially triggered the interrupt.


    After the interrupt sub program has finished it moves back to " SLIN {X -3140, Y 256, Z -30, A -90, B 7.75, C -179.93} WITH $VEL.cp = .005" and keeps trying to make it to (Z -30). This is causing the robot to push the EOT through the material. I am trying to figure out how to get it to start the line after, so it will go back to the AcrylicFramePickup () main program and move away from the found object.

  • I honestly slipped up with the RESUME being in there, but the RETURN is there inside an IF statement, inside a loop that I am now dumbly realizing should be an EXIT statement.



    Removing that RESUME and changing the RETURN to an EXIT will solve the issue of the interrupt starting back on the FindSheet () line that the interrupt was triggered on?

  • One hopes. The RESUME command in the interrupt routine should cancel any motions active in the search routine, and jump the program pointer back to the level where the interrupt was declared, one line after it left.
    Also, you should only have your Interrupts active during the search motion. So if the robot finishes the entire search motion without tripping the interrupts, you should turn the Interrupts off before making your escape motion. Don't wait until you're up in Main.
    Hm... if you do all that, and it still tries to execute that Z-30 motion, try placing a WAIT SEC 0 immediately following your search motion command.

Advertising from our partners