Jump to content
The simFlight Network Forums

MattWise

Members
  • Posts

    18
  • Joined

  • Last visited

About MattWise

  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://

MattWise's Achievements

Newbie

Newbie (1/14)

0

Reputation

  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. Is there a way to pull out the current airport and active runway for an aircraft?
  3. 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?
  4. Did anyone get this working. I am doing this: Call FSUIPC_WriteS(&H3380, 1, "Test", dwResult) Call FSUIPC_Process(dwResult) Call FSUIPC_Write(&H32FA, 2, 1, dwResult) Call FSUIPC_Process(dwResult) And VB is crashing on me.
  5. So your telling me to drop the decimal infront of .312? If that is the case the how come AP is so close with 339.9?
  6. Thanks that helped a lot. I just pulled out the decimal value that was held in the offset. Then converted the decimal to binary as YankeeFan said and it works great. Thanks!
  7. When I do that, I still get a return of .312
  8. YankeeFan can you give me an example of your code. I am having the same problem. If YankeeFan is no longer on the form can someone give me an example. I can't figure out how to declear the variables. I see they are a S16 int but I don't know how to declear that in VB6. Thanks.
  9. 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.
  10. LukeK I did what you suggested and it didn't work either. I still got .312 Any ideas?
  11. I wasn't aware that I had to get the magnetic variation
  12. JD when I do this 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 Form1.Caption = Plane_heading End Function I get .312 any ideas?
  13. If I do what you suggest jd I get 0.3125862
  14. The # in VB just like writing 360.0 Now if I go with your example Heading = ((Heading / 65536) * 360.0) / 65536 It just returns a number that I simple can not work with. i.e. 4.94065645841247E-323 I am sure that some out there has done this in VB...
×
×
  • 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.