September 28, 200619 yr 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
September 29, 200619 yr 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
September 29, 200619 yr 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
September 29, 200619 yr 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
September 29, 200619 yr >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
November 8, 200619 yr 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.
November 10, 200619 yr 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