beautypg.com

Visual kv series – KEYENCE Visual KV Series User Manual

Page 254

background image

4.5 Special Functions Using High-speed Counters

3-230

Visual KV

Series

4

Chapter 4 High-speed Counters

Program for speed control
The following ladder program illustrates speed control using the specified frequency
pulse output function.
Control is started when input relay 0000 turns ON. The operation is slowed down
and then stopped when input relay 0001 turns ON.
By specifying the speed (Hz) in data memory DM0000, the program controls the
speed with a start-up speed of 16 Hz and an acceleration speed of 100 Hz/100 ms.

1) Sets "16" as the preset speed at the rising edge of input relay 0000. Turns ON

special utility relay 2306 to start the specified frequency pulse output. Then, turns
ON the operating flag.

2) Turns ON slow-down-stop flag 1101 at the rising edge of input 0001.
3) When the slow-down-stop flag turns ON, sets the preset speed to "16". When the

output frequency reaches "16", turns OFF the operation start flag, operating flag,
and slow-down-stop flag.

4) Activates a 100-ms flicker circuit while the operating flag turns ON.
5) Compares the current speed and preset speed every 100 ms. Executes subrou-

tine 0 when the preset speed is faster, and executes subroutine 1 when the
preset speed is slower.

6) Output relay 0500 turns ON when a setting error occurs.
7) Acceleration process. When the current speed is slower than the preset speed by

less than "100", the speed is accelerated by the difference. When the difference
is "100" or more, the speed is accelerated by "100".

8) Deceleration process. When the current speed is faster than the preset speed by

less than "100", the speed is decelerated by the difference. When the difference
is "100" or more, the speed is decelerated by "100".

0003

0005

TM02

ADD

#00016

LDA

DM1936

LDA

DM0000

CMP

DM0000

STA

DM1936

CMP

DM1936

STA

TM02

STA

DM1936

LDA

0001

2010

2307

0002

0006

END

SBN

00

SBN

01

RET

0004

0500

1000
DIFU

0000

1000

1100

SET

1001
DIFU

#00100

T

000

S

0001

1001

1101

SET

1101

DM0000

LDA

DM1936

SUB

#00100

CMP

2011

#00100

ADD

DM1936

STA

DM1936

LDA

2011

2002

TM02

SUB

DM1936

STA

TM02

STA

DM1936

LDA

RET

ENDH

DM1936

LDA

DM0000

SUB

#00100

CMP

2011

#00100

SUB

DM1936

STA

DM1936

LDA

2011

2002

1100

00

CALL

T000

0007

0008

0011

0013

0009

0010

0014

0012

0015

0016

0017

2009

01

CALL

2011

T000

1101

RES

1100

RES

2306

RES

2306

SET

1)

2)

3)

4)

5)

6)

7)

8)

#00016

LDA

DM1936

STA

KVNKA Chap 04_2.p65

08.3.11, 0:08 PM

230