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

Feedback on SimConnect_SetDataOnSimObject()

Messages
24
Country
netherlands
Almost all calls in SimConnect have two or three ways in which they can return a result to the caller:
  • The call itself can fail, which generally means that required values are missing or wildly incorrect. An obvious example is an incorrect HANDLE.
  • The call can fail validation by the simulator, resulting in an exception message. This is always linked to a "SendID", which has to be queried after performing the call. Why it is not returned always is a mystery to me, because zero or negative values are errors, so positive values could have been used as success marker and SendID in one.
  • Depending on the call, a reply message (or stream of messages) comes in, generally using a RequestID.
That said, there one glaring exception: If you call SetDataOnSimObject, there is no way to know if it succeeded other than waiting a bit, or querying back the same data and see if it changed.

Any ideas on what the best approach is here? If possible I'd like the call to end when I know no exceptions have been returned, but that means either a delay, which flies against all principles (because... for how long?), or else spend that extra call and wait for the (changed) data.

Cheers,
Bert
 
Messages
2,025
Country
us-ohio
There is no other method. You set the value and then next cycle check to see it's been updated to your value.
 
Top