Results 1 to 6 of 6
  1. #1
    Phil Waecker
    Guest

    Fuel level offset

    Hello,

    I want to read the fuel level of for example the left main tank (offset
    0B7C). So I add in sysvar the following
    0B7C 4 leftfuellevel

    The problem is I don't really understand the value I get back. I would like
    LBS but it seems (SDK dixit) that the value is multiplied by 65535 ... Can
    someone help me ?

    Regards

    Phil


  2. #2
    Peter Dowson
    Guest

    Fuel level offset

    On 2/2/2005 12:37:10 AM, Phil Waecker wrote:
    >Hello,
    >
    >I want to read the fuel level
    >of for example the left main
    >tank (offset 0B7C). So I add
    >in sysvar the following
    >0B7C 4 leftfuellevel
    >
    >The problem is I don't really
    >understand the value I get
    >back. I would like LBS but it
    >seems (SDK dixit) that the
    >value is multiplied by 65535
    >... Can someone help me ?


    That's an FS offset, documented in the FSUIPC offsets list, which is also
    available on the PM documentation site.

    You could find out a lot more about this stuff by using the nice utility,
    FSInterrogate, available inside the FSUIPC SDK --
    http://www.schiratti.com/dowson.

    Regards,

    Pete



  3. #3
    Phil Waecker
    Guest

    Fuel level offset

    So if I understand well when you write :
    Fuel: left main tank level, % * 128 * 65536

    this means the value is the percentage of fuel in the tank and I have to
    divide it by 128*65536 ?

    Regards

    Phil


  4. #4
    Peter Dowson
    Guest

    Fuel level offset

    On 2/2/2005 6:55:04 AM, Phil Waecker wrote:
    >So if I understand well when
    >you write :
    >Fuel: left main tank level, %
    >* 128 * 65536
    >
    >this means the value is the
    >percentage of fuel in the tank
    >and I have to divide it by
    >128*65536 ?


    Well, almost. The term "percentage" is very loosely used in FS I'm afraid. In
    most cases they use it when they really mean "proportion". To get the
    percentage I think you need to not only divide by 128 * 65536 but also multiply
    by 100. Otherwise you end up with a fraction between 0 and 1, with 0
    empty, 1 full.

    I assume pmSystems is using floating point in its calculations, otherwise you
    should ad 32768 first, then divide by 65536 (the addition is to round up
    large fractions) then multiply by 100 then add 64 (same reason) before
    finally dividing by 128. That should give you a reasonably accurate
    percentage.

    Pete






  5. #5
    Phil Waecker
    Guest

    Fuel level offset

    Thanks very much. I will try that tonight !

    Phil


  6. #6
    Phil Waecker
    Guest

    Fuel level offset

    I tried it out and it works ! Your assumption was correct pmsys uses floating
    vars so I didn't need to add or substract anything all I had to do was
    multiply by 65536*128 and I got a value between 0 and 1.

    Phil


Similar Threads

  1. Need the fuel offset
    By mondo50m in forum I/O Interfacing Hardware and Software
    Replies: 5
    Last Post: 12-19-2010, 12:00 PM
  2. Fuel Handle and APU fuel consumption
    By eudoniga in forum PM General Q & A
    Replies: 9
    Last Post: 02-04-2008, 09:59 AM
  3. FUEL level indicator..having problems
    By lineman55 in forum FS2Phidget Users
    Replies: 9
    Last Post: 03-13-2005, 06:18 PM
  4. fuel temp offset?
    By Rob Archer in forum PM General Q & A
    Replies: 2
    Last Post: 11-27-2004, 06:37 PM