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.

Set NAV frequency via simconnect

Featured Replies

Hi, Has anybody succeeded in setting active or standby NAV1 or NAV2 frequencies via SimConnect ? The documentation says that in 'Aircraft Avionics Data' only marker beacon state is setable ? Any idea is welcome ! rudolf

  • Commercial Member

>Has anybody succeeded in setting active or standby NAV1 or>NAV2 frequencies via SimConnect ? You have to use the Events. The Sim Vars for radios are readable, not writable.In general, the philosophy MS has followed here is that if there's an Event (I call them controls, they are also known as KEY_Events from the Gauges SDK) which does the job then they haven't enabled it to be also done via the Sim Vars. There are notable and useful exceptions, like the throttle, aileron, elevator, rudder, mixture and prop pitch settings, but not many.If you download my interim FSUIPC SDK for FSX (see my Support Forum), and look at the FSUIPC4 Offsets Status document therein, you will see all the values which I write via Sim Vars (annotated "SimC") and those which needed events (annotated "SimE").RegardsPete

Win10: 22H2 19045.2728
CPU: 9900KS at 5.5GHz
Memory: 32Gb at 3800 MHz.
GPU:  RTX 24Gb Titan
2 x 2160p projectors at 25Hz onto 200 FOV curved screen

Thanks Pete, that sound logical - I give events a try ...regardsrudolf

If I wanted to have an external device to control the heading value etc. in the A/P, and the external device immediately reflects the new heading value (on its display), would I then send the required number of key events to move the current value to the new/desired one and then check after 'a while' whether FSX has received and processed them all ?Regards,Siggy

Siggy Schwarz

Just because I needed some time to see how this has to be done and it is not documented well in the SDK: // Code starts// in globals: static enum EVENT_FSP {EVENT_SIM_START,EVENT_NAV1SET,};// during init of SimConnect: hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_NAV1SET, "NAV1_RADIO_SET");// your function to set NAV1 from your client: static void set_nav1freq(double freq) {HRESULT hr; DWORD dwVal=0; char buf[32]; // FSX needs BCD format of your input, so transform ...sprintf(buf,"%4.0f",freq*100.);sscanf(buf,"%x",&dwVal);// finally do the transmissionif (hSimConnect) { hr = SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_NAV1SET, dwVal, SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);}} // end of CodeCAVE: if you do not set SIMCONNECT_GROUP_PRIORITY_HIGHEST (i used SIMCONNECT_GROUP_PRIORITY_DEFAULT first) the transmission to FSX will not work. regardsrudolf

>If I wanted to have an external device to control the heading>value etc. in the A/P, and the external device immediately>reflects the new heading value (on its display), would I then>send the required number of key events to move the current>value to the new/desired one and then check after 'a while'>whether FSX has received and processed them all ?>>Regards,>SiggyThis would not be very efficient. You want to set the heading value of the aircraft's inbuild autopilot ? Similar like setting the NAV1, you should be able to set the heading directly (in one transmission) via HEADING_BUG_SET as described above ...regardsrudolf

  • 1 month later...

How do I do the conversion to BCD format using a .NET language?

BCD puts two digits into one byte, so it is easiest to think of them as hexadecimal information.For example, 109.30 would be the hex number 0x10930.

RudolfCan I just say thanks for providing this example:DWORD dwVal=0; char buf[32]; // FSX needs BCD format of your input, so transform ...sprintf(buf,"%4.0f",freq*100.);sscanf(buf,"%x",&dwVal);I've just spent the past two hours trying to send an event with an argument to FSX and although I could see it was receiving it, it was being completely ignored. Pushing the values through your BCD conversion seems to have fixed it.Thanks!David

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.