Jump to content
The simFlight Network Forums

Issue setting offset 0x07D4 (Autopilot AltitudeHoldVar)


Fabio Drago

Recommended Posts

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 declaration
private 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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.