Mitsubishi Electric MELSEC iQ-R Series User Manual page 130

Process cpu module
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

If the value of the index register used for the interrupt program is continuously used for the next interrupt
program, the value of the index register for the interrupt program must be saved or restored. Create a program
to add the MOV instruction and the ZPUSH/ZPOP instruction.
Program example
Main routine program
FEND
Ò
I50
MOV D0 Z0
MOV K3 Z0
Ó
MOV Z0 D0
IRET
*3 A value in Z0 changes at MOV D0 Z0.
*4 Z is zero when the program Ò and Ó are not added.
(1)This value can be used as a value specific to the main routine program.
(2)This value can be used as a value specific to the interrupt program. (This value can be used continuously.)
8 RUNNING A PROGRAM
128
8.7 Interrupt Program
Main routine
Execution program
program
Value of the index
Z0=0
register
Save
Save area of the index
register
(for scan execution
type programs)
Value of D0
-
Switch
Return
Interrupt program
Without change
*3
Z0=0
Z0=3
Z0=0
Z0=0
Ó
D0=0
D0=3
(1)
Main routine
Switch
Interrupt program
program
Return
Without change
Z0=0
Save
Z0=0
D0=3
D0=3
(2)
*4
Z0=0
Z0=3
Ò
D0=3

Advertisement

Table of Contents
loading

Table of Contents