INT Conversion

INT, INTP, DINT, DINTP

 

INT instruction converts a float value to a integer value and save the result in Destination (assigned device address).

(It supports only in XP and PLC-S CPU series)

 

S

Source (Float value)

D

Destination

 

Instruction

Device address

No. of Steps

Flag

M

X

Y

K

L

F

T

C

S

Z

D

@D

Int.

 

Error

Zero

Carry

INT(P)

DINT(P)

S

o

o

o

o

o

-

-

-

-

o

o

o

-

4

o

-

-

D

o

-

o

o

o

-

o

o

-

o

o

o

o

 

INT(P)

Functions

  • Convert S(Float value) to Integer(16bit binary data) and save the result in the Destination.

  • The range of float in S is -32,768 ~ 32,767.

  • The result is rounded down to zero decimal place.

 

Example)

If M00 is ON, convert D80 (float value) to integer (16bit binary) and then save the result in D90.

 

DINT(P)

Functions

  • Convert S(Float value) to Integer(32bit binary data) and save the result in the Destination.

  • The range of float in S is -2,147,483,648 ~ 2,147,483,647.

  • The result is rounded off to zero decimal place.

 

Example)

If M00 is ON, convert D80 (float value) to integer (32bit binary) and then save the result in D90.