LGF_GpsDDToGps (FC / V3.0.2)

Overview

Author: Siemens Digital Industry

Short description

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

GPS decimal degree to GPS "native".

Block Interface

LGF_GpsDDToGps (FC)
LGF_typeGPS_DD  gps Ret_Val  LGF_typeGPS
    
   error  Bool
    
   status  Word
    
   

Input parameter

IdentifierData type Description
gpsLGF_typeGPS_DD GPS-Data to be converted (decimal degrees),
e.g. 52.520817 13.40945

Output parameter

IdentifierData type Description
Ret_ValLGF_typeGPS Converted GPS-Data (direction, degrees, minutes, and seconds),
e.g. N52° 31′ 14.941″ E13° 24′ 34.020″
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_EXECUTION_FINISHED_NO_ERROR
Execution finished without errors
16#8201ERR_LATITUDE_VALUE
Error: Latitude Value
16#8203ERR_LONGITUDE_VALUE
Error: Longitude Value

User defined datatype(s)

LGF_typeGPS_DD (UDT / V3.0.1)

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]

LGF_typeGPS (UDT / V3.0.1)

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 --- Datatype for GPS Coordinates in Degree, Minutes, Seconds and the Direction.
Can be used for latitude and as well for longitude.
The Datatype is used e.g. in `LGF_typeGPS`.
dir Char '' Direction [N, S, E, W, n, s, e, w]
deg UInt 0 Degrees, Latitude [-89..+ 89]; Longitude [-179..+179]
min UInt 0 Minutes [0..+59]
sec UInt 0 Seconds [0..+59]
longitude LGF_typeGPS_DMS --- Datatype for GPS Coordinates in Degree, Minutes, Seconds and the Direction.
Can be used for latitude and as well for longitude.
The Datatype is used e.g. in `LGF_typeGPS`.
dir Char '' Direction [N, S, E, W, n, s, e, w]
deg UInt 0 Degrees, Latitude [-89..+ 89]; Longitude [-179..+179]
min UInt 0 Minutes [0..+59]
sec UInt 0 Seconds [0..+59]

Change log

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