Interrupts

  • Hi!


    I am new to Kawasaki and interrupts and want to code something like this:


    PickBox (Subprogram called by eg. main)

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


    CALL GripperClose


    BREAK


    ; boxDetect is a signal within the gripper itself that should always be high when a box is

    ; in the gripper

    ON -boxDetect CALL BoxDropped


    CALL DoSomeCalculations

    CALL DoSomeMotions


    BREAK

    IGNORE boxDetect


    CALL GripperOpen



    BoxDropped

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


    ; Box dropped by gripper

    BREAK
    BRAKE
    HOLD



    If I read the manual correctly the call to DoSomeCalculations and DoSomeMotions will cancel the interrupt? I have to set the interrupt again inside DoSomeCalculations and DoSomeMotions?


    Do I need the BREAK above ON and before IGNORE?



    Thanks!

  • If I read the manual correctly the call to DoSomeCalculations and DoSomeMotions will cancel the interrupt? I have to set the interrupt again inside DoSomeCalculations and DoSomeMotions?

    Where did you read this, can provide manual reference number where this is written?


    AFAIK in your 'DoSomeCalculations and DoSomeMotions' subroutines, the interrupt signal will still be monitored for - Test it.


    IGNORE cancels the monitoring for the interrupt configured signal.


    BREAK is a break in CP motion, so without it IGNORE would be pre-processed ahead of the next motion segment, so is usually better to have BREAK before IGNORE.

    Although, this is application dependent and sometime other way round is required.

    Test it and find out, if ok leave it, if not change it.

  • On page 6-82 in the ASRef_en manual it says:

    Signal monitoring is canceled in any of the following cases:

    1. ...

    2. The ON and ONI instructions are executed and the program has branches to a subroutine


    I probably misunderstand something?


    Also, the IGNORE. Does it matter if the signal has - (minus) in front or is it only the name that matters?

  • Whether you can share your interrupt handling program?

    now not yet fully understood :red_heart:

    This is probably what I would do if I were using an ABB robot

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

    MODULE ABB


    !---Signal declaration

    VAR signaldo DO_OPEN;

    VAR signaldo DO_CLOSE;



    !---Point position definition

    CONST robtarget pPick:=[[1230,-1013.6,1541.44],[0.0121733,0.698843,0.71508,-0.0114094],[-1,-1,0,0],[1500,9E+09,9E+09,9E+09,9E+09,9E+09]];

    CONST robtarget pPut:=[[1230,-1013.6,1541.44],[0.0121733,0.698843,0.71508,-0.0114094],[-1,-1,0,0],[1500,9E+09,9E+09,9E+09,9E+09,9E+09]];


    !---When the feedback is normal signal 1. When the signal changes to 0, the interrupt is triggered !

    VAR signaldi DI_CLOSE_ERR;

    VAR intnum CLOSE_error;




    PROC Gripper(\switch OPEN|switch CLOSE)

    IF Present(OPEN) THEN

    SetDO DO_OPEN,1;

    TPWrite "Gripper_OPEN";

    ENDIF

    IF Present(CLOSE) THEN

    SetDO DO_CLOSE,1;

    TPWrite "Gripper_DO_CLOSE";


    ENDIF

    ENDPROC



    PROC Interrupt_TEST()


    !--Write an interrupt program,

    !--For example: one signal loss during product grabbing,Trigger an interrupt!

    !--And then,robot will stop...



    WHILE TRUE DO


    !----

    IDelete CLOSE_error;


    CONNECT CLOSE_error WITH Correct_CLOSE;


    ISignalDI DI_CLOSE_ERR,0,CLOSE_error;


    !---


    MoveL pPick,v1000,z50,tool0\WObj:=wobj0;


    Gripper\CLOSE;


    MoveL pPut,v1000,z50,tool0\WObj:=wobj0;


    Gripper\OPEN;


    ENDWHILE

    ENDPROC



    TRAP Correct_CLOSE


    IF INTNO=CLOSE_error THEN

    TPWrite " It was detected that the BOX was not tightened during handling";

    STOP;

    ENDIF



    ENDTRAP




    ENDMODULE

    Edited once, last by Ming.Li ().

  • Hi! It would be something like this I believe (pseudo code), very simplified:


    Hope it helps at least :smiling_face:

Advertising from our partners