Jump to content
The simFlight Network Forums

jmsequeira

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by jmsequeira

  1. Hi again, :lol: Just to tell you were also right on your second reply... There's no need to use an array. So, the case is closed. Thank you once more, Joao Sequeira Lisbon, Portugal
  2. Hi Paul, :D Thank you for your first comment. I tried the things I posted on the previous replies, and as I told you, I didn't succed on the first try. However, I was doing a mistake: the "n" parameter must still be "8", and not "1", as I put it, despite the fact that we are not getting separate bytes but a single value. So, putting the type as double, as you suggested, and putting n=8 on the function argument, the result is perfect! Then we just have to convert from slug's to pounds, and the value is exactly what we get from the Flight Simulator interface. Thanks a lot, :D Kind regards, Joao Sequeira Lisbon, Portugal
  3. Hi Paul (again), Based on the previous message I wrote you, I'm going to try this and tell you later if it works: ------------------------------------------------------------------------ Private Function Read_Value(v As Long, n As Long) As Double Dim dwResult As Long Dim r() As Double Dim res As Double ReDim r(1) If FSUIPC_Read(v, n, VarPtr(r(1)), dwResult) Then If FSUIPC_Process(dwResult) Then res = r(i) Else ' Can't process End If Else ' Can't read End If Read_Value = res End Function ------------------------------------------------------------------------ Kind regards, Joao Sequeira
  4. Hi Paul, I'm using VB6. I based the code on a Peter Dowson's VB sample. Then I built some additional procedures and functions to handle each value. I'll try to follow your indication. However, I think I've tried to do exactly what you said. May be the implementation was not the correct one... The base sample I use to return integer values, is like this: Private Function Read_Value(v As Long, n As Long) As Double Dim dwResult As Long Dim r() As Byte Dim res As Double ReDim r(n) If FSUIPC_Read(v, n, VarPtr(r(1)), dwResult) Then If FSUIPC_Process(dwResult) Then res = 0# f = 1# For i = 1 To n res = res + f * r(i) f = f * 256# Next i Else ' Can't process End If Else ' Can't read End If Read_Value = res End Function How could I change this function to get a correct return to FLOAT64 value type? Thanks in advance, Kind regards, Joao Sequeira
  5. Hi, I've been trying to get the plane current mass based on the "FSUIPC for Programers" document. Unfortunately, I can't understand how this FLOAT64 value is coded. I can see all the 8 bytes of this offset decreasing while the plane is flying, but I can't understand how can I use them to get the plane's current mass value. I tried several aproaches, including IEEE-754 floating-point recomendation, but it simply doesn't fit on this. My main question is: - How to get the plane's current mass from the 8 bit value on offset 0x30C8??? Thank you, Kind Regards J. Sequeira
×
×
  • 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.