14 High Speed Compare and Capture
DVP-PM Application Manual
14-5
Program example:
In this example high speed counter C204 is used. When count value exceeds K100, CLR1 will be ON; when
count value exceeds K300, CLR1 will be reset. Therefore, 2 sets of comparison is designed in this example, one
set triggers CLR1 and another resets CLR1. In comparison application, the LED of CLR1 will not respond when
CLR1 is ON. To monitor CLR1 state, connect CLR1- with 24G, CLR1+ with X7, S/S2 with +24V and an additional
MPG is required. Please see below for the example program.
Comparison initial setting: apply 2 sets of Compare (n=0, n=1). FROM/TO 10 pieces of data.
Compare setting:
n=0, Source: C204(b[3:0]=4); Compare method:≧(b[5:4]=2); SET(b[7:6]=0); output terminal: CLR1(b[11:8]=1);
Compare value: 100
n=1, Source: C204(b[3:0]=4) ; Compare method:≧(b[5:4]=2); RST(b[7:6]=1) ; output terminal: CLR1(b[11:8]=1);
Compare value: 300
M1002
MOV
K0
D0
MOV
MOV
M1
M2
TO
K253
K1
RST
M2
K0
D1
K10
D20
MOV
K10
D60
MOV
H124
D2
MOV
MOV
K0
D4
H164
D6
MOV
K300
D8
RST
M7
RST
M7
D0
D20
M3
FROM
K253
K1
RST
M3
D40
D60
M4
MOV
K1
K1M1204
SET
M5
RST
M4
M5
DCNT
C204
K10