523
DEGD, DEGDP
1
2
3
4
4
6
7
8
7.12
Special function
instructions
7.12.1
6
DEGD, DEGDP
Operat
i
on
E
rror
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
*2:
There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to Page 88, Section 3.2.4.
Program
E
xamp
l
e
(1) The following program converts the radian value set with 32-bit floating decimal point type real number at D20 and D21
to angles, and stores the result as a BCD value at Y40 to Y4F.
[Ladder Mode]
[List Mode]
[Operations involved when the values at D20 and D21 are 1.435792]
: Radian angle to be converted to degrees or head number of the devices where the radian angle is stored (real number)
: Head number of the devices where the value converted in degrees will be stored (real number)
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
The specified device value is -0.
*2
––
––
4140
The specified device value is -0, unnormalized number, nonnumeric,
and ±
.
––
––
––
––
4141
The operation result exceeds the following range (when an overflow
occurs):
2
128
| Operation result |
––
––
––
––
7.12.16 DEGD, DEGDP
Conversion from floating-point radian to angle
(Double precision)
7.12.16
DEGD, DEGDP
Setting
Data
Internal Devices
R, ZR
J \
U \G
Zn
Constants
E
Other
Bit
Word
Bit
Word
––
––
––
––
––
––
––
Con
v
erts a radian
v
alue into
an angle ( )
Con
v
erts the angle in
32-bit floating-point real
number into an integer ( )
Outputs the con
v
erted integer
to a display de
v
ice ( )
1
2
3
Step
I
nstruct
i
on
De
vi
ce
Con
v
ers
i
on
to
ang
l
e
D
E
G
BCD
operat
i
on
BCD
D21
D20
D11
D10
Con
v
ers
i
on
to
B
IN
B
IN
D0
b15
b0
B
IN v
a
l
ue
82
Y4F
BCD
v
a
l
ue
0 0 8 2
Y4
0
32
-
b
i
t
f
l
oat
i
ng
-
po
i
nt
rea
l
number
32
-
b
i
t
f
l
oat
i
ng
-
po
i
nt
rea
l
number
1
. 4
3 5 7 9 2
8 2
.
2 6
4
8 2
Universal
LCPU
Bas
i
c
Hi
gh
performance
Process
Redundant
Command
Command
D
E
GDP
DEGD
DEGDP
D
E
GD
S
D
S
D
S
D
S
D