127
4
4 Instructions 4.4.3 Trigonometric Functions
◆
Function
Binary oating-point degrees are converted to radians. The calculation formula is [Angle in radians = Angle
in degrees x π/180].
Example 1:
M10
ǒDRAD D0 D2Ǔ
S D
M11
When M10 = ON, degree-to-radian conversion is
performed on the binary floating-point number in (D1, D0).
The result is stored in (D3, D2).
ǒDRADP D10 D12Ǔ
Example 2:
M10
ǒMOV K90 D0Ǔ
When M10 switches from OFF to ON, the value 90 is assigned to D0.
The integer in D0 is converted to a floating-point number,
which is then assigned to (D3, D2). Degree-to-radian conversion is
performed on (D3, D2) and the result is assigned to (D5, D4).
The final value in (D3, D2) is
æ/2, that is, 1.570796.
ǒFLT D0 D2Ǔ
ǒDRAD D2 D4Ǔ
DEG: Binary oating point radian-to-degree conversion
◆
Overview
The DEG instruction converts binary oating-point radians to degrees. The calculation formula is [Angle in
degrees = Angle in radians x π/180].
DEG S D
Binary oating point
radian-to-degree
conversion
Applicable model:
H3U
S Data source
Binary oating-point radian variable to be converted to
degrees
32-bit instruction
(9 steps)
DDEG:
Continuous
execution
DDEGP: Pulse
execution
D
Operation
result
Operation result storage unit
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.