Chapter 5 CPU Module
5-
12
5.3.3 Interrupt function
When an interrupt occurs, the CPU module will stop the current operation and execute the corresponding interrupt routine.
After finish the interrupt routine, the CPU resume the sequence program from the stopped step.
MASTER-K series provides 2 types of interrupt. The TDI (Time driven interrupt) occurs with the constant period, and PDI
(Process driven interrupt) occurs with the status of external input.
Before to use interrupt function in sequence program, the parameter setting should be done properly. Then the
corresponding interrupt routine should be written after END instruction. (Refer chapter 4 for details) If interrupt routines are
not matched with parameter settings, an error occurs and the operation of CPU will be stopped.
To execute an interrupt routine, use the EI instruction to enable the corresponding interrupt. The interrupt routine is not
executed if an interrupt factor occurs before execution of an EI instruction. Once an interrupt is enabled with EI instruction,
it keeps the enabled status until DI instruction is executed to disable the interrupt. When a CPU is turned to RUN mode, all
interrupts are disabled by default.
When multiple interrupt factors occur simultaneously, interrupt routines are executed according to the priority given to the
each interrupt. If an interrupt factor that has higher priority occurs while other interrupt that has lower priority are executing,
the interrupt routine of lower priority will be stopped and the interrupt of higher priority will be executed first. The following
figure shows how a CPU handles multiple interrupts.
Program starts
Interrupt 2 occurs
Stop main program and execute interrupt
routine 2
Interrupt 1 occurs (higher priority)
Stop routine 2 and run routine 1
Finish routine 1 and return to routine2
Scan Program
Interrupt routine 1
Interrupt routine 2
1
3
5
6
7
2
4
Finish routine 2 and return to main program
1
2
3
4
5
6
7
Содержание MASTER-K80S
Страница 27: ...Chapter 4 Names of Parts 4 4 1 3 30 points base unit 4 1 4 40 points base unit 4 1 5 60 points base unit...
Страница 66: ...Chapter 6 Input and Output Modules 6 3 30 point base unit 4 40 point base unit DC24V DC24V DC24V...
Страница 67: ...Chapter 6 Input and Output Modules 6 5 60 point base unit DC24V DC24V...
Страница 206: ...Chapter 8 Communication Function 8 63 You can see the frame list which is designated Click OK button...