• 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.

Nearest Airport

I come back on this topic to submit another problem: everything works fine if the NearestAirportMaximumDistance is 20000 (meters) or less. As soon as I set NearestAirportMaximumDistance to a higher value, I get no airport at all, not even 1. Is it a known limitation of this requesting system?

Thank you,
Eric
 
I come back on this topic to submit another problem: everything works fine if the NearestAirportMaximumDistance is 20000 (meters) or less. As soon as I set NearestAirportMaximumDistance to a higher value, I get no airport at all, not even 1. Is it a known limitation of this requesting system?

Thank you,
Eric

I think you may not be waiting long enough for the Nearest search to conclude before you try to use returned values. In a short radius search, the Nearest search will conclude quickly, but as the search radius lengthens, the gps will require quite a lot of time (to be more specific, quite a large number of Update cycles) before it will return any value ... and then it returns the entire list pretty much at once.

In the XML world, the expression
Code:
(C:fs9gps:NearestAirportItemsNumber) 0 != 
    if{
         subsequent code 
    }
is used to delay execution of subsequent code until the Nearest search returns values as indicated by NearestAirportItemsNumber no longer equal to zero. Check pages 27 and 28 of the Guidebook for a XML explanation of what's going on. Something equivalent in C++ should be possible. See if that's the issue you have.

Cheers,

Bob
 
Apologies for posting on an old thread, but has anyone had any luck with this issue?

I encountered exactly the same issue as Eric. 'NearestAirportItemsNumber' and 'NearestAirportCurrentICAO' both return valid values if 'NearestAirportMaximumDistance' is <= 20000m but anything greater causes them to remain at zero/null no matter how long I wait for the search to finish. I get the same issue if I try a nearest search for VORs, NDBs etc, the ItemsNumber value just stubbornly remains at zero.

Thanks
 
Last edited:
One more thing - when setting values such as the maximum distance in XML you can specify the unit type e.g. NMiles rather than the default metres. I've not seen any reference to that option when setting them via a C++ gauge. Does anyone know if that is possible?

Thanks
 
'NearestAirportItemsNumber' and 'NearestAirportCurrentICAO' both return valid values if 'NearestAirportMaximumDistance' is <= 20000m but anything greater causes them to remain at zero/null no matter how long I wait for the search to finish.
Interesting.

As far as XML is concerned, I can't replicate your issue using a simple search gauge ... not sure what is going on with your search. This works fine for me, for example:

Code:
(A:PLANE LATITUDE, degrees) (>C:fs9gps:NearestAirportCurrentLatitude, degrees)
(A:PLANE LONGITUDE, degrees) (>C:fs9gps:NearestAirportCurrentLongitude, degrees)
5000 (>C:fs9gps:NearestAirportMaximumItems)
1000000 (>C:fs9gps:NearestAirportMaximumDistance, meters)
 
Last edited:
Thanks for the confirmation. I've just tried several things but 'NearestAirportMaximumDistance' still returns zero when the max distance is increased from 20,000 metres to 20,001 metres. I've tried reading back the C variables that are being set and they are being set correctly (lat, lon, max items and max distance).

With only 20000 metres (approx 12 miles) to play with, it looks like I'll have to revert to using some XML or finding a different nav data source (unless anyone else using fs9gps with C++ has any suggestions).
 
With only 20000 metres (approx 12 miles) to play with, it looks like I'll have to revert to using some XML
Yeah ... I'm looking at this from an XML viewpoint. Hopefully, someone else might be able to troubleshoot the issues using C. Bob
 
Back
Top