Examples Of Practical Programs (Programs To Measure Short Pulse Width) - Mitsubishi Electric MELSEC FX3U Programming Manual

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition

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
24V
0V
S/S X000 X001
ex:FX
PLC(sink input)
3U
Step
0
When the rising edge of
Interrupt
X000 is detected
pointer
M8000
I001
X010
When the falling edge of
Interrupt
X001 is detected
pointer
X010
I100
M0
M8000
36.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]
X010:Preparation
for measurement
SW
SW(X000,X001)
FNC 04
EI
FNC 06
FEND
The reset
RST
T246
status is
cleared
RST
M0
RST
D0
K32767
Timer is driven
T246
FNC 03
IRET
Measurement data
FNC 12
T246
D0
M0V
Measurement
SET
M0
is completed
K1
Timer is stopped
T246
Timer is
RST
T246
reset
FNC 03
IRET
END
36 Interrupt Function and Pulse Catch Function
This period of time is measured.
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
A
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.
B
31
32
33
34
35
36
37
38
A
B
859

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents