positionToDeg (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

3.10 / 1.00.00


This function converts a coordinate from GPS position format to decimal degrees.

 

Note: This function works with DOUBLE, but can also work with FLOAT as described in the Floating-point math introductory section.

 

Input:

v : DINT

Value to convert.

 

Returns: DOUBLE

The value in decimal degrees.

 

Declaration:

FUNCTION positionToDeg : DOUBLE;
VAR_INPUT
v : DINT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
INCLUDE math.inc
 
PROGRAM test;
 
DebugMsg( message := "Pos = (" +
  doubleToStr( v:= positionToDeg(v := 55513078)) + ", " +
  doubleToStr( v:= positionToDeg(v := 9510530)) + ")");
 
END_PROGRAM;