KEYENCE Visual KV Series User Manual
Page 377

8.2 Details
3-353
1
8
Chapter 8 Programming Examples
Coding
➮ Refer to p. 3-166.
Application of RRA/RLA instructions
■ Error input count
Writes the number of error detection sensors, which are connected to input relays
(7000 to 7015) and turn ON, into DM0000.
Ladder diagram
Coding
➮ Refer to p. 3-169.
Applications of INC/DEC instructions
■ Total count
Writes the total count of 4 lines (0000 to 0003) into DM0000.
Reset input relay is 0005.
Line No.
Instruction
Operand
Line No.
Instruction
Operand
0000
LD
0001
0011
LDA
8000
0001
C
001 #00099 0000
0012
CON
0002
LD
2002
0013
ANDA
$000F
0003
LDA
7000
0014
LD
2002
0004
CON
0015
SLA
#04
0005
ANDA
$F000
0016
CON
0006
LD
2002
0017
ORA
DM0000
0007
SRA
#12
0018
LD
2002
0008
CON
0019
TBIN
0009
STA
DM0000
0020
CON
0010
LD
2002
0021
STA
C001
Line No.
Instruction
Operand
Line No.
Instruction
Operand
0000
LD
2002
0009
LD
2002
0001
LDA
7000
0010
LDA
TM10
0002
FOR
#00016
0011
CON
0003
LD
02002
0012
STA
DM0000
0004
RRA
#01
0013
CON
0005
CON
0014
LDA
#00000
0006
AND
2009
0015
CON
0007
INC
TM10
0016
STA
TM10
0008
NEXT
Writes the TM10 data into DM0000, and then writes
#00000 to TM10.
2002
RRA
#01
INC
TM10
LDA
7000
#00016
2002
LDA
TM10
LDA
DM0000
STA
STA
TM10
2002
2009
#00000
N E X T
F O R
Writes the data of 7000 to
7015 into internal register.
Executes FOR-NEXT instruction for 16 times.
Shifts the data including carry (2009) to right,
and increments TM10 by 1 when 2009 is ON.
KVNKA Chap 08.p65
08.3.11, 0:12 PM
353