Mitsubishi MELSEC-Q/L Programming Manual page 526

Table of Contents

Advertisement

DEGD, DEGDP
Function
(1) The unit expressing the size of an angle is converted into the degree unit from the radian unit specified by
result is stored into the device specified by
(2) The conversion from radians to angles is performed according to the following equation:
(3) When the operation results in -0 or an underflow, the result is processed as 0.
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
The specified device value is not within the following range:
-1022
4140
0, 2
| Specified device value | < 2
The specified device value is -0.
The operation result exceeds the following range (when an overflow
occurs):
4141
1024
2
| Operation result |
Program Example
(1) The following program converts the radian value set with 64-bit floating decimal point type real number at D20 to D23 to
angles, and stores the result as a BCD value at Y40 to Y4F.
[Ladder Mode]
[List Mode]
Step
Instruction
[Operations involved when the values at D20 to D23 are 1.435792]
1
D23 D22
D21
D20
1.435792
64-bit floating-point
real number
524
.
D
S
+3
S
+2
S
+1
S
(
)rad
64-bit floating-point
real number
Degree unit = Radian unit
Error details
1024
Converts a radian value into an angle (
Converts the angle in 64-bit floating-point
real number into an integer (
Outputs the converted integer to a display
device (
Device
Conversion
D13 D12
D11
D10
to angle
82.26482
DEGD
64-bit floating-point
real number
D
+3
D
+2
D
+1
(
64-bit floating-point
real number
180
Q00J/
Q00/
QnH
Q01
––
––
––
––
1
).
2
).
3
2
Conversion
D0
3
BCD operation
to BIN
b15
b0
82
INTD
BIN value
, and its
S
D
)
QnPH QnPRH
QnU
––
––
––
––
).
Y4F
Y40
0 0 8 2
BCD
BCD value
LCPU

Advertisement

Table of Contents
loading

Table of Contents