KEYENCE Visual KV Series User Manual
Page 173

2.4 Instruction Details
1
2
3-149
Chapter 2 Instructions
■ 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.
Coding
■ Changing the CMP setting value
Compares the current value of counter C000 with the CMP setting value. The setting
value of the CMP instruction is specified with the digital trimmer (TMIN0). The
following example changes the setting value to the range from "0" through "100".
The upper limit of the digital trimmer is set to "100".
0500 turns ON when the current value of C000 is smaller than the CMP setting
value.
0501 turns ON when the current value of C000 is equal to or greater than the CMP
setting value.
Coding
2011
2009
0001
2002
2002
C001≤#01000
C001≥#02000
C001
LDA
C001
LDA
#01000
CMP
#02000
CMP
0500
0501
#09999
0000
C001
Line No.
Instruction
Operand
Line No.
Instruction
Operand
0000
LDB
0001
0008
OUT
0500
0001
C
001 #09999 0000
0009
LD
2002
0002
LD
2002
0010
LDA
C001
0003
LDA
C001
0011
CON
0004
CON
0012
CMP
#02000
0005
CMP
#01000
0013
CON
0006
CON
0014
ANB
2009
0007
ANB
2011
0015
OUT
0501
Sets range of TMIN from 0 to 100.
2009
2009
0001
2002
2002
C000
LDA
DM0000
CMP
DM0000
STA
0
TMIN
0500
0501
#09999
00000
C000
Line No.
Instruction
Operand
Line No.
Instruction
Operand
0000
LD
2002
0011
C
000 #09999 0000
0001
TMIN
0
0012
LD
02002
0002
CON
0013
LDA
C000
0003
ADD
#00001
0014
CON
0004
CON
0015
CMP
DM0000
0005
MUL
#00004
0016
MPS
0006
CON
0017
AND
2009
0007
DIV
#00010
0018
OUT
0500
0008
CON
0019
MPP
0009
STA
DM0000
0020
ANB
2009
0010
LDB
0001
0021
OUT
0501
CMP / @CMP
KVNKA Chap 02_4cP.p65
08.3.11, 0:02 PM
149