7 APPLICATION INSTRUCTION
7.17 Data operation instruction
573
7
Calculating the square root of 32-bit data
DSQRT(P)
These instructions calculate the square root of binary 32-bit data specified by (s1), and store the operation result in (d).
■Descriptions, ranges, and data types
■Applicable devices
• These instructions calculate the square root of binary 32-bit data specified by (s1), and store the operation result in (d).
• The obtained square root is an integer because the decimal point is ignored. When the calculated decimal value is ignored,
SM8021 (borrow flag) turns on.
• When the operation result is true 0, SM8020 (zero flag) turns on.
Ladder diagram Structured text
ENO:=DSQRT(EN,s,d);
ENO:=DSQRTP(EN,s,d);
Operand Description Range Data type Data type (label)
(s) Device where the data whose square root is operated is
calculated
32-bit signed binary ANY32
(d) Device for storing the calculated square root 32-bit signed binary ANY32
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB
U\G T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U\G Z LC LZ K, H E $
(s)
(d)
Error code
(SD0/SD8067)
Description
3405 In (s), a negative value is specified.