gpsDistanceX (Functionblock) |
Top Previous Next |
This function block is used for calculating the distance and bearing (direction) between two latitude/longitude positions. Compared to the gpsDistance() function block, gpsDistanceX() expects the latitude/longitude to be expressed in two DINT variables. The gpsDistanceX() function is therefore more efficient to use than gpsDistance().
Input:
Position 1:
latitude1 : DINT Negative is south (ddmm.mmmm (multiplied by 10000)).
longitude1 : DINT Negative is west (dddmm.mmmm (multiplied by 10000)).
Position 2:
latitude2 : DINT Negative is south (ddmm.mmmm (multiplied by 10000)).
longitude2 : DINT Negative is west (dddmm.mmmm (multiplied by 10000)).
Output:
distance : DINT Distance between the two positions in meters.
bearing : INT Bearing between the two points in degrees.
Declaration: FUNCTION_BLOCK gpsDistanceX;
Example: INCLUDE rtcu.inc |