5 Applied Instructions and Basic Usage
DVP-20PM Application Manual
5-107
API
Applicable model
20PM
127
D
D
ESQR
P
P
Square root of a binary floating-point
value
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.
S is greater than or equal to 0.
F represents a floating-point value. There is a decimal point in a
floating-point value.
Only the 32-bit instructions DESQR and DESQRP are valid.
16-bit instruction
- - - -
32-bit instruction (6 steps)
DESQR
Continuity
instruction
DESQRP
Pulse
instruction
Flags
Ox O100
M1808 M1968 Zero flag
M1793 M1953 Operation error flag
Please refer to the additional remark below.
Explanation
The square root of the binary floating-point value in S
is calculated, and the
result is stored in D.
S: Source device; D: Device in which a result is stored
If S is a floating-point value, the instruction will be used to calculate the
floating-point value.
If an operation result is 0, a zero flag will be ON.
If the value in S is not a positive value, an operation error will occur, the
instruciton will not be executed, an operation error flag will be ON, and the
error code H0E19 will appear.
Example 1
When X0 is ON, the square root of the binary floating-point value in (D1, D0) is
calculated, and the result is stored in (D11, D10).
X0
DESQR D0 D10
Binary floating-point
number
(D1, D0) (D11, D10)
Binary floating-point
number
Example 2
When X2 is ON, the square root of F1234.0 is calculated, and the result is
stored in (D11, D10).
X2
DESQR
F1234.0
D10
Additional
rema
rk
Please refer to section 5.3 for more information about performing operations on
floating-point values.