gpsDistance (Functionblock) |
Top Previous Next |
This function block is used for calculating the distance and bearing (direction) between two latitude/longitude positions. The input to this function block is the same format as the gpsFix() deliver positions in.
Also see gpsDistanceX().
Input:
Position 1:
lat1south : BOOL True is south, false is north.
lat1deg : SINT Degrees (0..90).
lat1min : SINT Minutes (0..59).
lat1decmin : INT Decimal minutes (0..9999).
lon1west : BOOL True is west, false is east.
lon1deg : INT Degrees (0..180).
lon1min : SINT Minutes (0..59).
lon1decmin : INT Decimal minutes (0..9999).
Position 2:
lat2south : BOOL True is south, false is north.
lat2deg : SINT Negative is south (-90..+90).
lat2min : SINT Minutes (0..59).
lat2decmin : INT Decimal minutes (0..9999).
lon2west : BOOL True is west, false is east.
lon2deg : INT Negative is west (-180..+180).
lon2min : SINT Minutes (0..59).
lon2decmin : INT Decimal minutes (0..9999).
Output:
distance : DINT Distance between the two positions in meters.
bearing : INT Bearing between the two points in degrees.
Declaration: FUNCTION_BLOCK gpsDistance;
Example: INCLUDE rtcu.inc |