Has anyone gotten SimConnect to repeatedly get data?

Ah yes, I just realised later that I confused this thread with some other thread, where a “SimvarWatcher derived UI” was being presented :wink:

Sorry about my bold assumption about your UI :wink:

As for your questions about value ranges:

  • The values that you get depend on the requested variable type, which defaults to FLOAT64
  • On the other hand when you request a FLOAT32 or even an INT32 that naturally has an effect on both the precision (decimal places) and max/min range
  • But most importantly the actual value range - and format - is defined by the actual “unit” (feet, percent, percent over 100, position, number, …) that you request!

So for instance the yoke position can be requested with the following units (if I remember correctly - to be verified!):

  • Percent: [-100.0, 100.0] for FLOAT, and I guess [-100, 100] for INT32
  • Percent over 100: [-1.0, 1.0] (I guess requesting as INT32 wouldn’t make sense here!)
  • Position: [-32768, 32767] (min/max values of a signed INT16 value)

And attention! Even percent values where one wouldn’t necessarily expect it can get negative! E.g. there exists “reverse thrust” (and “reverse propeller” (?)), so you might get e.g. -20% thrust. (And theoretically you could even get percentages larger than 100%, but in practise I don’t think that is true for any simulation variable).

Best is you play around with the provided “SimvarWatcher” (in the SDK). Note that the SimvarWatcher always requests variables as FLOAT64 (except for strings: in the latest SDK they added a “Is String” checkbox). And sometimes the SDK docs mention value ranges as well, but I find this more confusing than it helps, as it actually depends on the specific unit that is being requested.

And only a few “unit conversions” do make sense, of course, e.g. feet → metres perhaps - but I wouldn’t rely on those conversions either, but rather “use the intended unit”: so if the documentation talks about “altitude in feet”, then request “feet” (and not metres).

Oh, and about the precision: I find that e.g. latitude/longitude raw values come with a gazillion of decimal places - but that is most likely simply “noise”.

There is an “epsilon” value that you can specify - specifically in the case if you request updates only “when values change” - so you could specify that you’d only get an update if a given value has changed, say, at least in the 3rd decimal place or so.

For all the above discussed topcs - type, unit, epsilon - refer to the documentation again:

https://docs.flightsimulator.com/html/index.htm#t=Programming_Tools%2FSimConnect%2FAPI_Reference%2FEvents_And_Data%2FSimConnect_AddToDataDefinition.htm

UPDATE:

Oh, and I forgot the most obvious :slight_smile: The actual value range of a given simulation variable most importantly depends on its “natural domain” (value range).

  • For a heading value you get anything within [0, 360[ (degrees)
  • For a bank angle you get anything within [-180, 180[ (degrees)
  • For an altitude value you get anything from “something below zero” (“Hello there, the Netherlands!” ;)) and 60,000+ feet (“Hello, space!”)
  • etc.