Visual kv series – KEYENCE Visual KV Series User Manual

Page 268

Advertising
background image

4.7 Examples of Direct Clock Pulse Output

3-244

Visual KV

Series

4

Chapter 4 High-speed Counters

Example

Count value

Sets the pulse output from output relay 0501 with special utility relays 2204 through 2207.
In this example, turns OFF 2204 to enable direct output from 0501 and turns ON 2207 to
reverse the output each time the CTH1 value reaches the CTC2 value.

Turns ON 2203 to set CTH1 to be cleared when its value reaches the CTC2 value.
With this setting, the operation which clears the CTH1 current value when it reaches the
CTC2 preset value is repeated.

The RES CTH1 instruction resets the CTH1 current value when operation starts. This
ensures that the first clock pulse is output at the proper pulse width.
Turn ON the input enable relay for CTH1 all the time when CTH1 is used to output the
clock pulse.

Coding

Note :When the input enable relay for the high-speed counter is used to start/stop
the clock pulse, the response is delayed by a maximum of one scan when output
starts. Moreover, if the response is delayed by one scan when output stops, the
clock pulse stops but the output may remain ON.

Tips

Use special utility relay 2205 to control (enable/disable) the clock pulse output by
external inputs.

Use the SET-RES pair or KEEP instruction to turn special utility relay 2205 ON/
OFF.

With this setting, the clock pulse is always turned OFF when it starts as well as
stops.

When either of the following programs is added to the example on the previous
page, the clock pulse is output from 0501 only when 0000 is ON.

When SET-RES instructions are used

When KEEP instruction is used

0000

0000

2205

RES

2205

SET

0000

0000

RES

KEEP

2205

SET

CTC2

ON

ON

y

a

l

e

r

y

t

i

l

i

t

u

l

a

i

c

e

p

S

k

c

o

l

c

l

a

n

r

e

t

n

I

e

u

l

a

v

t

e

s

e

r

p

2

C

T

C

0

0

2

2

0

.

1

µs

0

0

5

1

0

2

2

0

.

0

1

µs

0

5

2

0

2

2

0

.

0

0

1

µs

5

2203

SET

2204

RES

2205

RES

2206

RES

CTH1

RES

2008

2002

#00050

CTC2

CTH1

2201

0001

0002

0003

2207

SET

Line No.

Instruction

Operand

Line No.

Instruction

Operand

0000

LD

2008

0008

CON

0001

SET

2203

0009

SET

2207

0002

CON

0010

CON

0003

RES

2204

0011

RES

CTH1

0004

CON

0012

LD

2002

0005

RES

2205

0013

CTH

1 2201

0006

CON

0014

CTC

2 #00050

0007

RES

2206

KVNKA Chap 04_2.p65

08.3.11, 0:08 PM

244

Advertising