7 Applied Instructions
7.12 Floating Point
510
FXCPU Structured Programming Manual
(Basic & Applied Instruction)
Program example
This is a program for converting the angle set in BCD four digits in X020 to X037 when the X000 is ON, and
storing in binary floating decimal point in D20, D21.
Operation when 120 is specified in X020 to X037.
[Structured ladder]
X000
VAR_02
*2
BIN
EN
s
ENO
DRAD
EN
s
ENO
d
d
VAR_03
*3
*1. VAR_01 is global label, and D10 is defined.
*2. VAR_02 is global label, and D10 is defined.
[ST]
BIN(X000,K4X20,D0);
FLT:=(X000,D0,VAR_01);
DRAD(X000,VAR_02,VAR_03);
*3. VAR_03 is global label, and D20 is defined.
FLT
EN
s
ENO
d
VAR_01
*1
K4X20
D0
D0
Input of angle to be converted to radian value. (1))
Conversion of input angle to binary floating
decimal point (negative number).) (2))
Conversion of angle to radian value. (3))
120
1 2
1) BIN
conversion
BIN
120
b15 b0
2) Conversion of binary
floating decimal point
(real number)
3) Radian
conversion
DRAD
D11 D10
2.094395···
D21 D20
FLT
D0
X037 X020
0 0
BIN valueBCD value