7 Applied Instructions
7.12 Floating Point
484
FXCPU Structured Programming Manual
(Basic & Applied Instruction)
Caution
When handling 32-bit data in structured program, you cannot specify 16-bit device directly unlike the simple
project. When handling 32-bit data, please use the label.
However, the 32-bit counter is a 32-bit long device, and can be specified directly.
When specifying the device, use the global label.
Error
In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in
D8067.
• When the value specified by is negative. (Error code: K6706)
• When the value specified by is 0. (Error code: K6706)
Program example
This is a program for determining the natural logarithm of "10" set in D50 when the X000 is turned ON, and
storing in D30, D31.
[Structured ladder]
X000
VAR_02
*2
MOV
EN
s
ENO
K10 D50
DLOGE
EN
s
ENO
d
d
VAR_03
*3
*1. VAR_01 is global label, and D40 is defined.
*2. VAR_02 is global label, and D40 is defined.
[ST]
MOV(X000,K10,D50);
FLT:=(X000,D50,VAR_01);
DLOGE(X000,VAR_02,VAR_03);
*3. VAR_03 is global label, and D30 is defined.
FLT
EN
s
ENO
d
VAR_01
*1
D50
Setting of data for natural logarithm operation.(1))
Conversion of operation data into binary floating
decimal point (real number).(2))
Operation of natural logarithm.(3))
Value of binary floating
decimal point (real number)
10
10
1)
MOV
10
b15 b0
2) Conversion of binary
floating decimal point
(real number)
3) LOG
operation
LOGE
D41 D40
Value of binary floating
decimal point (real number)
2.302585
D31 D30
FLT
D50
BIN value