SQRT (square root)

The SQRT instruction calculates the square root of a Real value.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
SQRT
SQRT
SQRT parameters
Parameter
Parameter Type
Data Type
Description
EN
Input
BOOL
When set to true, the instruction is enabled.
  • TRUE: Execute the current computation.
  • FALSE: There is no computation.
Applies to ladder diagram programs.
IN
Input
REAL
The value must be greater than or equal to zero.
SQRT
Output
REAL
Square root of the input value. The returned result is 0 for a negative IN value.
ENO
Output
BOOL
Enables output. Applies to ladder diagram programs.

SQRT examples

SQRT function block diagram example
SQRT function block diagram example
SQRT ladder diagram example
SQRT ladder diagram example
SQRT structured text example
SQRT structured text example
(* ST Equivalence: *) xpos := ABS (xval); xroot := SQRT (xpos);
Results
Results
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal