DL06 Micro PLC User Manual, 3rd Edition, Rev. E
5-119
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
NOTE: The square root function can be useful in several situations. However, if you are trying to do the
square-root extract function for an orifice flow meter measurement, as the PV to a PID loop, note that
the PID loop already has the square-root extract function built in.
The following example takes the sine of 45 degrees. Since these 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.
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.
ACOSR
ATANR
SQRTR
DirectSOFT 5
LDR
R45
X1
Load thereal number 45 into
theaccumulator.
RADR
Convertthe degrees into radians,
leavingthe result in the
accumulator.
OUTD
V2000
Copy thevalue in the
accumulatortoV2000
and V2001.
45.000000
Accumulatorcontents
(viewedasreal number)
0.7358981
SINR
Take thesineofthe number in
theaccumulator, whichisin
radians.
0.7071067
0.7071067
DS Used
HPP N/A
DS Used
HPP N/A
DS Used
HPP
N/A
DirectSOFT
Arc Cosine Real (ACOSR)
The Arc Cosine Real instruction takes the inverse cosine of the
real number stored in the accumulator. The result resides in the
accumulator. Both the original number and the result must be Real
data type (IEEE floating point format).
Arc Tangent Real (ATANR)
The Arc Tangent Real instruction takes the inverse tangent of the
real number stored in the accumulator. The result resides in the
accumulator. Both the original number and the result must be Real
data type (IEEE floating point format).
Square Root Real (SQRTR)
The Square Root Real instruction takes the square root of the
real number stored in the accumulator. The result resides in the
accumulator. Both the original number and the result must be Real
data type (IEEE floating point format).