• 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 Request data on sim object not working

Messages
3
Country
australia
Hi Guys

I am trying to use the simconnect function 'RequestDataOnSimObject' to retrieve data on the following 2 variables:

PLANE_HEADING_DEGREES_TRUE
GPS_WP_TRACK_ANGLE_ERROR

Both variables return data as expected when the PERIOD member for the request data function is set to PERIOD_SECOND, however, I want the data rate to be much faster.
I changed the period to PERIOD_VISUAL_FRAME which worked OK for the plane heading variable, but the GPS variable still only refreshes at the rate of 1 second. The code is the same for handling both variables, so I am wondering if there is a limitation on calling GPS_WP_TRACK_ANGLE_ERROR?

Here is the function call code that I am using:

hr = SimConnect_RequestDataOnSimObject(hSimConnect, REQUEST_PDR, DEFINITION_PDR, SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD_VISUAL_FRAME, SIMCONNECT_DATA_REQUEST_FLAG_CHANGED | SIMCONNECT_DATA_REQUEST_FLAG_TAGGED);

I then just print the data to a command window.

Thanks
John.
 
Not all the simulation variables are calculated by FSX on each visual frame.

Since you set the SIMCONNECT_DATA_REQUEST_FLAG_CHANGED, which means you will be updated only when the variable has changed, you will not get any more updates than the update rate of that variable.

Which make sense: there's no need to request the value of a variable more frequently than its update interval.
 
Thanks so much for your reply Umberto!
So, if I wanted to build a gauge that somehow displayed the relative bearing of the current waypoint, similar to the GPS waypoint bearing needle on a HSI (G1000), what variable, or technique should I use? If I understand you correctly, I am ultimately limited by the FSX refresh rate for that particular variable, not how I am calling it. To make the updates smooth I would need a variable that refreshes much faster than the 1 sec that the GPS_WP_TRACK_ANGLE_ERROR seems to refresh at. I find it strange that such variables do not refresh much faster given they are used to make gauges - or am I mistaken that the GPS_WP_TRACK_ANGLE_ERROR would be used in that way?
Thanks again for your help!
John.
 
Well, the fact that a gauge tied to a variable moves smoothly, doesn't necessary mean the variable itself is smoothly updated!

With an XML Gauge, you could use the Delay objects to smooth out the actual indicator movement, even if the underlying variable "jumps" at every second. With C++/GDI+ it would be more complex, but is still doable, by filtering the readouts with a low-pass function.
 
Back
Top