gnssFix (Functionblock) |
Top Previous Next |
The gnssFix function block is used to query the current position, time, and detailed satellite information from the internal GNSS module.
Make sure to call gpsPower or gpsPowerLP before calling gnssFix, to power on the GNSS module.
SBAS Support: Please see gpsSetSBAS. When the "mode" parameter that is returned from gnssFix is 4, it indicates that the fix is not only a 3D fix but has also been SBAS-corrected.
Note regarding HDOP, VDOP and PDOP: The DOP values should be as low as possible. They describe the geometry of the satellites used. Generally a DOP value should not be higher than 6 as that will affect the accuracy negative. Normally a DOP value will be between 2 and 3 when you have clear skies. In a city with houses screening the sky, the DOP value will be higher and accuracy will be affected. One method to increase the accuracy of the used GNSS positions is not to use fixes with an HDOP value higher than, for example, 300.
All values returned by gnssFix() are in the WGS-84 datum.
Input: None.
Output: mode : SINT; 0 = No info available (GNSS module not powered on?). 1 = Fix unavailable. 2 = 2D position fix. 3 = 3D position fix. 4 = 3D position fix with SBAS-correction (this requires that SBAS has been enabled, see gpsSetSBAS). 5 = Dead Reckoning fix.
linsec : DINT Linsec for the timestamp received from the GNSS receiver. Also see clockLinsecToTime().
millisecond : INT Millisecond (0..999).
latitude : DINT Latitude expressed in a DINT. Negative is south (ddmm.mmmm (multiplied by 10000)).
longitude : DINT Longitude expressed in a DINT. Negative is west (dddmm.mmmm (multiplied by 10000)).
speed : DINT Speed over ground in meters/hour.
course : DINT Course over ground. In xxx.xx degrees (multiplied by 100) (0=north, 90=east, 225=southwest).
height : INT Height in meters over mean sea level.
PDOP : INT Position dilution of precision (multiplied by 100).
HDOP : INT Horizontal dilution of precision (multiplied by 100).
VDOP : INT Vertical dilution of precision (multiplied by 100).
inview : SINT Number of satellites in view. This is the number of satellites that are above the horizon. If gpsPowerLP is used, this will be 0.
used : SINT Number of satellites used for the solution.
Declaration: FUNCTION_BLOCK gnssFix;
Example: INCLUDE rtcu.inc |