Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GPS Mode (TERM, ENR, APR)

Featured Replies

  • Commercial Member

Is there a variable (or a set of variables) that tells me whether the GPS is opearating in Enroute, Terminal or Approach modes? For Term and Enr, I supposed I could simply look at the distance from the waypoint and conclude the mode from that, however, "App" mode is supposedly within 2NM from the FAF (at least in the real world), but how does one determine this distance arbitrarily in MSFS for any waypoint? Or is there simply a flag variable that tells me the mode?

  • Author
  • Moderator

>>Is there a variable (or a set of variables) that tells me>whether the GPS is opearating in Enroute, Terminal or Approach>modes? For Term and Enr, I supposed I could simply look at>the distance from the waypoint and conclude the mode from>that, however, "App" mode is supposedly within 2NM from the>FAF (at least in the real world), but how does one determine>this distance arbitrarily in MSFS for any waypoint? Or is>there simply a flag variable that tells me the mode?Directly? No. The default GPS calculates it this way: (A:GPS IS ACTIVE WAY POINT, bool) if{ (A:GPS IS APPROACH ACTIVE, bool) if{ 3 } els{ (A:GPS FLIGHT PLAN WP COUNT, number) (A:GPS FLIGHT PLAN WP INDEX, number) ++ == (A:GPS WP DISTANCE, nmiles) s0 30 ;)Although these variables are "XML" they are easily fetched in a C gauge using execute_calculator_code:FLOAT64 adf1_frequency = 0;execute_calculator_code("(A:ADF ACTIVE FREQUENCY:1, MHz)",&adf1_frequency,NULL,NULL);adf1_frequency = adf1_frequency*1000;This is the fs9gauges.h prototype:BOOL (FSAPI *execute_calculator_code) (PCSTRINGZ code, FLOAT64* fvalue, SINT32* ivalue, PCSTRINGZ* svalue);Note that only one of the three parameters is used, based on the data type of the XML variable: (float), (integer) or (string)... ;)All of the XML GPS variables are listed in the Parameters.doc of the SDK.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author
  • Moderator

>>Thanks! Geeez, it's so simple now that I see it. Feel like>I asked a stupid question lol.Well, thanks go to Arne Bartels, and several others who've been absent for a very long time, because none of this was documented at all!They found it through trial and error (heavy emphasis on the error!), and good guess work... ;)In fact, long before the SDKs were released, they had already sussed out all the XML variables and Arne had even written a tutorial on XML gauge coding!I must add that one of the neat features of using the XML variables vice the native C variables is that you can specify what units you want returned, rather than having to jump through fify-five hoops to convert the return to something usable... ;)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.