Square Root Extraction (SQRTX)

Within a specified range, calculates the square root of a REAL value as a percentage:
OUT = sqrt( ((Min(Max(PV, IPmin), IPmax) - IPmin) / (IPmax - IPmin)) ) * 100
sqrtx_block
Parameter values for the SQRTX function:
Parameter
Data Type
Description
PV
REAL
Process variable, scaled to a value of 0..1, according to IPmax and IPmin.
This value must be a positive REAL value.
IPmax
REAL
Maximum positive REAL value of the process variable (PV). Infinity or Not a Number (NaN) values are not supported by this input.
IPmin
REAL
Minimum positive REAL value of the process variable (PV). Infinity or Not a Number (NaN) values are not supported by this input.
OUT
REAL
Square root of the input value calculated as a percentage. When the PV value is greater than IPmax, the function returns a value of 100.0. When the PV value is less than IPmin, the function returns a value of 0.0.
TIP: Loss of precision may occur when using this function.
When IPmax < IPmin, the function assumes that the values are reversed and swaps them. The
ERRSTAT
Reversed error counter increments each time the function has to swap the parameters.
When IPmax = IPmin, the function returns a value of zero and the
ERRSTAT
Zero Divide error counter increments.
When PV is Not a Number (NaN) value, OUT is set to zero and the
ERRSTAT
Param error counter increments.
When an overflow or underflow condition occurs during execution of the function, the function returns zero and increments the corresponding
ERRSTAT
Overflow or Underflow error counter.
Function Block Diagram Example
sqrtx_fbdexample
Structured Text Example
Result := SCALE(PV, 2.0, 0.2);
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal