Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
18 Applied Instructions (Floating Point)
18.23 DATAN / Floating Point Arc Tangent
491
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
11
Applied Instructions
(Data Operation)
12
Applied Instructions
(High Speed
Processing)
13
Applied Instructions
(Handy
Instruction)
14
Applied Instructions
(External FX I/O
Device)
15
Applied Instructions
(External Device
(optional device))
16
Applied Instructions
(External Device)
17
Applied Instructions
(Data Transfer 2)
18
Applied Instructions
(Floating Point)
19
Applied Instructions
(Data Operation 2)
20
Applied Instructions
(Positioning
Control)
Program example
This is a program for determining TAN
-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 1.
[Structured ladder/FBD]
X000
D20
DATAN
EN
s
ENO
INT
EN
s
ENO
d
d
D30
[ST]
DATAN(X000,D0,D10);
DDEG(X000,D10,D20);
INT(X000,D20,D30);
DDEG
EN
s
ENO
d
D20
D30
BCD
EN
s
ENO
d
K4Y40
D0
D10
D10
BCD(X000,D30,K4Y10);
Calculation of angle (radian)
by TAN
-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)
1
D1 D0
1) TAN
-1
conversion
Value of binary floating
decimal point (real number)
0.785398
D11 D10
DATAN
Value of binary floating
decimal point (real number)
45
D21 D20
3) BIN
conversion
45
b15 b0
D30
BIN value
4) BCD
operation
BCD
0 0 4 5
Y057 Y040
BCD value
DDEG
2) Angle conversion
INT