Jump to content
The simFlight Network Forums

MattWise

Members
  • Posts

    18
  • Joined

  • Last visited

Posts posted by MattWise

  1. I am using the FSUIPC DLL and VB.NET to display messages in Flight Sim. I can get the message to display fine, but it stays there. I am writing data to offset 32FA, but the message still says there. Here is my code:

        Public Function ShowFSMessage(ByVal Message As String, ByVal Delay As Integer)
            Dim FSWriteMessage As Offset(Of String) = New FSUIPC.Offset(Of String)(&H3380, 127)
            Dim DelayMessage As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H32FA)
            Dim WriteText As String
            WriteText = Message
            WriteText = WriteText
            FSWriteMessage.Value = WriteText
            DelayMessage.Value = Delay
            FSUIPC.FSUIPCConnection.Process()
            Return 0
        End Function
    

    Any ideas to why it is doing this?

  2. Here is what I am doing:

        Dim PHeading As Long
        Dim MagVar As Long
        Dim dwResult As Long
        Call FSUIPC_Read(&H580, 4, VarPtr(PHeading), dwResult)
        Call FSUIPC_Process(dwResult)
        Call FSUIPC_Read(&H2A0, 2, VarPtr(MagVar), dwResult)
        Call FSUIPC_Process(dwResult)
        MagVar = MagVar * 360 / 65536
        Plane_heading = PHeading
        Plane_heading = (Plane_heading / 65536 / 65536 * 360) - MagVar
    

    The Plane Heading is returning .312 while at 340. The MagVar is returning 20.

    If I do the final math I get -19.68761

    Any ideas?

  3. Ok here is what I am doing. I am using :

    Public Function Plane_heading() As Single
    Dim x As Long
    Dim dwResult As Long
    Call FSUIPC_Read(&H580, 4, VarPtr(x), dwResult)
    Call FSUIPC_Process(dwResult)
    Plane_heading = x / 65536 / 65536 * 360
    End Function

    I get a return of .312

    If I do this:

    Dim Vcount as long,MY_Heading as Single
    If FSUIPC_Read(&H580, 4, VarPtr(Vcount), dwResult) Then
    If FSUIPC_Process(dwResult) Then
    MY_HEADING = CSng(Vcount * 360#) / (65536# * 65536#)
    End If
    End If
    Text1.Text = MY_HEADING

    I get .312 my plane gyro compass is reading 340 whiskey is reading 340

    But if I get the Auto Pilot heading I am doing this:

        Dim APHeading As Long
        Dim Convert As Single
        Call FSUIPC_Read(&H7CC, 4, VarPtr(APHeading), dwResult)
        Call FSUIPC_Process(dwResult)
        Convert = (APHeading * 360) / 65536
        Me.Caption = Convert
    

    I get a return of 339.9 I can round. Thats not big deal.

    Can someone help me with the plane heading.

  4. If I do this:

    Dim Heading As Double
    Call FSUIPC_Read(&H580, 4, VarPtr(Heading), dwResult)
    Call FSUIPC_Process(dwResult)
    Heading = ((Heading / 65536) * 360#) / 65536
    Form1.Caption = Heading
    

    It returns 0

    If I do this:

    Dim x As Long
    Dim dwResult As Long
    Call FSUIPC_Read(&H580, 4, VarPtr(x), dwResult)
    Call FSUIPC_Process(dwResult)
    Plane_heading = x / 65536 / 65536 * 360 
    

    It returns 0

    I've have been writing in VB for 5 years now, so this type of math is not new to me. But I just can not figure out what I am doing wrong.

  5. I am looking at the documentation. I am reading in the correct offset.

    Dim Heading As Long
    
    Call FSUIPC_Read(&H580, 4, VarPtr(Heading), dwResult)
    Call FSUIPC_Process(dwResult)
    Heading = Heading *360 / (65536*65536)
    Form1.Caption = Heading
    
    

    When I do this all I get are overflow errors. I have also tried declearing Heading as Currency which doesn't work either.

×
×
  • 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.