Jump to content
The simFlight Network Forums


  • Posts

  • Joined

  • Last visited

About daniedelport

  • Birthday 01/01/1970

Contact Methods

  • Website URL

daniedelport's Achievements


Newbie (1/14)



  1. For Sure. Let's start all over, Pete. I hope for the last time. All I do is the following: 1. Pause FSIM. 2. Write the Position of the plane (Lat, Lon, Altitude, Pitch, Bank angle) to FSUIPC. (The plane now moves to its new location.) 3. Read Magnetic Variation. (magv) 4. Compute True heading by adding the Magnetic Heading I want, to the Magnetic Variation we just Read above in step 3. (Is the Magnetic variation of my new position (I wrote in step 2) not different than at the "old" position of my plane it was in before I moved in it in step 2?) magv = (magv * 360#) / 65536# FS_Head = txtHead.Text + magv FS_Head = (FS_Head * 65536# * 65536#) / 360# If FS_Head < -360 Then FS_Head = FS_Head + 720 ElseIf FS_Head < 0 Then FS_Head = 360 + FS_Head ElseIf FS_Head = 0 Then FS_Head = 360 ElseIf FS_Head > 360 Then FS_Head = FS_Head - 360 End If 5. Write the True Heading to FSUIPC. 6. Finish I hope that my English, which is not my First language, is understandable. Clearly the mistake I make is somewhere in converting my Mangnetic Heading to True. (An interesting thing I saw is that if I write the Pitch angle before the Altitude gets written the Pitch changes significantly. Perhaps this can help someone. It makes sense.) Perhaps there is a order to write the Position parameters? (Lat, Lon, Alt, Heading, Pitch, Bank angle.)
  2. Pete You are clearly misunderstanding me unfortunately. The writing and reading to and from offsets is, as you put it, a doodle. The only problem I have and persistently plagues me is that the true heading I am writing moves my aircraft incorrectly. The coordinates and altitudes are fine and I only read the magnetic variation after the plane is moved. Ill just play with it a bit more. Thats why I typed 20 and not -20. Thanks for the interesting way you answer my questions. Regards
  3. Pete Still no luck. I have tried it a thousand different ways. This I got thanks Pete. Works fine when reading from FS BUT . . . If you have a magnetic heading of say 100deg and a magn variation of say 20deg, how would you Write it to 0580. Code in C will be fine. The mathematics will be the same.
  4. This topic has been discussed on this forum but I have difficulty writing a heading to FS. (First converting my Magnetic heading to true.) My code that works 100% in converting the heading is as follows: (Where hdg and magv were read from FS, as heading and magnetic variation respectively.) magv = Round((magv * 360#) / 65536#, 1) magv = 360 - magv hdg = Round(((hdg * 360#) / (65536# * 65536#)), 1) hdg = hdg + magv If hdg < 0 Then hdg = 360 + hdg ElseIf hdg = 0 Then hdg = 360 ElseIf hdg > 360 Then hdg = hdg - 360 End If In Writng the heading I do as follows: Dim FS_Head As Long magv = (magv * 360#) / 65536# magv = 360 - magv FS_Head = txtHead.Text - magv FS_Head = (FS_Head * 65536# * 65536#) / 360# Call FSUIPC_Write(&H580, 4, VarPtr(FS_Head), dwResult) Call FSUIPC_Process(dwResult) Long is 4 Byte integer in VB. txthead is a text box with my magnetic heading I want. My problem comes in at converting the magnetic to true. Please help
  5. Thanks Pete I did not think it to be this simple. Understands it perfectly. Also just bear in mind that for some of the FSUIPC users programming is a hobby and a lot of the stuff is fairly hazy for us, especially if English is a third or fourth language. I am a poultry farmer, which explains a lot probably. Thanks again for the help.
  6. Pete Yes, I am writing certain values to open/unused offsets I have identified from 0x3210 onwards. It is for Hot key logging purposes. I can easily write single key presse like Z etc. but the combinations like in my post is a bit unclear. My application is in VB so perhaps one of the VB boffins out there can also help. Also how do I know when the GPS window is displayed? Is this possible without normal windows API's and purely with FSUIPC? Thanks
  7. What value do I need to use for Shift+Z to write as a Hot Key?? Should be fairly simple for most of you. Thanks you very much.
  8. Pete I obviously saw that but in VB I am unfimiliar how to add a Special build description field to the version info dialog, with the key as the value. This seems a VB specific problem. I cannot get a read instruction to work let alone a write one.
  9. I am defnately missing something huge. Why does all my read commands return zero to some of the basic ofsets. Is it something to do with my reg key or what. I do not think so. What does the varPtr() function mean? Am I correct in asuming that the data type I need to use must corelate to its size. E.g. if I need to read e.g. Ground altitude at 0020 then I would use a Long data type in VB which is 4 bytes long?? Offset 3C00 which I presume is a string, what VB data type should I use? String does not seem to work. Thanks for all the help.
  10. How do I incorporate the reg key in my VB application to be written automatically to FSUIPC?
  • 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.