LGF_NthRoot (FC / V3.0.1)

Overview

Author: Siemens Digital Industry

Short description

This function extracts the n-th root of a given value.

The root is defined as follows:

result = \sqrt[root]{value} = value^{\frac{1}{root}}

STEP 7 (TIA Portal) results in the following formula:

result = value ** (1 / root)

Block Interface

LGF_NthRoot (FC)
LReal  value Ret_Val  LReal
    
LReal  root error  Bool
    
   status  Word
    
   

Input parameter

IdentifierData type Description
valueLReal Value from which the root should be calculated.
rootLReal Exponent
of root

Output parameter

IdentifierData type Description
Ret_ValLReal Returns the Nth root of a value
errorBool FALSE: No error
TRUE: An error occurred during the execution of the FB
statusWord 16#0000-16#7FFF: Status of the FB
16#8000-16#FFFF: Error identification (see following Table)

Status & Error codes

Code / ValueIdentifier / Description
16#0000STATUS_NO_ERROR
Execution finished without errors
16#8200ERR_NEG_VAR
Error: Negative value for root exponend not permitted (Leads to complex numbers)

Change log

Version & DateChange description
01.00.00Siemens Industry Online Support
19.08.2015First released version
01.00.01Siemens Industry Online Support
02.01.2017Upgrade: TIA Portal V14 Update 1
01.00.02Siemens Industry Online Support
17.08.2018Upgrade: TIA V15 Update 2
01.00.03Siemens Industry Online Support
23.11.2018Upgrade: TIA V15.1
01.00.04Simatic Systems Support
17.01.2019Calculation changed
01.00.09Simatic Systems Support
13.11.2019Renamed from "LGF_XRoot" to "LGF_NthRoot"
Regions, comments and constants are added
03.00.00Simatic Systems Support
23.04.2020Set version to V3.0.0, harmonize the version of the whole library
03.00.01Simatic Systems Support
12.11.2020Insert documentation