Udc: up-down counter – KEYENCE Visual KV Series User Manual
Page 100

2.4 Instruction Details
3-76
2
Chapter 2 Instructions
Example
Coding
Timing diagram
•
When UP input relay (0001) turns ON, the current value of the counter is
incremented by one. When DOWN input relay (0002) turns ON, the current value
is decremented by one.
•
C000 turns ON when the digit shifts (#00009 to #00000, or #00000 to #00009).
Note 1: The UDC number cannot be the same as any other TMS, TMH, TMR, C, or
UDC instructions in the same program.
Note 2: The current UDC value is stored more than two months (KV-10xx: More
than 20 days) at 25°C even when the KV is not in operation or is turned off.
Operands
Key operation
UDC: Up-Down Counter
Sets a 16-bit up-down-counter.
UDC xxx
#ddddd
UP
DW
RES
ANB
5
ANL
2
FUN
0001
0002
0003
C000
0500
UDC 000
UP
#00009
DW
RES
Line No.
Instruction
Operand
0000
LD
0001
0001
LD
0002
0002
LD
0003
0003
UDC
000 #00009
0004
LD
C000
0005
OUT
0500
1
2
3
4
5
6
7
8
9
OFF
ON
OFF
ON
OFF
ON
OFF
ON
ANB
5
ANL
2
FUN
Operand
(Preset value)
Operand
(C No.)
ENT
R-SRCH
ENT
R-SRCH
UP input
DOWN input
RESET input
Current value of C000
Carry
Time
Carry
ON
C000
Input for up 0001
Input for down 0002
Input for resetting
0003
:
UDC
Visual KV
KV-300
KV-10/16
KV-24/40/80
No.: 000 to 249
No.: 000 to 249
No.: 000 to 063
No.: 000 to 119
Preset value:
Preset value:
Preset value:
Preset value:
#00000 to #65535
#00000 to #65535
#00000 to #65535
#00000 to #65535
KVNKA Chap 02_4aP.p65
08.3.11, 11:58 AM
76