DVP - ES2/SA2/SS2/SA2/SX2/SE Operation Manual - Programming

API

Mnemonic

Operands

Function

Controllers

18

D

BCD

 

P

 

 

 

 

Convert BIN to BCD

 

 

ES2/EX2

SS2

SA2

SX2

 

 

 

 

 

 

 

SE

 

Type

Bit Devices

 

 

 

Word devices

 

 

 

 

Program Steps

 

OP

 

X

Y

M

S

K

H KnX KnY KnM KnS T

C

D

E

F

BCD, BCDP: 5 steps

 

 

S

 

 

 

 

 

 

*

*

*

*

*

*

*

*

*

DBCD, DBCDP: 9 steps

 

D

 

 

 

 

 

 

 

*

*

*

*

*

*

*

*

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

16-bit

 

 

 

32-bit

 

 

 

 

 

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2 ES2/EX2

SS2

SA2

SX2

 

 

 

 

 

 

SE

SE

SE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Operands:

S: Source of data D: Conversion result

Explanations:

1.The content in S (BIN value) is converted into BCD value and stored in D

2.As a 16-bit (32-bit) instruction, when the conversion result exceeds the range of 0 ~ 9,999 (0 ~ 99,999,999), and M1067, M1068 = ON, D1067 will record the error code 0E18 (hex)

3.If operand S and D use index register F, only 16-bit instruction is available.

4.Flags: M1067 (Program execution error), M1068 (Execution error locked), D1067 (error code)

Program example:

1.When X0 = ON, the binary value of D10 will be converted into BCD value, and the 1s digit of the conversion result will be stored in K1Y0 (Y0 ~ Y3, the 4 bit devices).

X0

BCD D10 K1Y0

2.If D10=001E (Hex) = 0030 (decimal), the result will be Y0~Y3 = 0000(BIN).

3 - 72

Page 188
Image 188
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Bcd