Mitsubishi MELSEC-Q/L Programming Manual page 522

Table of Contents

Advertisement

RAD, RADP
Function
(1) Converts units of angle size from angle units designated by
designated by
.
D
(2) Conversion from degree to radian units is performed according to the following equation:
Operation Error
(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.
Error
code
4100
The specified device value is -0.
The specified device value is not within the following range:
-126
0, 2
| Specified device value | < 2
4140
The specified device value is -0, unnormalized number, nonnumeric,
and ±
.
The operation result exceeds the following range (when an overflow
occurs):
4141
128
2
| Operation result |
*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 Example
(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]
Step
Instruction
[Operations involved when X20 to X2F designate a value of 120]
Conversion
X2F
X20
to BIN
0
1 2 0
BCD value
BIN
520
S
+1
S
(
)
32-bit floating-point
real number
Radian unit = Degree unit
Error details
*2
128
Inputs an angle to be converted
into a radian value (
Converts the input a 32-bit
floating-point real number (
Converts the converted angle into
a radian value (
Device
D0
Conversion to
D11
b15
b0
floating-point
120
BIN value
FLT
to radian units, and stores result at device number
S
D
+1
D
(
)rad
32-bit floating-point
real number
180
Q00J/
Q00/
QnH
Q01
––
––
––
––
)
1
)
2
)
3
D10
1 2 0
RAD
QnPH QnPRH
QnU
LCPU
––
––
––
––
––
D21
D20
2 . 0 9 4 3 9 5
––

Advertisement

Table of Contents
loading

Table of Contents