520
RAD, RADP
F
unct
i
on
(1) Converts units of angle size from angle units designated by to radian units, and stores result at device number
designated by .
(2) Conversion from degree to radian units is performed according to the following equation:
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 angle set by the 4 BCD digits at X20 to X2F to radians, and stores results as 32-bit
floating decimal point type real number at D20 and D21.
[Ladder Mode]
[List Mode]
[Operations involved when X20 to X2F designate a value of 120]
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 not within the following range:
0, 2
-126
| Specified device value | < 2
128
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 |
––
––
––
––
S
D
+1
+1
S
D
S
D
32-bit floating-point
real number
(
)
32-bit floating-point
real number
(
)rad
Rad
i
an
un
i
t
=
Degree
un
i
t
180
Inputs an angle to be con
v
erted
into a radian
v
alue ( )
Con
v
erts the input a 32-bit
floating-point real number ( )
Con
v
erts the con
v
erted angle into
a radian
v
alue ( )
1
2
3
Step
I
nstruct
i
on
De
vi
ce
X2F
BCD
v
alue
0
D0
1 2 0
X20
Con
v
ersion
to BIN
BIN
b15
b0
BIN
v
alue
120
Con
v
ersion to
floating-point
FLT
Con
v
ersion
to radian
D11
D10
RAD
D21
D20
1 2 0
2 . 0 9 4 3 9 5