Mitsubishi Electronics FX3G User Manual

Page of 964
812
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]
2. Example of program to measure the short pulse width using a high-speed ring counter (only in 
FX
3U
/FX
3UC
 PLCs)
Current
value of T246
1
2
6
X010: Preparation
for measurement
SW(X000,X001)
RST
T246
3
4
5
M0
-Timing chart
Part  B  in the previous page
I001(Interrupt processing)
I100(Interrupt processing)
Part  A  in the previous page
Step
0
I001
Interrupt
pointer
X010
I100
Interrupt
pointer
X010
X010
Measurement data
When the rising edge of
X000 is detected
When the falling edge of
X001 is detected
D8099 is set to ON
Measurement
is completed
FNC 04
EI
M8099
FNC 06
FEND
FNC 03
IRET
FNC 12
M0V
FNC 03
IRET
END
RST
D8099
RST
M0
D8099
D0
SET
M0
When X001 turns OFF: The ring counter value
is transferred to D0,
and measurement is
completed.
Interrupts are enabled by the EI instruction.
The main program is described.
The ring counter is set to ON.
When X000 turns ON: The ring counter is reset
to OFF, and
measurement is started.
The special data register M8099 up-counts the
0.1 ms clock from the next operation cycle after
being driven.
When the count value exceeds "32767", it is
returned to "0".