![background image](http://html1.mh-extra.com/html/eaton/elc-pb/elc-pb_programming-manual_4017452275.webp)
E L C P r o g r a m m i n g M a n u a l
F o r m o r e i nf o r m a t i o n v i sit :
w w w. e a t o n . c o m
MN05003003E
3-106
API Mnemonic
Operands
Function
49
D FLT P
S, D
Floating Point
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX
KnY
KnM KnS T
C D E
F
S
*
D
*
FLT, FLTP: 5 steps
DFLT, DFLTP: 9 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P
32 16 P 32 16 P
Operands:
S
: Source
D
: Destination
Description:
1.
When M1081 = OFF, the source is converted from integer to floating point.
S
source = 16-bit
and
D
= 32 bits.
a) If the absolute value of the conversion result is larger than the maximum floating point value,
the carry flag M1022=ON.
b) If the absolute value of the conversion result is less than the minimum floating point value,
the borrow flag M1021=ON.
c) If conversion result is 0, zero flag M1020=ON.
2.
When M1081 is ON, the source is converted from floating point to integer (ignore decimal
points).
S
source = 32-bit and
D
Destination occupies 16-bit. If conversion result exceeds the
integer range of
D
(16-bit, -32,768~32,767 and 32-bit, -2,147,483,648~2,147,483,647),
D
will
hold either max or min value, and the carry flag will be set M1022=ON.
a) If the decimal point was ignored, the borrow flag M1021=ON.
b) If the conversion result = 0, zero flag M1020=ON.
Program Example 1:
1.
When M1081 = OFF, the source data is converted from integer to floating point.
2.
When X20 = ON, D0 (16-bit integer) is converted to D13, D12 (floating point).
3.
When X21 = ON, D1, D0 (32-bit integer) is converted to D21, D20 (floating point).
4.
If D0=K10 and X20=ON, the 32-bit floating point result will be H41200000 and it will be saved
in the 32-bit register D13,D12
If the 32-bit register D1, D0=K100,000 and X21 = ON, The 32-bit of floating point result will
be H47C35000 and it will be saved in the 32-bit register D21,D20.
M1002
RST
M1081
X20
FLT
D0
D12
X21
DFLT
D0
D20
Содержание ELC-PB
Страница 1: ......
Страница 5: ...For more information visit www eaton com MN05003003E iv...
Страница 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Страница 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Страница 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Страница 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...