05-25-2018 05:36 AM
I have a GPS, I connected it with MyRIO using the UART port.
The GPS tell me many datas (File attached), but I want only the $GPGLL string (With the correspondent values). How I can extract only that string from all the strings?
Also I have another problem, the GPS before finding satellites sand me this string: $GPGLL,,,,,,,,,102059.00,V,N*2C
While when it finds satellites it tell me this $GPGLL,3714.60345,N,01513.47139,E,102059.00,A,A*6D
So I want filter a string only when it is complete.
Solved! Go to Solution.
05-25-2018 05:44 AM
There are various functions available in the String palette, such as Match Pattern to search for '$GPGLL' and String Subset to extract a substring with a specified length of characters. What are the conditions for a string to be complete?
05-25-2018 06:07 AM
Have you seen any of the tutorials for the myRIO?
There is one for GPS:
https://learn.ni.com/teach/resources/96/gps-receiver
One thing you need to do, is to only read one line at a time, then look at that line's first characters until a ,
05-25-2018 01:35 PM - edited 05-25-2018 01:36 PM
Seems pretty trivial to use LabVIEW's string functions to:
05-25-2018 02:42 PM
Thanks, i solved it in this way.
I read the NMEA senteces, extract only the $GPGLL string, create case structure for complete or incomplete string, and if it is complete i divide the string in latitude, N/S, longitude, E/W and i also add the time, with a control for fix the time zone.
Thanks everyone for your replies.
05-25-2018 02:54 PM
When you said you "add the time" are you using the local time from the computer or the time coming from the GPS? Parse the ZDA string and you have a very accurate time.
It has been a while since I worked with NMEA sentences but it would appear to me that you first should parse $GPGGA for "fix quality" to see if you have a valid fix, then you would not have to check $GPGLL for validity.
As once you have a valid fix in $GPGGA the data in all the other sentences should be valid.
05-29-2018 06:12 AM
Hello,
I have been using the GPS module to get long and lat data for my autonomous sailing boat.
Unfortunately, the data has become corrupt.
Does anyone have any idea as to what the problem may be?
05-29-2018 07:18 AM
It seems that everything is fine, the strings datas are valid. What's the problem? The longitude and latitude are incorrect?
05-29-2018 07:29 AM
Hello,
Thanks for the quick response.
The longitudes and latitudes are being read multiplied by 100.
I divided them back to normal digits and the location was 20 kilometers off.
I've tested this in multiple locations. it was working previously.
05-29-2018 12:16 PM
I don'know how it's possible. I thought the problem was the unit of measurement, but if it works previously i don't know.
What is the GPS model?