9 binary to bcd (bcd), 1) overview, 2) format – Yaskawa MP2000 Series: User's Manual for Motion Programming User Manual

Page 253: 3) programming examples

Advertising
background image

8 Command Reference

8.9.9 Binary to BCD (BCD)

8-146

8.9.9 Binary to BCD (BCD)

(1) Overview

The Binary to BCD (BCD) command converts binary data to BCD data.
Only integer data can be used. If the binary data is 9999 or higher or is a negative value, a correct result cannot be
obtained.

(2) Format

Note: Example 1

Example 2

If the binary data is greater than 9999, a correct result cannot be obtained.

(3) Programming Examples

BCD command programming examples are shown below.

Motion Programs

Sequence Programs

Applicable

Applicable

MW00100 = BCD (1234);

A B

Item Description

Usable Registers

A

BCD data

output

• All integer and double integer type registers (Excluding # and C registers)
• The above registers with subscript
• Subscript registers

B

Binary data

input

• All integer and double integer type registers (Excluding # and C registers)
• The above registers with subscript
• Subscript registers
• Constants

MW00101

Converted to

MW00100

2

3

4

1

4

D

2

0

(1234H)

1234 (decimal)

0

3

9

3

MW00101

Converted to

3

4

5

C

MW00100

(C345H)

12345 (decimal)

INFO

Type

Motion Programs/

Sequence Programs

Ladder Programs

B

W

MW00101=BCD(MW00100);

L

ML00102=BCD(ML00100);

F

EXAMPLE

Advertising