KEYENCE Visual KV Series User Manual

Page 370

Advertising
background image

8.2 Details

3-346

8

Chapter 8 Programming Examples

2002

0501

2009

CMP

DM0000

LDA

C000

0500

2009

2002

DIV

#00010

MUL

#00004

ADD

#00001

TMIN

0

0001

#09999

C000

00000

STA

DM0000

Sets the TMIN setting
range from 0 to 100.

Coding

Line No.

Instruction

Operand

Line No.

Instruction

Operand

0000

LDB

0001

0008

OUT

0500

0001

C

001 #09999 0000

0009

LD

2002

0002

LD

2002

0010

LDA

C001

0003

LDA

C001

0011

CON

0004

CON

0012

CMP

#02000

0005

CMP

#01000

0013

CON

0006

CON

0014

ANB

2009

0007

ANB

2011

0015

OUT

0501

Changing the CMP setting value
Compares the current value of C000 to the CMP setting value. Sets the CMP setting
value to analog timer TMIN0.
The following example changes the setting value within the range from 0 to 100.
Turns ON 0500 when the C000 value is smaller than the CMP setting value.
Turns ON 0501 when the C000 value is greater than the CMP setting value.

Ladder diagram

Coding

Multi-level comparator
Compares the counter current value according to the following range:

0 to 999

→ 0500 turns ON.

1000 to 1999

→ 0501 turns ON.

2000 to 2999

→ 0502 turns ON.

Counter reset relay 0001
Counter input relay 0000

Line No.

Instruction

Operand

Line No.

Instruction

Operand

0000

LD

2002

0011

C

000 #09999 0000

0001

TMIN

0

0012

LD

02002

0002

CON

0013

LDA

C000

0003

ADD

#00001

0014

CON

0004

CON

0015

CMP

DM0000

0005

MUL

#00004

0016

MPS

0006

CON

0017

AND

2009

0007

DIV

#00010

0018

OUT

0500

0008

CON

0019

MPP

0009

STA

DM0000

0020

ANB

2009

0010

LDB

0001

0021

OUT

0501

KVNKA Chap 08.p65

08.3.11, 0:12 PM

346

Advertising