• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Read active ADF lat/lon?

Messages
65
Country
us-massachusetts
Hi there,
Is there a way to read the latitude and longitude of the tuned NDB through execute_calculator_code or similar, without going through simconnect? The simulation variables documentation lists "ADF LATLONALT:index" but I can't seem to make it work using execute_calculator_code(). is there some other way, or must I set up a simconnect client for the sole purpose of receiving this one bit of info?

Many thanks,
Farley
 
You can only read such structure vars via SimConnect. It is not hard to set up a SimConnect client within a gauge dll.
 
If you must not use SimConnect at all there is an alternate (out of the box) way.

If ADF tuned is valid and receiving then,
(using XML)
Start as Nearest Waypoint NDB search via the GPS (use a fairly high value for returns and IIRC 125nm is the max range for NDBs)
After the search is completed iterate through the results until your frequency is found, use that index (NearestNdbCurrentLine) then,
Send (NearestNdbCurrentICAO) to (WaypointNdbICAO) from there you can,
Send (WaypointNdbLatitude) to (L:Var_Lat)
Send (WaypointNdbLongitude) to (L:Var_Lon)
Send (WaypointNdbElevation) to (L:Var_Elev) * if needed

From there you can execute_calculator_code()

See Bob McElraths GPS guide book here.

It can work, I used similar for a Becker Homing gauge & a KDI 572 with a working DME hold(2)
 
Will be a pity if you cannot get SimConnect to work with that A:Var because it looks like the perfect A:Var for the Lat/Lon.

Building on Roman's suggestion, if you choose the XML-gps method, you can skip the ICAO transfer step if you're using FSX or P3D by utilizing the NearestNdbSelectedNdbLatitude, Longitude variables.

Bob
 
Thanks very much, y'all! I went ahead and used simconnect, in the end it seems the simplest. I should have clarified, I actually have no real need not to use simconnect, I just asked because I wondered if there was just some easy trick that to read that variable that I was unaware of (I'm pretty new to this), but I really appreciate the sincere and creative answers to the question I actually asked, it makes me like this forum! :)

Thanks,
Farley
 
Back
Top