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

Parameter | Parameter Type | Data Type | Description |
---|---|---|---|
EN | Input | BOOL | When set to true, the instruction is enabled.
|
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 ladder diagram example

SQRT structured text example

(* ST Equivalence: *) xpos := ABS (xval); xroot := SQRT (xpos);
Results

Provide Feedback