nmeaParser
Parse data from standard and manufacturer-specific NMEA sentences sent from marine electronic devices
Since R2020b
Description
The nmeaParser
System object™ parses data from any NMEA (National Marine Electronics Association) sentences.
The sentences that need parsing of data can be any standard sentences compliant with the
NMEA 0183® specifications (which are sent from a GNSS (Global Navigation Satellite System)
receiver), or other manufacturer-specific sentences approved by the NMEA (which are sent from
other marine electronic devices).
The nmeaParser
System object provides:
Built-in support to parse data sent from GNSS receivers and identified by these nine NMEA message types: RMC, GGA, GSA, VTG, GLL, GST, ZDA, GSV, and HDT
Additional configuration using the
CustomSentence
name-value pair to parse NMEA data from multiple device categories, including manufacturer-specific sentences from different hardware manufacturers
To parse data from NMEA sentences:
Create the
nmeaParser
object and set its properties.Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
The nmeaParser
System object outputs an array of structures corresponding to the values extracted from the
specified NMEA sentences.
Creation
Syntax
Description
returns a
pnmea
= nmeaParsernmeaParser
System object, pnmea
, with default properties, that extracts data
from these standard NMEA messages: RMC, GGA, and GSA. The order of structure arrays in the
extracted output data is also: RMC, GGA, and GSA.
returns a pnmea
= nmeaParser("MessageIDs", 'msgID')nmeaParser
System object, pnmea
, that extracts data from one of the nine
standard NMEA messages with built-in support, specified using the Message IDs. Specify
msgID
as "RMC"
, "GGA"
,
"GSA"
, "GSV"
, "VTG"
,
"GLL"
, "GST"
, "ZDA"
, and
"HDT"
, or a combination of these IDs (for example:
["VTG","GLL","HDT"]
). The order in which you specify the Message IDs
determines the order of the structure arrays in the extracted output data. The default
value is ["RMC","GGA","GSA"]
.
sets properties using the pnmea
= nmeaParser("CustomSentence", {['CustomMessageId1','parserFunctionName1'],['CustomMessageId2','parserFunctionName2']})CustomSentence
name-value pair and returns
a nmeaParser
System object, pnmea
, that extracts data from any custom NMEA message
(either standard NMEA message or manufacturer-specific NMEA message), specified using the
message IDs.
The CustomSentence
name-value pair accepts a nested cell array
where each element is a pair of message ID name (either standard NMEA message ID name or
manufacturer-specific message ID) and the corresponding user-defined parser function,
which is created by including the extractNMEASentence
function in a function
file. The order in which you specify the message IDs determines the order of the structure
arrays in the extracted output data.
returns a pnmea
= nmeaParser("MessageIDs", {'msgID1','msgID2'},"CustomSentence", {['CustomMessageId1','parserFunctionName1'],['CustomMessageId2','parserFunctionName2']})nmeaParser
System object, pnmea
, that extracts data from two of the nine
standard NMEA messages with built-in support and also from custom NMEA messages that you
specified using the CustomSentence
name-value pair.
Name-Value Arguments
Properties
Usage
Syntax
Description
[
parses data from nine standard NMEA sentences with built-in support, and returns an array
of structures, where each structure corresponds to a single Message ID. The sequence that
you specify for the output arguments must be the same sequence that you specified for the
Message IDs when creating the rmcData
,ggaData
,gsaData
,vtgData
,gllData
,gstData
,gsvData
,zdaData
,hdtData
] = pnmea(rawData
)nmeaParser
System object.
[
parses data from two custom NMEA sentences (either standard NMEA sentence or
manufacturer-specific NMEA sentence), and returns an array of structures, where each
structure corresponds to a single Message ID. The sequence that you specify for the output
arguments must be the same sequence that you specified in the
customNmeaData1
,customNmeaData2
] = pnmea(rawData
)CustomSentence
name-value pair when creating the
nmeaParser
System object.
Input Arguments
Output Arguments
Object Functions
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)
Examples
More About
Version History
Introduced in R2020b