Mitsubishi Electric MELSEC FX3U Programming Manual page 873

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
3) Signal delay time measurement
The delay time from the rising edge of the input signal from X000 to the rising edge of the input signal
from X001 is measured.
Step
0
M8075
Pulse width
/Pulse period
measurement
setting flag
X001 Rising edge interrupt
interrupt
M8000
pointer
I101
RUN
monitor
When either one between the ring counter value at the rising edge of the input signal from X000 and
the ring counter value at the rising edge of the input signal from X001 is located within the range from
H80000000 to HFFFFFFFF, the following process is executed, and the value "Ring counter value
at the rising edge of the input signal from X001 - Ring counter value at the rising edge of the input
signal from X000" is stored in D9 and D8*
FNC 230
LDD>=
X000 Rising edge ring counter value:
X001 Rising edge ring counter value:
FNC 226
LDD<
X000 Rising edge ring counter value:
X001 Rising edge ring counter value:
M8000
36.8 Pulse width/Pulse period measurement function [M8075 to M8079, D8074 to D8097]
X000
X001
This duration is measured.
FNC 04
EI
M8076
M8077
FNC 06
FEND
FNC 12
D8074
D0
DMOV
FNC 12
D8080
D2
DMOV
FNC 21
D2
D0
D8
DSUB
FNC 234
D0
K0
ANDD<
H0 to H7FFFFFFF
H80000000 to HFFFFFFFF
FNC 238
D0
K0
ANDD>=
H80000000 to HFFFFFFFF
H0 to H7FFFFFFF
FNC 23
D8
K60
D10
DDIV
User program
FNC 03
IRET
END
36 Interrupt Function and Pulse Catch Function
ON
OFF
ON
OFF
Interrupts are enabled after EI (FNC 04) instruction.
The main program is described.
X000 is used for the pulse width/pulse period
measurement function.
X001 is used for the pulse width/pulse period
measurement function.
The interrupt routine is executed at the rising edge of
the input signal from X001.
The ring counter value at the rising edge of the input
signal from X000 stored in D8074 and D8075 is
transferred to D1 and D0.
The ring counter value at the rising edge of the input
signal from X001 stored in D8080 and D8081 is
transferred to D3 and D2.
The value "Ring counter value at the rising edge of
the input signal from X001 - Ring counter value at the
rising edge of the input signal from X000" is stored in
D9 and D8.
1
.
FNC 21
D2
K0
DSUB
FNC 21
DSUB
FNC 20
DADD
FNC 24
DINC
FNC 21
D2
K0
DSUB
FNC 20
DADD
FNC 24
DINC
The obtained value is converted into a value in units
of 10 µs.
Interrupt return
H7FFFFFFF
D0
D4
D2
H80000000
D6
D4
D6
D8
D8
HFFFFFFFF
D0
D4
D2
D4
D8
D8
871
31
32
33
34
35
36
37
38
A
B

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents