Jump to content
The simFlight Network Forums

Autopilot Altitude / VS/ HDG


hawkt1

Recommended Posts

Afternoon all

 

 

I need to display my set value always as 5 figures, ie 200ft would show 00200

 

i tried the below, no joy

    Dim fsAPAltitudeValue As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H07D4)
    Dim APAltitudeValue

            Me.APAltitudeValue = fsAPAltitudeValue.Value * 3.28084 / 65536
            Me.APAltitudeValue = Math.Round(APAltitudeValue, 0)
            TextBox1.Text = Me.APAltitudeValue.ToString("00000")

 

Similar thing with the VS, negative VS gives a value or 65,000

    Dim fsAPVSValue As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H07F2)
    Dim APVSValueMe.APVSValue = fsAPVSValue.Value
Link to comment
Share on other sites

Hi,

 

The Altitude problem is because the variable Me.APAltitudeValue has not been given a type when you defined it. If you say it's a decimal it will work:

Dim APAltitudeValue As Decimal

The VS Hold problem is because you've declare the offset as 4 bytes (Integer) when it's only 2. It will work if you change the declaration to be Short (2 bytes):

    Dim fsAPVSValue As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H07F2)

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.