No BSD License  

Highlights from
NMEA Checksum

5.0

5.0 | 3 ratings Rate this file 5 Downloads (last 30 days) File Size: 905 Bytes File ID: #15080

NMEA Checksum

by ZdeneÃ?Â?Ã?Â?k Teply

 

22 May 2007 (Updated 22 May 2007)

NMEA Checksum calcuation

| Watch this File

File Information
Description

NMEA Checksum calculation function

MATLAB release MATLAB 7.0.4 (R14SP2)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
22 May 2007 Duane Hanselman

FYI: No need to download, here is what is in the file:
%function checksum = CreateNMEAChecksum(NMEA_String)
function checksum = nmeachecksum(NMEA_String)

checksum = 0; %vynulování promìnné

% see if string contains the * which starts the checksum and keep string
% upto * for generating checksum
NMEA_String = strtok(NMEA_String,'*');

NMEA_String_d = double(NMEA_String); % convert characters in string to double values
for count = 2:length(NMEA_String) % checksum calculation ignores $ at start
    checksum = bitxor(checksum,NMEA_String_d(count)); % checksum calculation
    checksum = uint16(checksum); % make sure that checksum is unsigned int16
end

% convert checksum to hex value
checksum = double(checksum);
checksum = dec2hex(checksum);

% add leading zero to checksum if it is a single digit, e.g. 4 has a 0
% added so that the checksum is 04
if length(checksum) == 1
    checksum = strcat('0',checksum);
end

24 Jul 2007 jim gardiner

does exactly what i was after. saved me a job, cheers...

28 Sep 2007 Liffa Funkel

Exactly what i needed. Thanx

29 Oct 2007 Michael T

Does exactly what it says - calculates NMEA checksums.

24 Apr 2008 Vince C

I have downloaded the .M (size = 0.9KB) file then I double click on the icon and Microsoft XP says it can not open file ....

I take it that I need mathlab and this is not an .exe file ......

help

Vince

03 Nov 2011 Ajay

This is just great. Any idea how to read strings from a text file. The strings look like
$GPGGA,123531,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47'

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
coding theory ZdeneÃ?Â?Ã?Â?k Teply 22 Oct 2008 09:13:32
information theory ZdeneÃ?Â?Ã?Â?k Teply 22 Oct 2008 09:13:32
nmea checksum ZdeneÃ?Â?Ã?Â?k Teply 22 Oct 2008 09:13:32
checksum calc ZdeneÃ?Â?Ã?Â?k Teply 22 Oct 2008 09:13:32
communications ZdeneÃ?Â?Ã?Â?k Teply 22 Oct 2008 09:13:32
nmea ZdeneÃ?Â?Ã?Â?k Teply 22 Oct 2008 09:13:32
function ZdeneÃ?Â?Ã?Â?k Teply 22 Oct 2008 09:13:32
checksum calc Rene v B 05 Jul 2010 08:50:15

Contact us at files@mathworks.com