beautypg.com

KEYENCE Visual KV Series User Manual

Page 184

background image

2.4 Instruction Details

3-160

2

Chapter 2 Instructions

Arithmetic flag

2009

No change

2010

Turns ON when the internal register is "0" after an ANDA operation.
Turns OFF at other times.

2011

No change

2012

The DM or relay indirectly addressed with #TM is out of range.

➮ "Indirect addressing" (p. 3-127)

Tips

Solution when connecting one-digit data of a BCD digital switch to inputs 0100
to 0103, while ignoring other inputs
Only one-digit data of the BCD digital switch is transferred as the setting value of the
fetching counter (C004).
Other inputs (0104 to 0115) are ignored.

Application of ANDA instruction

Fetch input data separately
Sets the low-order 2 digits of the BCD digital switch (7000 to 7007) to counter C000
and the high-order 2 digits (7008 to 7015) to timer T001.

Coding

0004

2002

#00300

C004
0005

0100

LDA

$000F

ANDA

TBIN

C004

STA

7000

LDA

$00FF
ANDA

TBIN

C000

STA

2002

TBIN

#08

SRA

$FF00
ANDA

7000

LDA

T001

STA

2002

0001

0001

#09999

C000
0000

#09999

T001

Line No.

Instruction

Operand

0000

LD

2002

0001

LDA

7000

0002

CON

0003

ANDA

$00FF

0004

CON

0005

TBIN

0006

CON

0007

STA

C000

0008

LD

2002

0009

LDA

7000

0010

CON

0011

ANDA

$FF00

0012

CON

0013

SRA

#08

0014

CON

0015

TBIN

0016

CON

0017

STA

T001

0018

LDB

0001

0019

C

000 #09999 0000

0020

LDB

0001

0021

T

001 #09999

Converts data of 7000 to 7007 to BIN and
writes it into C000.

Shifts data to right by 8 bits, converts it to BIN,
and writes it into T001.

Sets C000.

Sets T001.

ANDA / @ANDA

KVNKA Chap 02_4cP.p65

08.3.11, 0:02 PM

160