Dabull Posted October 7, 2021 Report Posted October 7, 2021 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.
Paul Henty Posted October 7, 2021 Report Posted October 7, 2021 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
Dabull Posted October 7, 2021 Author Report Posted October 7, 2021 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: 0x6010, type: "float", size: 8 }, { name: "writelatitude", address: 0x6010, type: "lat", size: 8 }, { name: "longitude", address: 0x6018, type: "float", size: 8 }, { name: "writelongitude", address: 0x6018, type: "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.
Paul Henty Posted October 7, 2021 Report Posted October 7, 2021 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
Dabull Posted October 7, 2021 Author Report Posted October 7, 2021 I got it now. It works now. Thanks for your patience in helping me.
Delphi Posted October 8, 2021 Report Posted October 8, 2021 Will WebSocket also be available for FSUIPC6? Ruediger
Paul Henty Posted October 8, 2021 Report Posted October 8, 2021 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. Download the server here: http://fsuipcwebsockets.paulhenty.com/ Paul
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now