Mitsubishi Electronics FX3G Manuale Utente

Pagina di 964
811
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
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