C: counter – KEYENCE Visual KV Series User Manual
Page 96

2.4 Instruction Details
3-72
2
Chapter 2 Instructions
0001
0000
#00010
C000
Example
Coding
Timing diagram (C000#00010 and 0500 in the above example)
Description
•
The counter performs one counting at the rising edge of clock pulse. When the
current value reaches the preset value, the coil of specified No. turns ON.
•
When a reset input (b [N.C.] contact) turns ON, the current counter value is reset
to "00000".
•
Since C is software counter which is set on the program, the response speed
depends on the scan time.
Note 1: When a reset input is provided using an a (N.O.) contact, the current
counter value is reset at power-off.
Note 2: The C number cannot be the same as any other TMS, TMH, TMR, C, or
UDC instructions in the same program.
Note 3: The current C 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.
Tips
By entering relay 2007 (which can turn the counter OFF for only the first scan time
when the operation is started) using an 'a' (N.O.) contact in series as the input relay
for resetting counter, you can reset the current C value whenever the operation is
started.
C: Counter
Sets a 16-bit up-counter.
#ddddd
nnnn
Cxxx
CTR
(
C
)
0001
C000
0500
0000
#00010
C000
Line No.
Instruction
Operand
0000
LDB
0001
0001
C
000 #00010 0000
0002
LD
C000
0003
OUT
0500
ON
#00010
1
2
3
4
5
6
7
8
9
10
C000
0500
OFF
ON
:
Reset input
Preset value
Counter No.
Count input
0000
(Count input)
0001
(Reset input)
Current value
of C000
C
KVNKA Chap 02_4aP.p65
08.3.11, 11:58 AM
72