.Net reading from SimConnect - Flap Position and Max Position are crazy

I’m brand new to this. I am getting Lat, Long, Alt, Speed etc successfully using SimConnect in my .Net app. But I’m unable to get Auto pilot master status, and flap position.

image

That’s what I see when trying to display flaps. I have my definitions setup as:

            ("FLAPS HANDLE INDEX", "number", SIMCONNECT_DATATYPE.INT32), //16
            ("FLAPS NUM HANDLE POSITIONS", "number", SIMCONNECT_DATATYPE.INT32), //17

(The comments, //16 and //17 are there so I can make sure my struct is in the right order. I think that’s the way it gets data from SimConnect?)

Why would this be shotting around so much? The ‘MAX’ one should be fixed, surely.
What I get is the MAX values shootting arou8nd randomly from around -5, to 7… and the flap position not changing at all when I move the flaps.

Can anyone help?

Change SIMCONNECT_DATATYPE.INT32 to SIMCONNECT_DATATYPE.FLOAT64
Every numerical value that I have so far used has come back as a float64 including the booleans.
You have to cast them to whatever type needed after receiving them.

1 Like

Brilliant! Thank you!

Struggling with Auto Pilot now. I want to see when the AP is enabled.

My code has (“AUTOPILOT MASTER”, “number”, SIMCONNECT_DATATYPE.FLOAT64), in my RegisterDataDefineStruct

But I am always seeing 0, or no value. The doco says it should be a bool. Is this a case where another type needs to be specified?

In your code change “number” to “bool”. You can leave the datatype as float64. Then you should get a 0.000000000 for FALSE and 1.0000000000 for true.

What helps a lot is to launch the SimvarWatcher app. It is in the “MSFS SDK folder” → Samples → SimvarWatcher → bin → x64 → Release (or Debug). It should be Simvars.exe

If it is not there you might have to build it in Visual Studio.