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

FSX [C#] Asynchronous notification on XPNDR

Messages
2
Country
poland
Hello World!

I'm brand new to the FSX development but trying my best to create external transponder. I'm just trying to read Squawk code from FSX using Simconnect API and managed code libraries. Works well as instant requesting "TRANSPONDER CODE:1", but I don't like the approach where data are being pulled from FSX, while there is a system for event notification triggered by FSX (it has also a performance impact).

Thus I've switched from pulling to asynchronous model with events subscriptions and I'm stuck: I found a lot of XPNDR-related events in simconnect SDK reference like changing single digit of the code, w. or w/o carry, etc.
It works well but I'm sure there are other events that may change the squawk in fsx and my application will be aware of it, so is there any "general" transponder code change event fired, regardless of the reason of the change?
The first problem I've identified is that the above doesn't work when squawk is changed as a result of ATC communication (i.e. when switching flight following from one center to another).

Thanks in advance for any help.

Peter
 
Hi Peter.

I really can't help with the problem, but I confess i have a very hard time not falling back on pulling or polling for data. Hard for me to get my head around it. My programming by nature is 'cyclical'... probably a result of learning basic as a first language.

Hopefully, someone else can give a good response.

Dick
 
Thanks, but ...

Thanks for the quick reply Dick.

Indeed I found that different implementations of transponder (in different plane models) are triggering some exotic events, so you're right - iterative approach seems to work better. I'm almost unable to identify and handle all events that may be triggered when there is a change on Squawk, so I'm switching back to active pulling with some reasonable period.
BTW - the Simconnect's SDK reference shows TRANSPONDER CODE:index to be non-settable. So how do one set the desired Squawk code?

Regards,

Peter
 
Back
Top