8 Interrupt Function and Pulse Catch Function
8.8 Pulse width/Pulse period measurement function
828
FXCPU Structured Programming Manual
(Basic & Applied Instruction)
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.
X000 Rising edge ring counter value:
H0 to H7FFFFFFF
X001 Rising edge ring counter value:
H80000000 to HFFFFFFFF
X000 Rising edge ring counter value:
H80000000 to HFFFFFFFF
X001 Rising edge ring counter value:
H0 to H7FFFFFFF
The obtained value is converted into a value
in units of 10 μs.
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
*2
.
The interrupt routine is executed at the rising edge of
the input signal from X001.
[Interrupt program]
(Event: I101)
X001 Rising edge interrupt
DMOV
M8000
RUN monitor
VAR_03
*1
VAR_04
*1
EN ENO
sd
DINC
VAR_24
*1
EN ENO
d
DMOV
VAR_05
*1
VAR_06
*1
EN ENO
sd
DSUB
VAR_07
*1
VAR_09
*1
EN ENO
s1 d
VAR_08
*1
s2
DSUB
VAR_15
*1
VAR_17
*1
EN ENO
s1 d
VAR_16
*1
s2
DSUB
VAR_18
*1
VAR_20
*1
EN ENO
s1 d
VAR_19
*1
s2
DADD
VAR_21
*1
VAR_23
*1
EN ENO
s1 d
VAR_22
*1
s2
LDD>=
VAR_11
*1
EN ENO
s1
VAR_12
*1
s2
ANDD<
VAR_13
*1
EN ENO
s1
VAR_14
*1
s2
DINC
VAR_35
*1
EN ENO
d
DSUB
VAR_29
*1
VAR_31
*1
EN ENO
s1 d
VAR_30
*1
s2
DSUB
VAR_32
*1
VAR_34
*1
EN ENO
s1 d
VAR_33
*1
s2
LDD<
VAR_25
*1
EN ENO
s1
VAR_26
*1
s2
ANDD>=
VAR_27
*1
EN ENO
s1
VAR_28
*1
s2
M8000
DDIV
VAR_36
*1
VAR_38
*1
EN ENO
s1 d
VAR_37
*1
s2
User program