Jump to content
The simFlight Network Forums

WN-Dotzigen

Members
  • Posts

    7
  • Joined

  • Last visited

WN-Dotzigen's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi Paul! :D A friend in need is a friend indeed! :) I would like to hug you and then, with a cup of champagne, :o three cheers for you! You are a philantrop and mastermind. I never would have had the idea to use currency-Type-variables (currency in general is something rather strange to me...). But your tip to try Emre5134's code worked perfectly. The simultaneous readings with obplacer_xml.exe prove it: Thank you! Werner in Dotzigen (near Bern), Switzerland
  2. Hi Paul As suspected I did not succeed. After several tryals I encountered your text: So I capitulated, since my VB is VB 6.0 from 1998. Never the less I'm still left with Chris Brett's program, which is working well for FS-time and would probably also work for FS-position (Lat;Long;altitude). In my first forum-text of this thread I tried to present data which I got for tree positions ("Ranch,Texas";"Seattle Tacoma" and "Canberra"). I also communicated, that I have read Pete Dawson's instruction to multiply the Lat-data by 90.0/(10001750.0 * 65536.0 * 65536.0)=2.095 109 149E-15 Since this is only a factor Lat-data(Ranch)/Lat-data(Seattle) should be equal to 29.6452214482156/47.4314848387555=0.625011457 But in fact all the ratios of data pairs I extracted from FS throug Chris'program do not fit to 0.625, be it "byte" or "integer" or "long" or "double". I tried to show this in my tabels; it was not easy to insert a table in the forum -- sorry that (while trying to get a table) I unintentionally touched the QUOTE-button twice. -- However: the extracted data change with the FS-position. They obviously have a relation with the FS-Position. The "SODOKU" remains. Anyway: A great THANK YOU that you tried to help an ignorant amateur. Werner
  3. Thank you Paul ! You are very kind. I will try your advices -- but it's well possible that my education is not sufficient. I will report my success or failure in a few days. Thanks! Werner (P.S.: I will avoid to touch the "Quote" button...)
  4. Thank you, Pete, for quicker answer than I could debug my text... sorry that I'm not very familiar with programming. I just would like to connect my Tile-Finder to the FS. (See http://www.eumanagement.eu/FS/LOD/LOD.html#3). (unfortunatley I'm neither familiar with writing in forums: Please delete my doubled question; I did not manage to delete it myself :( ) Your text I quoted from "FSUIPC for Programmers.pdf" (in "FSUIPC_SDK.zip") ist for me too dificult to understand... Thank you anyway. Werner
  5. Dear friends! I tried to get Latitude-readings with Chris Brett's VB-Programm "UIPCHello" (included in Pete Dowson's "FSUIPC_SDK.zip" ; thank you a lot, Chris and Pete! ...but I would be greatful for further help; I'm not a professional programmer... :oops: ). I supplemented Chris' program code in the "Private Sub Timer1_Timer()"-section with "FSUIPC_Read(&H560, 8, VarPtr(Latitude(1)), dwResult)", where the Variable "Latitude(i)" was either: "Dim Latitude(8) As Byte" or "Dim Latitude(8) As Integer" or "Dim Latitude(8) As Long" or "Dim Latitude(8) As Double" (For Details see below) Whereas the Clock-bytes were always correctly transmitted, the &H560 - &H568 yielded: ====================================================================== for "Ranch Texas" Latitude 29.6452214482156 [list=] -----------Byte--------- Integ---------------------Long-------------------Double 1 0 0 1317470208 1.03739986505718E-307 2 0 20103 3319350 3 135 -22986 0 0 4 78 50 0 0 5 54 0 0 0 6 166 0 0 0 7 50 0 0 0 8 0 0 0 0 ====================================================================== for "Seattle Tacoma" Latitude 47.4314848387555 ...........Byte.........Integer....................Long.....................Double 1............0...........0........................1119944704.............3.65588727537466E-307 2............0...........17089...................5271087 3............193........28207...................0........................0 4............66.........80........................0........................0 5............47..........0........................0........................0 6............110.........0........................0.......................0 7.............80.........0........................0.......................0 8..............0.........0.........................0......................0 ====================================================================== for "Canberra Austr" Latitude -35.3143320222001 .............Byte........Integer....................Long..................Double 1.............0............0.....................-1446117376........-2.82530817051241E+307 2.............0...........-22066...............-3924502.............0 3............206..........7658..................0.....................0 4............169.........-60.....................0.....................0 5............234...........0.....................0.....................0 6.............29...........0.....................0.....................0 7.............196..........0.....................0....................0 8............255...........0....................0.....................0 ====================================================================== COPY OF MODIFIED PRIVATE SUB TIMER: Private Sub Timer1_Timer() Dim dwResult As Long Dim auiTime() As Byte Dim Latitude(8) As Byte 'Dim Latitude(8) As Integer 'Dim Latitude(8) As Long 'Dim Latitude(8) As Double ReDim auiTime(3) ' As an example of retrieving data, we will get the FS clock time. ' If we wanted additional reads/writes at the same time, we could put them here If FSUIPC_Read(&H238, 3, VarPtr(auiTime(1)), dwResult) Then ' "Read" proceeded without any problems If FSUIPC_Process(dwResult) Then ' "Process" proceeded without any problems lblClock.Caption = Format(auiTime(1), "00") & ":" & _ Format(auiTime(2), "00") & ":" & _ Format(auiTime(3), "00") Else ' Unable to "Process" lblClock.Caption = "Processing: " & ResultText(dwResult) End If Else ' Unable to "Read" lblClock.Caption = "Reading: " & ResultText(dwResult) End If ' The same for Latitude: If FSUIPC_Read(&H560, 8, VarPtr(Latitude(1)), dwResult) Then ' "Read" proceeded without any problems If FSUIPC_Process(dwResult) Then ' "Process" proceeded without any problems For i = 1 To 8 txtLat(i).Text = Latitude(i) 'of course I placed 8 Text(i)-fields on the form Next i End If End If End Sub ======================================================================== I am aware that crude data from &H560 to &H568 necessitates calculation to get Latitude. "FSUIPC for Programmers.pdf" (in "FSUIPC_SDK.zip") says: "Latitude of aircraft in FS units. To convert to Degrees: If your compiler supports long long (64-bit) integers then use such a variable to simply copy this 64-bit value into a double floating point variable and multiply by 90.0/(10001750.0 * 65536.0 * 65536.0). Otherwise you will have to handle the high 32-bits and the low 32-bits separately, combining them into one double floating point value (say dHi). To do, copy the high part (the 32-bit int at 0564) to one double and the low part (the 32-bit unsigned int at 0560) to another (say dLo). Remember that the low part is only part of a bigger number, so doesn‘t have a sign of its own. Divide dLo by (65536.0 * 65536.0) to give it its proper magnitude compared to the high part, then either add it to or subtract it from dHi according to whether dHi is positive or negative. This preserves the integrity of the original positive or negative number. Finally multiply the result by 90.0/10001750.0 to get degrees. Either way, a negative result is South, positive North." But unfortunately I could not solve this SODOKU... :? Thank you for help. Werner.niederer(a°t)sunrise.ch, Switzerland
×
×
  • 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.