KEYENCE Visual KV Series User Manual

Page 380

Advertising
background image

8.2 Details

3-356

8

Chapter 8 Programming Examples

2002

DMX

LDA

07000

2002

ANDA

TBCD

$00FF

STA

8000

STA

7500

TBCD

LDA

0001

#09999

C001

2002

C001

0000

Converts the most significant bit of 16-bit data
(7000 to 7015) to 4-bit BIN data and sends it to
internal register.
Converts internal register data to BCD data,
executes ANDA instruction, and outputs the data
to 8000 to 8015.

Line No.

Instruction

Operand

Line No.

Instruction

Operand

0000

LDB

0001

0004

CON

0001

C

001 #09999 0000

0005

TBCD

0002

LD

2002

0006

CON

0003

LDA

C001

0007

STA

7500

DM0000 x DM0001 = TM00

Internal register

DM00 Internal register ÷ #10000 = TM00

Internal register --- TM01

(High-order 4 digits)

(Low-order 4 digits)

(High-order 4 digits)

(Low-order 4 digits)

(Remainder)

8500 to 8515 7500 to 7515

(Display)

(High-order 4 digits) (Low-order 4 digits)

Application of DMX instruction

Output of error input No. in BCD
Outputs the error sensor No. from input relay 7000 to 7015 to output relays 8500 to
8507 in 2-digit BCD.

Ladder diagram

Coding

➮ Refer to p. 3-176.

Applications of TBCD instruction

Output of 4-digit BCD data
Outputs the current value of counter C001 to 7500 to 7515 in 4-digit BCD data.

Ladder diagram

Coding

Output of 8-digit BCD data
Outputs the calculated product of DM0000 x DM0001 (0 to 99999999) in BCD of 8
digits at maximum as below:

High-order 4-digit BCD data

➞ To 8500 to 8515

Low-order 4-digit BCD data

➞ To 7500 to 7515

Line No.

Instruction

Operand

Line No.

Instruction

Operand

0000

LD

2002

0005

TBCD

0001

LDA

7000

0006

CON

0002

CON

0007

ANDA

$00FF

0003

DMX

0008

CON

0004

LD

2002

0009

STA

8000

KVNKA Chap 08.p65

08.3.11, 0:12 PM

356

Advertising