# LGF_ConvertTemperature (FC / 3.0.1)

Overview

Author: Siemens Digital Industry Support

## Short description

This function converts a temperature value from one into another unit by using an appropriate given `mode` parameter.

### Block Interface

| LGF_ConvertTemperature (FC) |
--- | --- | ---
Int |  |  | mode |  | Ret_Val |  |  | Real
Real |  |  | value |  | error |  |  | Bool
|  |  |  |  | status |  |  | Word

### Input parameter

Identifier | Data type | Description
--- | --- | ---
mode | Int | 1: Celsius to Fahrenheit, 2: Fahrenheit to Celsius, 3: Celsius to Kelvin, 4: Kelvin to Celsius, 5: Fahrenheit to Kelvin, 6: Kelvin in Fahrenheit, 7: Rankine to Kelvin, 8: Kelvin to Rankine
value | Real | Temperature value to be converted

### Output parameter

Identifier | Data type | Description
--- | --- | ---
Ret_Val | Real | Converted temperature result
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#8200 | ERR_WRONG_MODE Error: Incorrect mode on input “mode”, see description of the input parameters

## 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
| 2.0.0 | Simatic Systems Support
| 16.12.2018 | Rename from "LGF_TemperatureConvert" to "LGF_ConvertTemperature" to start with the verb include the Rankine conversion Code refactoring, regions, commends and constants
| 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
| 22.02.2021 | Insert documentation