beautypg.com

Hitachi NJI-350B User Manual

Page 140

background image

Chapter 5 Instruction Specifications

5-90

Item number

Application instructions-18

Name

Binary

→ BCD conversion

Ladder format

Condition code

Processing time (

µs)

Remark

R7F4

R7F3

R7F2

R7F1

R7F0

Average Maximum

BCD (d, s)

DER

ERR

SD

V

C

Upper case: W

z

z

z

z

79

Lower case: DW

Instruction format

Number of steps

Condition

Steps

BCD (d, s)

Word

3

89

Double word

4

Bit

Word

Double word

Usable I/O

X

Y

R,

M

TD, SS,

CU, CT

WX WY

WR,

WM TC DX DY

DR,

DM

C

onstant

Other

d

I/O after conversion (BCD)

{

{

{

{

s

I/O before conversion
(BIN)

{

{

{

{

{

{

{

{

Function

• The result of the content conversion of s from binary to BCD is output to d.
• If the conversion result of s exceeds the number of BCD data digits in d, DER (R7F4) is set to '1' and the instruction will not

be executed.
If s is a word:

set s so that H0000

≤ s ≤ H270F (0 to 9999).

If s is a double word:

set s so that H00000000

≤ s ≤ H5F5E0FF (0 to 99999999).

0

0

0

1

1

0

1

1

0

1

0

0

1

1

1

1

1

B

4

F

0

1

1

0

1

0

0

1

1

0

0

1

0

0

0

1

6

9

9

1

1B4FH=6991

(BCD)

Before execution s

After execution d

(Binary)

Combinations of d and s.

d

s

Word

Word

Double word

Double word

Notes

• If a data error occurred, the previous contents of d are retained.

Program example

X00000

BCD (WM0010, WR000 )

LD

X00000

[

BCD (WM0010, WR000)

]

Program description

• When X00000 turns on, the content of WR000 is converted from binary to BCD and output to WM0010.

WR000

H1B4F

After conversion

WM0010

H6691

BC
D

(

d,

s)