![Mitsubishi Electric MELSEC FX3G Programming Manual Download Page 861](http://html.mh-extra.com/html/mitsubishi-electric/melsec-fx3g/melsec-fx3g_programming-manual_239083861.webp)
859
FX
3G
/FX
3U
/FX
3UC
Series Programmable Controllers
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
FN
C
275-
FN
C
279
Da
ta
Transf
er 3
32
FN
C
280-
FN
C
289
H
igh Speed
Pr
ocessing 2
33
FN
C
29
0-F
N
C
299
Ext
ens
ion Fi
le
R
egi
ster
34
FN
C
300-
FN
C
305
FX
3U
-C
F-A
D
P
35
SFC•S
TL
Pr
ogr
am
m
ing
36
In
ter
rupt
Functi
on
37
Special D
evice
38
E
rro
r C
ode
A
Ve
rs
ion U
p
In
fo
rm
atio
n
B
Execution T
im
es
36.3.2 Examples of practical programs (programs to measure short pulse width)
By using a 1 ms retentive type timer or the special data register D8099 (high speed ring counter), the short
pulse width can be measured in 1 ms or 0.1 ms units.
1. Example of program to measure the short pulse width using a retentive type 1ms timer
0V
S/S X000 X001
SW
ex:FX
3U
PLC(sink input)
24V
This period of time is measured.
X010:Preparation
for measurement
SW(X000,X001)
Step
0
I001
Interrupt
pointer
M8000
X010
K32767
I100
Interrupt
pointer
When the falling edge of
X001 is detected
X010
M0
K1
M8000
The reset
status is
cleared
Timer is driven
Measurement
is completed
Timer is stopped
Timer is
reset
Measurement data
When the rising edge of
X000 is detected
FNC 04
EI
FNC 06
FEND
T246
FNC 03
IRET
FNC 12
M0V
T246
FNC 03
IRET
END
T246
D0
SET
M0
RST
T246
RST
T246
RST
M0
RST
D0
Interrupts are enabled by the EI instruction.
The main program is described.
The main program is finished by the FEND
instruction.
When X000 turns ON, the 1 ms timer
T246 is started up by the interrupt I001.
When X001 turns OFF, the current value
of T246 is transferred to the data register
D0 for storing the measured value by the
interrupt I100, and M0 for the complete
signal is set to ON.
"T246" is set to OFF, and the timer is
stopped.
A
B