DL06 Micro PLC User Manual, 3rd Edition, Rev. E
5-133
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
The two instructions described above convert real numbers into the accumulator from degree
format to radian format, and vice-versa. In degree format, a circle contains 360 degrees. In
radian format, a circle contains 2
f
(about 6.28) radians. These convert between both positive
and negative real numbers, and for angles greater than a full circle. These functions are very
useful when combined with the transcendental trigonometric functions (see the section on
math instructions).
NOTE: The current HPP does not support real number entry with automatic conversion to the 32-bit IEEE
format. You must use DirectSOFT for entering real numbers, using the LDR (Load Real) instruction.
The following example takes the sine of 45 degrees. Since transcendental functions operate only
on real numbers, we do an LDR (load real) 45. The trig functions operate only in radians, so we
must convert the degrees to radians by using the RADR command. After using the SINR (Sine
Real) instruction, we use an OUTD (Out Double) instruction to move the result from the
accumulator to V-memory. The result is 32-bits wide, requiring the Out Double to move it.
R ADR
DE G R
DirectSOFT32
LDR
R45
X1
Load the real number 45 into
the accumulator.
RADR
Convert the degrees into radians,
leaving the result in the
accumulator.
OUTD
V2000
Copy the value in the
accumulator to V2000
and V2001.
45.000000
Accumulator contents
(viewed as real number)
0.7853982
SINR
Take the sine of the number in
the accumulator, which is in
radians.
0.7071067
0.7071067
Discrete Bit Flags
Description
SP63
On when the result of the instruction causes the value in the accumulator to be zero.
SP70
On anytime the value in the accumulator is negative.
SP72
On anytime the value in the accumulator is an invalid floating point number.
SP73
On when a signed addition or subtraction results in an incorrect sign bit.
SP75
On when a number cannot be converted to binary.
DS
Used
HPP
N/A
DS32 Used
HPP
N/A
Direct
SOFT
Radian Real Conversion (RADR)
The Radian Real Conversion instruction converts the real degree
value stored in the accumulator to the equivalent real number in
radians. The result resides in the accumulator.
Degree Real Conversion (DEGR)
The Degree Real instruction converts the degree real radian
value stored in the accumulator to the equivalent real number
in degrees. The result resides in the accumulator.