Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Ebin

Models: DVP-ES2/EX2/SS2/SA2/SX2/SE

1 702
Download 702 pages 56.54 Kb
Page 417
Image 417

3. Instruction Set

API

119

Mnemonic

 

Operands

Function

 

 

 

 

 

 

D

EBIN

 

P

 

Scientific to float conversion

 

 

 

 

 

 

Controllers

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

DEBIN, DEBINP: 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 decimal floating point value in S to a binary floating point value and stores the results in the register specified by D.

2.For example, S = 1234, S +1 = 3. The decimal floating point value will be: 1.234 x 106

3.D must be binary floating point format. S and S +1 represent the real number and exponent of the floating point number.

4.EBIN instruction is the specific instruction used to convert decimal floating point value to binary floating point value

5.Range of real number: -9,999 ~ +9,999. Range of exponent: - 41 ~ +35. Range of PLC decimal floating point value. If the conversion result is 0, zero flag M1020 = ON.

Program Example 1:

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

X1

 

DEBIN

D0

D2

 

 

 

 

 

 

 

 

 

 

 

Exponent Real number

 

 

 

Decimal

 

D1

D0

Real number Exponent

Floating Point

 

[D1]

 

 

 

[D0] * 10

 

 

 

 

 

 

 

Binary

 

 

 

23 bits for real number

 

 

D3

D2

8 bits for exponent

Floating Point

 

 

 

 

 

 

 

1 bit for sign bit

Program Example 2:

1.Use FLT instruction (API 49) to convert BIN integer into binary floating point value before performing floating point operation. The value to be converted must be BIN integer and use DEBIN instruction to convert the decimal floating point value into a binary one.

2.When X0 = ON, move K314 to D0 and K-2 to D1 to generate decimal floating point value (3.14 = 314 × 10-2).

3 - 3 0 1

Page 417
Image 417
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Ebin