omron — Program Interrupt Instructions

Program Interrupt Instructions since the reaction is at level 5 and the current program priority is 10, the reaction execution is deferred. 9. Task 2 prog_b issues a LOCK 0 instruction to lower its program priority to level 0. Since a level 5 reaction program is pending, it begins execution immediately and sets the program priority to 5. 10. Signal 1003 is asserted externally. The signal transition is not detected until the next major cycle. 11. The signal 1003 transition is detected which triggers the task 1 reaction routine and also sets the task 1 event flag. Since task 1 has a higher priority (30) than task 2 (20), task 1 begins executing its reaction routine and task 2 is suspended. 12.

The task 1 reaction routine completes by issuing a RETURN instruction. Control returns to prog_a in task 1. 13. Task 1 prog_a issues a CLEAR.EVENT instruction followed by a WAIT.EVENT instruction to wait for its event flag to be set. Task 1 is suspended and task 2 resumes execution of its reaction routine. The task 2 reaction routine completes by issuing a RETURN instruction. Control returns to prog_b in task 2. 14. Task 2 prog_b issues a SET.EVENT 1 instruction, setting the event flag for task 1. Task 2 now issues a RELEASE program instruction to yield control of the CPU. 15.

Since the task 1 event flag is now set, and its priority is higher than task 2, task 1 resumes execution, and task 2 is suspended. eV+Language User's Guide, v2.x, 18318-000 Rev A Page 66