KEYENCE Visual KV Series User Manual

Page 174

Advertising
background image

2.4 Instruction Details

3-150

2

Chapter 2 Instructions

ADD, SUB, MUL, and DIV allow arithmetic instructions between the contents of
internal register and the value specified by the operand.

Note: Arithmetic instructions use binary numbers (BIN). Therefore, the contents of
the internal register used for the arithmetic instruction must be BIN data. Use the
TBIN instruction to convert BCD data into BIN data.

Operands

Key operation

ADD: Add

@ADD: Add

SUB: Subtract

@SUB: Subtract

MUL: Multiply

@MUL: Multiply

DIV: Divide

@DIV: Divide

Adds value specified by operand to contents of
internal register, and inputs result back to same
internal register.

@

#,$

FUN

FUN

@

#,$

FUN

FUN

@

#,$

FUN

FUN

@

#,$

FUN

FUN

LDB

4

SET

1

SET

1

RES

0

RES

0

AND

8

ANL

2

ORB

6

LDB

4

SET

1

SET

1

RES

0

RES

0

AND

8

ANL

2

ORB

6

nnnn

DIV

nnnn

DIV

nnnn
MUL

nnnn
MUL

nnnn

SUB

nnnn

SUB

nnnn

ADD

nnnn

ADD

ADD

SUB

MUL

DIV

(#XXXXX)

($XXXX)

DM0000 to DM1999
TM00 to TM31
#TM00 to #TM29

@

#,$

FUN

FUN

@

#,$

FUN

FUN

@

#,$

FUN

FUN

@

#,$

FUN

FUN

LDB

4

SET

1

SET

1

RES

0

RES

0

ANL

2

ORB

6

AND

8

ENT

R-SRCH

ENT

R-SRCH

Operand

ENT

R-SRCH

ENT

R-SRCH

Operand

ENT

R-SRCH

ENT

R-SRCH

Operand

ENT

R-SRCH

ENT

R-SRCH

Operand

Internal register

Operand

Constants

Data memories

Hexadecimal

Result

Arithmetic operation

Decimal

Internal register

:

:

:

:

:

:

:

:

Subtracts value specified by operand from
contents of internal register, and inputs results
back to same register.

Multiplies contents of internal register by value
specified by operand, and inputs result back to
same register.

Divides contents of internal register by value
specified by operand, and inputs result back to
same register.

ADD / @ADD / SUB / @SUB / MUL / @MUL / DIV / @DIV

Visual KV

KV-300

KV-10/16

KV-24/40/80

DM0000 to DM1999 DM0000 to DM9999 DM0000 to DM0999 DM0000 to DM1999

TM00 to TM31

TM00 to TM31

TM00 to TM31

TM00 to TM31

#00000 to #65535

#00000 to #65535

#00000 to #65535

#00000 to #65535

$0000 to $FFFF

$0000 to $FFFF

$0000 to $FFFF

$0000 to $FFFF

#TM00 to #TM29

#TM00 to #TM29

#TM00 to #TM29

#TM00 to #TM29

KVNKA Chap 02_4cP.p65

08.3.11, 0:02 PM

150

Advertising