gpsNMEA (Functionblock)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Firmware version:

1.21 / 1.00.00


This returns the NMEA strings that correspond to the last call to gpsFix.

The following NMEA strings will be returned:

 

RMC.

VTG.

GGA.

GSA.

 

The information returned by gpsNMEA must be considered invalid when the mode returned by gpsFix is equal to 1. In this case, the data should be discarded by the application.

Also consult the relevant literature for more information about NMEA verbs interpretation.

 

 

Input:

None.

 

Output:

RMC : STRING

String containing the RMC verb.

 

VTG : STRING

String containing the VTG verb.

 

GGA : STRING

String containing the GGA verb.

 

GSA : STRING

String containing the GSA verb.

 

Declaration:

FUNCTION_BLOCK gpsNMEA;
VAR_OUTPUT
   RMC : STRING;
   VTG : STRING;
   GGA : STRING;
   GSA : STRING;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
   gps  : gpsFix
   nmea : gpsNMEA;
END_VAR;
 
   gpsPower(power := ON);
 
BEGIN
   ...
   // Generate GPS fix:
   gps();
   // Get the NMEA strings
   nmea();
   DebugMsg(message := "NMEA:");
   DebugMsg(message := "-rmc=" + nmea.rmc);
   DebugMsg(message := "-vtg=" + nmea.vtg);
   DebugMsg(message := "-gga=" + nmea.gga);
   DebugMsg(message := "-gsa=" + nmea.gsa);
   ...
END;
 
END_PROGRAM;