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

Setting ADF (C#)

Messages
4
Country
germany
Hi,

has anybody managed to set a ADF frequency with a fractional, e.g. 365.5 kHz?

TransmitClientEvent(..., 0x365, ...) works fine, but sending 0x3655 just produces rubbish in the ADF gauge.

Do I really have to adjust the 10th-digit sending multiple EVENT_ADF_INC messages? :eek:

Code:
enum EVENTS
{
   EVENT_ADF_SET
};

// this enum is missing in the SimConnect namespace (?!?)
enum GROUP_PRIORITIES :uint
{
    SIMCONNECT_GROUP_PRIORITY_HIGHEST = 1,
    SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE = 10000000,
    SIMCONNECT_GROUP_PRIORITY_STANDARD = 1900000000,
    SIMCONNECT_GROUP_PRIORITY_DEFAULT = 2000000000,
    SIMCONNECT_GROUP_PRIORITY_LOWEST = 4000000000
}

...

simconnect.MapClientEventToSimEvent(EVENTS.EVENT_ADF_SET, "ADF_SET");

...

simconnect.TransmitClientEvent(SimConnect.SIMCONNECT_OBJECT_ID_USER,
    EVENTS.EVENT_ADF_SET,
    0x365,  // <- ok, but 0x3655 does not work
    GROUP_PRIORITIES.SIMCONNECT_GROUP_PRIORITY_HIGHEST,
    SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY);
 
Have you tried using ADF_COMPLETE_SET rather than ADF_SET.

also use BCD32 so set freq to 0x00003655 or perhaps 0x36550000
 
Last edited:
Have you tried using ADF_COMPLETE_SET rather than ADF_SET.

also use BCD32 so set freq to 0x00003655 or perhaps 0x36550000

Thanks for the suggestions, Ron.

Unfortunately, none of those works. I guess the 4 digits (BCD16) are used for the freqency and so no room is left for the fractional. ADF_COMPLETE_SET has no effect at all.

I think I found another strange behaviour: If you set the ADF to a 4-digit value (e.g. 0x1234), the gauge shows 1234.0 - fine. But when you try to set a 3-digit value later on (e.g. 0x555), the first digit of the gauge remains '1' and the gauge shows 1555.0. Ok, I know 4-digit NDB frequencies are not existing in FSX, but nevertheless it's a bug.

And to add even more pain: In the Airbus gauge, ADF_SET sets the standby ADF, and there's no event to swap ADF frequencies.

Some work to do for the next SDK version :)
 
Last edited:
That is strange. There is a thread on this forum that talks about ADF_COMPLETE_SET working.

Maybe the number is not correct. Try 0x03655000.

See thread "Setting ADF Frequency" in the Similar Threads section below.

The SDK talks about the ADF freq being an BCD32 value on return from ADF ACTIVE FREQUENCY:index.

Also ADF2_COMPLETE_SET should set the second ADF.
 
Last edited:
That's the trick! :)

As Pete Dowson writes in that thread, one has to use ADF_COMPLETE_SET and 1234.5 is provided as 0x12345000.

If only the documentation was better...

Anyway, thanks a lot, Ron & Peter!
 
Back
Top