Mitsubishi Electronics FX3G User Manual

Page of 964
821
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.8 Pulse width/Pulse period measurement function [M8075 to M8079, D8074 to D8097]
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) Pulse period measurement
The pulse period of the input signal from X000 is measured.
- Timing chart
The pulse period is not measured when the input signal rises for the first time after the PLC mode is changed 
from STOP to RUN, or when the input signal rises for the first time after the pulse period measurement mode 
(M8080) is set to from OFF to ON. (Accordingly, D8078 and D8079 are not updated.)
The pulse period is measured when the input signal rises at the next time. (As a result, D8078 and D8079 are 
updated.)
Make the pulse width/pulse period measurement setting flag (M8080) remain OFF for 1 operation cycle or more 
when discontinuing the pulse input.
If M8080 does not remain OFF for 1 operation cycle or more, the "a" period shown below is stored as the pulse 
period.
X000
OFF
ON
This duration is measured.
FNC 04
EI
FNC 03
IRET
END
Step
0
FNC 06
FEND
User program
I001
interrupt
pointer
X000 Rising edge interrupt
Interrupt return
Interrupts are enabled after the EI (FNC 04)
instruction.
The main program is described.
X000 is used for the pulse width/pulse period
measurement function.
When X002 turns ON, the pulse period measurement
mode is actuated. 
When the interrupt routine is executed at the
rising edge of the input signal from X000, the
pulse period of input signal from X000 stored in
D8078 and D8079 is transferred to D1 and D0.
M8075
M8000
RUN monitor
FNC 12
DMOV D8078
D0
User program (Interrupt at the rising edge(X000))
Pulse width
measurement
setting flag
M8076
X002
M8080
/Pulse period
M8080
RUN/STOP
RUN
X000
a
The pulse period is measured.
(D8078 and D8079 are updated.)
The pulse period is measured.
(D8078 and D8079 are updated.)
The pulse period is
not measured. 
The pulse period is
not measured. 
one operation cycle
ON
ON
pulse period