KEYENCE Visual KV Series User Manual
Page 369

8.2 Details
3-345
1
8
Chapter 8 Programming Examples
2002
0005
#9999
C000
STA
C000
LDA
DM0000
0001
■ Changing the counter setting value
Sets the setting value of counter C000 to DM0000. Reset input is 0005.
Ladder diagram
Coding
■ Changing the timer setting value
Sets the setting value of timer T000 to DM0000. Reset input is 0005.
Ladder diagram
Coding
➮ Refer to p. 3-140.
Application of CMP (compare) instruction
■ When comparing values with no specific range
Turns ON 0500 when the DM0000 value is smaller than the CMP value.
Turns ON 0501 when the DM0000 value is equal to the CMP value.
Turns ON 0502 when the DM0000 value is greater than the CMP value.
Ladder diagram
Coding
■ Setting the upper/lower limit
Turns ON 0500 when the C001 value is 1000 or less.
Turns ON 0501 when the C001 value is 2000 or more.
Ladder diagram
Line No. Instruction
Operand
0000
LD
2002
0001
LDA
DM0000
0002
CON
0003
STA
C000
0004
LDB
0005
0005
C
000 #9999 0001
2002
0005
#9999
T000
STA
T000
LDA
DM0000
Line No. Instruction
Operand
0000
LD
2002
0001
LDA
DM0000
0002
CON
0003
STA
T000
0004
LDB
0005
0005
T
0000 #9999
2002
0502
2011
CMP
#01000
LDA
DM000
0500
2009
DM0000
<#01000
DM0000
=#01000
DM0000
>#01000
0501
2010
Line No. Instruction
Operand
0000
LD
2002
0001
LDA
DM0000
0002
CON
0003
CMP
#01000
0004
MPS
0005
AND
2009
0006
OUT
0500
0007
MRD
0008
AND
2010
0009
OUT
0501
0010
MPP
0011
AND
2011
0012
OUT
0502
2002
0001
#09999
C001
CMP
#02000
LDA
C001
0501
2009
C001
≤
#1000
C001
≥
#02000
2002
CMP
#01000
LDA
C001
0500
2011
0000
KVNKA Chap 08.p65
08.3.11, 0:12 PM
345