1. ## 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. ## 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.

FSInterrogate, available inside the FSUIPC SDK --
http://www.schiratti.com/dowson.

Regards,

Pete

3. ## 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. ## 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. ## Fuel level offset

Thanks very much. I will try that tonight !

Phil

6. ## 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