7 Applied Instructions
7.12 Floating Point
501
FXCPU Structured Programming Manual
(Basic & Applied Instruction)
1
Outline
2
Instruction List
3
Configuration of
Instruction
4
How to Read
Explanation of
Instructions
5
Basic Instruction
6
Step Ladder
Instructions
7
Applied
Instructions
8
Interrupt Function
and Pulse Catch
Function
A
Relationships
between devices
and addresses
Program example
This is a program for determining SIN
-1
of D0, D1 (binary floating decimal point) when the X000 is ON, and
sending the angle to Y040 to Y057 in BCD four digits.
Operation when the value of D0, D1 is 0.5.
[Structured ladder]
X000
VAR_05
*5
DASIN
EN
s
ENO
INT
EN
s
ENO
d
d
D30
*1. VAR_01 is global label, and D0 is defined.
*2. VAR_02 is global label, and D10 is defined.
[ST]
DASIN(X000,VAR_01,VAR_02);
DDEG:=(X000,VAR_03,VAR_04);
INT(X000,VAR_05,D30);
*3. VAR_03 is global label, and D10 is defined.
DDEG
EN
s
ENO
d
VAR_04
*4
D30
BCD
EN
s
ENO
d
K4Y40
VAR_01
*1
VAR_02
*2
VAR_03
*3
*4. VAR_04 is global label, and D20 is defined.
*5. VAR_05 is global label, and D20 is defined.
BCD(X000,D30,K4Y10);
Calculation of angle (radian) by
SIN
-1
operation. (1))
Conversion of radian into angle. (2))
Conversion of angle of binary floating
decimal point (real number) into integer (BIN). (3))
Output of angle converted to integer (BIN)
to display unit. (4))
Value of binary floating
decimal point (real number)
0.5
D1 D0
1) SIN
-1
conversion
Value of binary floating
decimal point (real number)
0.5235988
D11 D10
DASIN
Value of binary floating
decimal point (real number)
30
D21 D20
3) BIN
conversion
30
b15 b0
D30
BIN value
4) BCD
operation
BCD
0 0 3 0
Y057 Y040
BCD value
DDEG
2) Angle conversion
INT