# LGF_NthRoot (FC / 3.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

Identifier | Data type | Description
--- | --- | ---
value | LReal | Value from which the root should be calculated.
root | LReal | Exponent of root

### Output parameter

Identifier | Data type | Description
--- | --- | ---
Ret_Val | LReal | Returns the Nth root of a value
error | Bool | FALSE: No error TRUE: An error occurred during the execution of the FB
status | Word | 16#0000-16#7FFF: Status of the FB 16#8000-16#FFFF: Error identification (see following Table)

### Status & Error codes

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

## Change log

Version & Date | Change description
--- | ---
| 1.0.0 | Siemens Industry Online Support
| 19.08.2015 | First released version
| 1.0.1 | Siemens Industry Online Support
| 02.01.2017 | Upgrade: TIA Portal V14 Update 1
| 1.0.2 | Siemens Industry Online Support
| 17.08.2018 | Upgrade: TIA V15 Update 2
| 1.0.3 | Siemens Industry Online Support
| 23.11.2018 | Upgrade: TIA V15.1
| 1.0.4 | Simatic Systems Support
| 17.01.2019 | Calculation changed
| 1.0.9 | Simatic Systems Support
| 13.11.2019 | Renamed from "LGF_XRoot" to "LGF_NthRoot" Regions, comments and constants are added
| 3.0.0 | Simatic Systems Support
| 23.04.2020 | Set version to V3.0.0, harmonize the version of the whole library
| 3.0.1 | Simatic Systems Support
| 12.11.2020 | Insert documentation