beautypg.com

KEYENCE Visual KV Series User Manual

Page 193

background image

2.4 Instruction Details

1

2

3-169

Chapter 2 Instructions

Example

Coding

Operands

#01 to #16

Key operation

Arithmetic flag

2009

Turns ON when "1" enters 2009 after an RRA/RLA operation. Turns
OFF at other times.

2010

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

2011, 2012 No change

Description

Operation when using the RRA instruction

When input relay 0000 is ON, the contents of DM0000 are transferred to the internal
register. The contents of the internal register and carry (2009) are rotated clockwise
by the operand value.
In the above example, the contents are rotated clockwise every scan time while
input relay 0000 is ON.

RRA: Rotate Right A

@RRA: Rotate Right A

RLA: Rotate Left A

@RLA: Rotate Left A

Rotates contents of internal register and
carry (2009) clockwise by operand value.

Rotates contents of internal register and
carry (2009) counterclockwise by operand
value.

@

#,$

FUN

FUN

@

#,$

FUN

FUN

L D

7

ANB

5

ORL

3

ORL

3

L D

7

ANB

5

ORL

3

ORL

3

#dd

RRA

#dd

RRA

#dd

RLA

#dd

RLA

0000

DM0000

LDA

#01

RRA

DM0001

STA

0001

DM0010

LDA

#04

RLA

DM0011

STA

Line No.

Instruction

Operand

0000

LD

0000

0001

LDA

DM0000

0002

CON

0003

RRA

#01

0004

CON

0005

STA

DM0001

0006

LD

0001

0007

LDA

DM0010

0008

CON

0009

RLA

#04

0010

CON

0011

STA

DM0011

@

#,$

FUN

FUN

@

#,$

FUN

FUN

L D

7

ANB

5

ORL

3

ORL

3

ENT

R-SRCH

ENT

R-SRCH

Operand

ENT

R-SRCH

ENT

R-SRCH

Operand

:

:

:

:

RRA / @RRA / RLA / @RLA

KVNKA Chap 02_4dP.p65

08.3.11, 0:03 PM

169