1 RUNNING A PROGRAM
1.5 Program Execution Type
59
1
Event execution type program
This type of program starts execution when triggered by a specified event. ( Page 59 Trigger type) The program is
executed at the execution turn specified in the program settings of the CPU parameters, and if execution conditions of the
specified trigger are met when the execution turn of the event execution type program comes, the program is executed.
*1 Measurement of elapsed time is 10ms or more because it is determined depending on the scan time.
Trigger type
The following lists the triggers for the event execution type programs. ( Page 62 Trigger setting)
■Interrupt occurrence by the interrupt pointer (I)
When the specified interrupt factor occurs, the program is immediately executed once. However, before that, interrupt must be
enabled by executing the EI instruction. Enabling programs to be independently executed as interrupt programs, this method
eliminates the need to write the FEND instruction, interrupt pointers, and the IRET instruction within scan execution type
programs.
Interrupt pointers (I) which can be specified are I0 to I15, I28 to I31, I44, I45, I48, I49, I50 to I1023.
Execution conditions for the event execution type program which is triggered by interrupt occurred by the
interrupt pointer (I) are the same as those for general interrupt programs ( Page 68 Operation upon
occurrence of an interrupt factor)
(1) When an interrupt occurs, the event execution type program C is executed immediately.
Y50
M0
10ms
*1
10ms
*1
10ms
*1
·
·
Y50: ON
First scan
The interrupt (I60) occurred.
Second scan Third scan Fourth scan Fifth scan
Power-on → RUN,
STOP → RUN
Scan execution type program A
Scan execution type program C
(Executed when Y50 is turned on.)
Scan execution type program D
(Executed when the interrupt (I60)
occurred.)
Event execution type program E
(Executed when 10ms elapses.)
END processing
Scan execution type program B
Execution
order
(1)
·
Scan execution type program A
Scan execution type program B
END processing
Scan execution type program C
(Executed when the interrupt (I60)
occurred.)
Execution
order
Power-on → RUN,
STOP → RUN
First scan Second scan Third scan
The interrupt (I60) occurred.