LGF_GpsDDToGps (FC / V3.0.2)


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 typeDescription
gpsLGF_typeGPS_DDGPS-Data to be converted (decimal degrees),
e.g. 52.520817 13.40945

Output parameter

IdentifierData typeDescription
Ret_ValLGF_typeGPSConverted GPS-Data (direction, degrees, minutes, and seconds),
e.g. N52° 31′ 14.941″ E13° 24′ 34.020″
errorBoolFALSE: No error
TRUE: An error occurred during the execution of the FB
statusWord16#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)

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

IdentifierData typeDefault valueDescription
latitudeReal0.0Degrees latitude with decimal places
(Unit: degree decimal), North = positive; South = negative)
valid value range [-90.00000..90.00000]
longitudeReal0.0Degrees longitude in degrees with decimal places
(Unit: degree decimal), East = positive; West = negative)
valid range [-180.0000..180.0000]

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.

IdentifierData typeDefault valueDescription
latitudeLGF_typeGPS_DMS---Latitude child element
longitudeLGF_typeGPS_DMS---Longitude child element

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