Fabio Drago Posted November 22, 2020 Report Posted November 22, 2020 Hi all, I'm building my custom panel and I'm trying to set the hold altitude. At the moment it works fine for the positive values only. When it goes negative the altitude go wild 🙂 I'm using .net client 3 and FSUIPC7 and this is the relevant code: //Offset declarationprivate Offset<Int32> _autopilotAltitudeHoldVar = new Offset<Int32>(0x07D4); // Add the increment var actual = _autopilotAltitudeHoldVar.Value; var newalt = (Int32)(actual + diff * 0.3048 * 65536); (diff can be +100 or -100) _autopilotAltitudeHoldVar.Value = newalt;  When I turn into negative altitude (actual=0 and diff=-100) then newalt is -1997537. The displayed altitude goes to 99900 and if I readback the offset the value is 1995539712. If I set the hold altitude with the simulator panel (-100) the offset value is -1997536. I'm going crazy with it. Thaks, Fabio Â
Paul Henty Posted November 22, 2020 Report Posted November 22, 2020 Hi Fabio, Your code looks okay. I've tried it here with FSX, but that sim doesn't seem to support negative altitudes for the autopilot at all. You can't set them on the panels of any aircraft. If negative hold altitudes are now supported in MSFS (on default aircraft) then my guess is that FSUIPC7 and/or SimConnect hasn't been changed to support this. Maybe @John Dowson can shed some light on this. Paul
Fabio Drago Posted November 23, 2020 Author Report Posted November 23, 2020 Thanks Paul, it also seems strange to me that negative values can be entered. Waiting John feedback I have set to zero all negatives values. Fabio
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now