The simFlight Network Forums

# FSUIPC: Need help with Ground Speed offset (02B4)

## Recommended Posts

Hi,

I am trying to retrieve the Ground Speed shown in the GPS, and the only offset I found in the FSUIPC SDK was located at offset (02B4), 4 bytes, "GS: Ground Speed, as 65536*metres/sec. Not updated in Slew mode!" During a flight where I was showing 385GS in the GPS, the value returned at this offset location was 1297.9 I am not clear on how to convert the value to knots based on the description. If somebody could show me an example of what formula to use for the conversion, I would surely appreciate it.

John "YankeeFan" McCormack

##### Share on other sites

GS: Ground Speed, as 65536*metres/sec. Not updated in Slew mode!" During a flight where I was showing 385GS in the GPS, the value returned at this offset location was 1297.9 I am not clear on how to convert the value to knots based on the description.

A knot is a nautical mile per hour.

There are 60 seconds in a minute and 60 minutes in an hour. Therefore to convert metres/sec to metres/hour, multiply by 60 x 60 or 3600.

Now you need to convert metres to nautical miles. Since there are 1852 metres in a nautical mile, you divide by 1852.giving you nautical miles per hour, which are knots.

However, this is never going to make 1297.9 anything like 385. So my question to you is:

How are you reading a 32-bit integer as 1297.9 anyway? There are no fractions in integers.

Pete

##### Share on other sites

Hi Pete,

Thanks for the very quick reply!

I discovered I was using the wrong type variable, I changed to a Long Integer and the value returned showed 12978711. So the formula that I used to convert this to GS Knots is as follows;

Long32Bit = 12978711 (this is the value returned from offset)

GS = Long32Bit / 65536#

GS = GS * 3600# / 1852#

The above resulted in GS = 384.96 which appears to be correct according to the GPS window shown in the a/c. I've tried diff. speeds and it seems to be accurate.

If you see anything incorrect with the above formulas, please let me know and thanks again!

John McCormack

## Create an account

Register a new account