# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Extracting specific decimal places from a decimal number (GPS NMEA data)

Hi all,

Wondering if you could give me some assistance please. I am fairly new to LabVIEW.

Basically I have been given two seperate VIs, one which acquires NMEA GPS data from my GPS receiver and outputs it in the form, Latitude: ddmm.mmmm and longitude: dddmm.mmmm. The other is a VI which allows input of latitude and longitude in the form required by google maps, which then displays the position on an embedded map.

An example of the nmea data received from my gps receiver is the following: lat: 5227.2143, long: -00155.6721. What I need to do for the latitude is keep the first two digits exactly the same (as the dd part of the output) and then divide the rest of the number by 60 to get it in the form mm.mmmm. So I would get a value of 52.(27.2143/60) which gives 52.45357. The longitude is calculated in a similar way, except that there is an extra digit which is not included in the division due to the fact that it has the format dddmm.mmmm instead of ddmm.mmmm. Therefore the longitude value is -1.92786.

Sorry if I did not explain this well but it is hard to explain. So basically I can calculate it all fine myself, but the problem I am having is finding a way in LabVIEW of taking the specific decimal places from the original numbers and then dividing them by 60 without affecting the characters which I need to leave unchanged, and then to put them back together as a single number with a decimal place in the right place. This can then be put into the google maps search box and the location shown correctly.

Message 1 of 4
(2,664 Views)
Solution
Accepted by topic author w.driscoll90

## Re: Extracting specific decimal places from a decimal number (GPS NMEA data)

Something like this?

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(2,655 Views)

## Re: Extracting specific decimal places from a decimal number (GPS NMEA data)

that looks fantastic, thanks very much for your quick response! I will try it out right now.

Message 3 of 4
(2,643 Views)

## Re: Extracting specific decimal places from a decimal number (GPS NMEA data)

you are simply awesome. I was working on it for a week until I found this solution. 😄 thanks

Message 4 of 4
(2,408 Views)