KEYENCE Visual KV Series User Manual
Page 198

2.4 Instruction Details
3-174
2
Chapter 2 Instructions
■ Total count 1
Writes the total count of 4 lines (0000 to 0003) into DM0000.
Reset input relay is 0005.
Coding
■ Total count 2
Counts the number of boxes transferred on 5 production lines. Produces output
when the number becomes 100 or more.
#00000
LDA
2008
0000
DM0000
STA
0005
#00000
DW
DM0000
INC
0001
DM0000
INC
0002
DM0000
INC
0003
DM0000
INC
DM0000
Clears DM0000 to #00000 when 0005 turns ON.
Sets #00000 to DM0000 at startup.
Increments DM0000 by 1 at UP edge of input relay 0000.
Increments DM0000 by 1 at UP edge of input relay 0001.
Increments DM0000 by 1 at UP edge of input relay 0002.
Increments DM0000 by 1 at UP edge of input relay 0003.
Line No.
Instruction
Operand
0000
LD
2008
0001
LDA
#00000
0002
CON
0003
STA
DM0000
0004
LD
0000
0005
@INC
DM0000
0006
LD
0001
0007
@INC
DM0000
0008
LD
0002
0009
@INC
DM0000
0010
LD
0003
0011
@INC
DM0000
0012
LD
0005
0013
DW
#00000 DM0000
0000
0005
2002
$0000
DW
DM0000
INC
0001
DM0000
INC
0002
DM0000
INC
0003
DM0000
INC
0004
DM0000
INC
DM0000
0500
2009
#00100
DM0000
CMP
LDA
Turns output relay 0500 ON when value
of DM0000 is 100 or more.
Increments DM0000 by 1 at UP edge of
input relay 0000.
Increments DM0000 by 1 at UP edge of
input relay 0001.
Increments DM0000 by 1 at UP edge of
input relay 0002.
Increments DM0000 by 1 at UP edge of
input relay 0003.
Increments DM0000 by 1 at UP edge of
input relay 0004.
Clears DM0000 when input relay 0005
turns ON.
INC / @INC / DEC / @DEC
KVNKA Chap 02_4dP.p65
08.3.11, 0:03 PM
174