Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual KnX KnY KnM KnS T INT, Intp 5 steps DINT, Dintp 9 steps

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

1 702
Download 702 pages 56.54 Kb
Page 430
Image 430

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

API

Mnemonic

Operands

Function

Controllers

129

D

INT

 

P

 

 

Float to integer

 

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 INT, INTP: 5 steps

 

 

S

 

 

 

 

 

*

*

*

 

DINT, DINTP: 9 steps

 

 

D

 

 

 

 

 

*

*

*

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

16-bit

 

32-bit

 

 

 

 

 

 

 

 

SA2

 

 

 

SA2

SA2

 

 

 

 

 

 

 

 

ES2/EX2 SS2 SE SX2 ES2/EX2 SS2

SE

SX2 ES2/EX2 SS2 SE

SX2

Operands:

S: Source device D: Operation result

Explanations:

1.The binary floating point value in the register S is converted to BIN integer and stored in register D. The decimal of the operation result will be left out.

2.This instruction is the opposite of the API 49 (FLT) instruction.

3.Flags: M1020 (Zero flag), M1021 (Borrow flag) and M1022 (Carry flag). If the conversion result is 0, zero flag M1020 = ON.

If there is any decimal left out, borrow flag M1021 = ON.

If the conversion result is larger than the below range, carry flag M1022 = ON 16-bit instruction: -32,768 ~ 32,767

32-bit instruction: -2,147,483,648 ~ 2,147,483,647

Program Example:

1.When X0 = ON, the binary floating point value of (D1, D0) will be converted to BIN integer and the result is stored in D10. The decimal of the result will be left out.

2.When X1 = ON, the binary floating point value of (D21, D20) will be converted to BIN integer and the result is stored in (D31, D30). The decimal of the result will be left out.

X0

INT D0 D10

X1

DINT D20 D30

3 - 314

Page 430
Image 430
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual KnX KnY KnM KnS T INT, Intp 5 steps DINT, Dintp 9 steps