Mitsubishi Electronics FX3G User Manual

Page of 964
809
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
36 Interrupt Function and Pulse Catch Function
36.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]
31
FNC277
-F
NC2
79
Da
ta
 
Trans
fer 3
32
FNC28
0-F
NC
289
H
igh-Speed 
Process
ing 2
33
FNC2
90-
FNC299
Ex
tensi
on Fi
le
 
Register C
ontrol
34
FN
C300-
FNC30
5
FX
3U
-C
F-
AD
P
35
SFC
•STL
Programming
36
Interrupt 
Function
37
Sp
ec
ia
l D
evi
ce
38
E
rror Code
A
Ve
rsi
on U
Inform
ati
on
B
Ex
ecuti
on
 T
imes
2) When using both an input interrupt and the input refresh (REF instruction)
In the program example shown below, an interrupt is processed using the latest input information.
*1.
Make sure to specify a multiple of "8" as the number of inputs/outputs to be refreshed by REF (FNC 50)
instruction.
If any value other than a multiple of "8" is specified, an operation error occurs and REF (FNC 50) instruction is
not executed.
3) When counting the number of times of input generation (in the same way as 1-phase high-speed counter)
In the program example shown below, external inputs are counted.
Step
0
I101
Interrupt
pointer
When the rising edge
of X001 is detected
M8000
RUN monitor
X010
X010
FNC 04
EI
END
FNC 06
FEND
K8
*1
X010
FNC 50
REF
Y001
SET
Y001
RST
FNC 03
IRET
Interrupts are enabled by EI instruction.
The main program is described.
The main program is finished by FEND
instruction.
When an interrupt routine is executed by turning
X001 to ON, the input refresh is executed
unconditionally, and the ON/OFF information of
X010 to X017 at the current time is received.
Y001 is set to ON or OFF according to the ON/
OFF status of X010.
Step
0
I201
Interrupt
pointer
When the rising edge of X002 is detected
M8000
RUN monitor
FNC 04
EI
END
FNC 06
FEND
D0
FNC 24
INC
FNC 03
IRET
Interrupts are enabled by EI instruction.
The main program is described.
The main program is finished by FEND
instruction.
When X002 turns ON, "1" is added to the value
of D0.
INC instruction executes increment in every
operation cycle, but the interrupt routine is
executed only once by an input signal.
Accordingly, it is not necessary to use INCP
(pulse operation type) instruction.