beautypg.com

5 applications of ring counters, Visual kv series – KEYENCE Visual KV Series User Manual

Page 250

background image

4.4 Expanded Functions of High-speed Counters

3-226

Visual KV

Series

4

Chapter 4 High-speed Counters

0

9999

2008

0003

0005

CTH0

RES

0007

EI

2406

SET

2112

SET

2114

RES

2113

SET

2002

0001

HSP

0004

0002

END

0006

INT

CTC1

0010

0011

RETI

0009

ENDH

#00010

T000

1)

0500

RES

5)

2)

HSP

0006

2002

CTH0

0004

0004

0500

T000

3)

0500

SET

6)

2002

0008

#10000

CTC1

4)

Sets high-speed counter in
double (x2) multiplication mode.

Sets ring
counter.

Automatic reset
of high-speed
counter

4.4.5

Applications of Ring Counters

When using a 16-bit high-speed counter

The following is a ladder program that uses the ring counter of a 16-bit high-speed
counter with the preset value of "10000".

1) When the power is turned on, an EI instruction enables interrupts. Sets high-

speed counter CTH0 in double (x2) multiplication mode, CTH0 as a ring counter,
and the high-speed counter automatic reset function at counting up. Resets the
high-speed counter.

2) Sets the input time constant for input relays 0004 and 0006 to 10 µs.

3) Counts 2-phase pulses of input relays 0004 and 0006 at CTH0.

4) Sets the preset value of high-speed counter comparator CTC1 to "10000".

5) Output relay 0500 turns ON for 1 second and then turns OFF.

6) When CTC1 turns ON, an interrupt is executed. Output relay 0500 turns ON.

KVNKA Chap 04_1.p65

08.3.11, 0:06 PM

226