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

API

118

Mnemonic Operands

Function

Controllers

D

EBCD

P

Float to scientific conversion

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

DEBCD, DEBCDP: 9

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

steps

 

 

S

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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 device

D: Conversion result

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Explanation

1.The instruction converts the binary floating point value in S to decimal floating point value and stores the results in the register specified by D.

2.PLC floating point is operated by the binary floating point format. DEBCD instruction is the specific instruction used to convert binary floating point to decimal floating point.

3.Flag: M1020 Zero flag, M1021 Borrow flag, M1022 Carry flag

If absolute value of the result exceeds the max. floating point value, carry flag M1022 = ON.

If absolute value of the result is less than the min. floating point value, borrow flag M1021 = ON. If the conversion result is 0, zero flag M1020 = ON.

Program Example:

When X0 = ON, the binary floating point value in D1, D0 will be converted to decimal floating point and the conversion result is stored in D3, D2.

X0

 

DEBCD

D0

D2

 

 

 

 

 

 

 

 

 

 

 

 

Binary

 

D1

D0

23 bits for real number, 8 bits for exponent

 

 

Floating Point

 

1 bit for sign bit

 

 

 

 

 

Decimal

Exponent Real number

Real number Exponent

 

D3

D2

 

[D2] * 10

[D3]

Floating Point

 

 

 

 

 

3 - 300

Page 416
Image 416
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Ebcd, DEBCD, Debcdp