# LGF_GpsToGpsDD (FC / V3.0.2)

Author: Siemens Digital Industry

## Short description

This function converts a given GPS data type (format direction, degrees, minutes, and seconds) into a GPS-DD data type (decimal degrees).

GPS "native" to GPS decimal Degree.

### Block Interface

| LGF_GpsToGpsDD (FC) |
--- | --- | ---
LGF_typeGPS |  |  | gps |  | Ret_Val |  |  | LGF_typeGPS_DD
|  |  |  |  | error |  |  | Bool
|  |  |  |  | status |  |  | Word

### Input parameter

Identifier | Data type | Description
--- | --- | ---
gps | LGF_typeGPS | GPS-Data to be converted (direction, degrees, minutes, and seconds), e.g. N52° 31′ 14.941″ E13° 24′ 34.020″

### Output parameter

Identifier | Data type | Description
--- | --- | ---
Ret_Val | LGF_typeGPS_DD | Converted GPS-Data (decimal degrees), e.g. 52.520817 13.40945
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_EXECUTION_FINISHED_NO_ERROR Execution finished without errors
16#8200 | ERR_LATITUDE_DIRECTION Error: Latitude Direction
16#8201 | ERR_LATITUDE_VALUE Error: Latitude Value
16#8202 | ERR_LONGITUDE_DIRECTION Error: Longitude Direction
16#8203 | ERR_LONGITUDE_VALUE Error: Longitude Value

## User defined datatype(s)

### LGF_typeGPS (UDT)

Datatype for GPS Coordinates Latitude and Longitude.
Child Datatypes in Degree, Minutes, Seconds and the Direction.
Datatype for a whole GPS Data set.

Identifier | Data type | Default value | Description
--- | --- | --- | ---
latitude | LGF_typeGPS_DMS | --- | Latitude child element
longitude | LGF_typeGPS_DMS | --- | Longitude child element

### LGF_typeGPS_DD (UDT)

Datatype for GPS Coordinates in decimal degrees.
For latitude and longitude.
Datatype for a whole GPS Data set.

Identifier | Data type | Default value | Description
--- | --- | --- | ---
latitude | Real | 0.0 | Degrees latitude with decimal places (Unit: degree decimal), North = positive; South = negative) valid value range [-90.00000..90.00000]
longitude | Real | 0.0 | Degrees longitude in degrees with decimal places (Unit: degree decimal), East = positive; West = negative) valid range [-180.0000..180.0000]

## Change log

Version & Date | Change description
--- | ---
| 01.00.00 | SIMATIC Systems Support
| 2019.09.11 | First released version
| 03.00.00 | Siemens Industry Support
| 2019.04.23 | Set version to V3.0.0 harmonize the version of the whole library
| 03.00.02 | Simatic Systems Support
| 20.01.2021 | Fix `tempStatus` initialization Insert documentation