572
7 APPLICATION INSTRUCTION
7.17 Data operation instruction
Calculating the square root of 16-bit data
SQRT(P)
These instructions calculate the square root of binary 16-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 16-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:=SQRT(EN,s,d);
ENO:=SQRTP(EN,s,d);
Operand Description Range Data type Data type (label)
(s) Device where the data whose square root is operated is
calculated
16-bit signed binary ANY16
(d) Device for storing the calculated square root 16-bit signed binary ANY16
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.