positionToDeg (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

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;
 
DebugMsgmessage := "Pos = (" +
   doubleToStrv:= positionToDeg(v := 55513078)) + ", " +
   doubleToStrv:= positionToDeg(v :=  9510530)) + ")");
 
END_PROGRAM;