EasyManua.ls Logo

Automationdirect.com DirectLOGIC DL205 Series

Automationdirect.com DirectLOGIC DL205 Series
587 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
DL205 User Manual, 4th Edition, Rev. B
5–136
Chapter 5: Standard RLL Instructions - Number Conversion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
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.
The two instructions described above convert real numbers in
the accumulator from degree format to radian format, and
visa-versa. In degree format, a circle contains 360 degrees. In radian format, a circle contains
2 . 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 transcendantal
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 a 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.
RADR
ý
ý
ý
þ
230
240
250-1
260
DEGR
ý
ý
ý
þ
230
240
250-1
260
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.
SP71 On anytime the V-memory specified by a pointer (P) is not valid.
SP72 On anytime the value in the accumulator is a valid floating point number.
SP74 On anytime a floating point math operation results in an underflow error.
SP75 On when a BCD instruction is executed and a NON-BCD number was encountered.
LDR
R45
X1
Load the r eal number 45 into
the accum ulator .
RADR
Convert the degr ees into r adians,
leaving the result in the
accum ulator .
OUTD
V2000
Copy the value in the
accum ulator to V2000
and V2001.
45.000000
Accumulator contents
(viewed as real number)
0.7853982
SINR
T ake the sine of the number in
the accum ulator , which is in
radians.
0.7071067
0.7071067
DirectSOFT
DS Used
HPP N/A

Table of Contents

Related product manuals