5 Applied Instructions and Basic Usage
DVP-20PM Application Manual
5-99
API
Applicable model
20PM
117
D
D
DEG
P
P
Converting a radian to a degree
Bit device Word device
X Y M S F H KnX KnY KnM KnS T C D V Z
S
*
*
D
*
Note: Please refer to specifications for more information about device
ranges.
F represents a floating-point value. There is a decimal point in a
floating-point value.
Only the 32-bit instructions DDEG and DDEGP are valid.
16-bit instruction
- - - -
32-bit instruction (6 steps)
DDEG
Continuity
instruction
DDEGP
Pulse
instruction
Flags
Ox O100
M1808 M1968 Zero flag
M1809 M1969 Borrow flag
M1810 M1970 Carry flag
Please refer to the additional remark below.
Explanation
The equation below is u
sed to convert a radian into a degree.
S: Source (radian); D: Conversion result (degree)
Degree=Radian×(180/π)
If the absolute value of a conversion result is greater than the maximum
floating-point value available, a carry flag will be ON.
If the absolute value of a conversion reuslt is less than the minimum
floating-point value available, a borrow flag will be ON.
If a conversion result is 0, a zero flag will be ON.
Example
When X0 is ON, the radian in (D1, D0) is converted into a degree, and the
conversion result is stored in (D11, D10). The degree in (D11, D10) is a binary
floating-point value.
X0
DDEG D0 D10
D 1 D 0
S
D
D 11 D 10
Radian
Binary floating-point number
Binary floating-point number
Degree (Radian 180/p)
X
Additional
remark
Please refer to section 5.3 for more information about performing operations
on floating-point values.