RobotStudio event

Nested interrupts

dragolollo
edited April 2021 in RAPID Programming
Hello,
Is it possible to have nested interrupts? I would like to be able to detect an interrupt inside another interrupt (I've tried and looks like it's not possible but myabe I'm doing something wrong).
Thank you.
Tagged:

Comments

  • Micky
    Micky ✭✭✭
    Hello,
    Interrupts are queued in the interrupt queue and processed one after the other.
    That means, as long as a TRAP routine is processed, the other routines in the queue remain untouched. Only when the TRAP routine is finished, the next interrupt routine is processed.

    For this reason, you should avoid wait-instructions or long-running trap routines, since these may also interfere with the normal program flow.

    Furthermore, the size of the interrupt queue is limited, so that the error message "Interrupt queue full" appears, if always new interrupts occur but the queue is not emptied.

    Based on the above summary, I would say nested interrupts are not possible in RAPID. Maybe you should use multitasking.

  • Thank you for your answer! I think you are right; furthermore, I've noticed that if a trap routine is running and another interrupt occurs in the meanwhile, at the end of the trap execution the trap related to the new interrupt will not be executed.
  • Micky
    Micky ✭✭✭
    Hello,
    there seems to be something wrong with your program because new interrupts are always queued, and as soon as a TRAP routine is finished the next TRAP routine should be executed.