The simFlight Network Forums

# Writing Lat/Lon to MSFS Offsets using FSUIPC WebSocket

## Recommended Posts

I just realized that I can't write to 6010 and 6018 for latitude/longitude. I have to use 0560 & 0568. However, the computation for that field is complicated and I have no clue what some of the terms are. Any one know what the computation is to turn degrees lat/lon to write to those offsets?

Thanks.

##### Share on other sites

If you declare the offset as type 'lon' or 'lat' the server will handle all that conversion for you. In that case the units you read and write are just decimal degrees. e.g. 34.5 degrees = 34 degrees 30 minutes.

Paul

##### Share on other sites

I think I tried that before. Sitting at MGCT airport (latitude: 14.6946573257446 Longitude: -91.8814315795899).

When I read 6010/6018 as lat/lon type versus float I get this:

name: "latitude"address: 0x6010type: "float"size: 8 },
{ name: "writelatitude"address: 0x6010type: "lat"size: 8 },
{ name: "longitude"address: 0x6018type: "float"size: 8 },
{ name: "writelongitude"address: 0x6018type: "lon"size: 8 },

Lat/Lon Float: 14.696005552849051,-91.87789736218718
Lat/Lon Write : 9688.75418157663,-89.522262409018

Float is correct. The lat/lon type isn;t returning correct values.

##### Share on other sites

Float is correct for 0x6010/8 because the data is stored as a float. There is no need to use lon/lat for these anyway because the data is already in decimal degrees.

0x0560/8 have the data stored as integers, so you need to either use the int type and do the conversion yourself, or use lon/lat type and let the server do it for you.

You're mixing up two different types of offsets.

If you're going to read and write then just use 0x0560/8 with the lon/lat data types.

Paul

##### Share on other sites

I got it now. It works now. Thanks for your patience in helping me.

##### Share on other sites

Will WebSocket also be available for FSUIPC6?

Ruediger

##### Share on other sites

Yes, the websocket server works with all versions of FSUIPC from 3 and higher.

The only thing that doesn't work with versions earlier than 7 is the direct access to LVars (vars.* commands) because this is a new feature for FSUIPC7/MSFS. But Offsets and Payload will work fine with FSUIPC6.

Paul

Thanks Paul...

## Create an account

Register a new account