
Program instructions
7.8 Math
S7-200 SMART
304
System Manual, V2.3, 07/2017, A5E03822230-AF
Square root (SQRT) instruction
LAD / FBD
STL
Description
SQRT IN, OUT
The Square Root instruction (SQRT) takes the square root of a real number (IN)
and produces a real number result OUT.
•
SQRT (IN)= OUT
To obtain other roots:
•
5 cubed = 5^3 = EXP(3*LN(5)) = 125
•
The cube root of 125 = 125^(1/3) = EXP((1/3)*LN(125))= 5
•
The square root of 5 cubed = 5^(3/2) = EXP(3/2*LN(5)) = 11.18034
Non-fatal errors with ENO = 0
SM bits affected
•
0006H Indirect address
•
SM1.1 Overflow
•
SM1.0 Result of operation = zero
•
SM1.1 Overflow, illegal value generated during the operation, or illegal input
•
SM1.2 Negative result
Input / outputs Data type
Operand
IN
REAL
1
ID, QD, VD, MD, SMD, SD, LD, AC, *VD, *LD, *AC, Constant
OUT
REAL
1
ID, QD, VD, MD, SMD, SD, LD, AC, *VD, *LD, *AC
1
Real (or floating-point) numbers are represented in the format described in the ANSI/IEEE 754-1985 standard (single-
precision). Refer to that standard for more information.