Mitsubishi Electronics FX2C Home Theater Server User Manual


 
FX Series Programmable Controlers Applied Instructions 5
5-124
5.11.10 INT (FNC 129)
Operation:
The floatin
g
point value of S is rounded down to
the nearest inte
g
er value and stored in normal
binar
y
format in D.
Points to note:
a) The source data is alwa
y
s a double (32 bit) word; a floatin
g
point value.
For sin
g
le word (16 bit) operation the destination is a 16 bit value.
For double word (32 bit) operation the destination is a 32 bit value.
b) This instruction is the inverse of the FLT instruction. (See pa
g
e 5-49)
c) If the result is 0 then the zero fla
g
M8020 is set ON.
If the source data is not a whole number it must be rounded down. In this case the borrow
fla
g
M8021 is set ON to indicate a rounded value.
If the resultin
g
inte
g
er value is outside the valid ran
g
e for the destination device then an
overflow occurs. In this case the carr
y
fla
g
M8022 is set on to indicate overflow.
Note:
If overflow occurs, the value in the destination device will not be valid.
Mnemonic Function
Operands
Program steps
SD
INT
FNC 129
(Float to
Inte
g
er)
Converts a
number from
floatin
g
point
format to decimal
format
D - must be in floatin
g
point number format
(alwa
y
s 32 bits).
D - decimal format
for INT, INTP - 16 bits
for DINT, DINTP - 32
bits
INT, INTP:
5 steps
DINT, DINTP:
9 steps
DINT
M25
D510 D254