The simFlight Network Forums

# I have a question!

## Recommended Posts

Hello,

I want to read out the present fuel of my Aircraft. Is there any Offset for that? I only found the offset for the fuel capacity of each tank.

Thanks a lot

MotoxX

##### Share on other sites

I want to read out the present fuel of my Aircraft. Is there any Offset for that? I only found the offset for the fuel capacity of each tank.

For each tank there is not only the capacity, but the percentage occupied by fuel. These are all in pairs for all possible tanks -- see offsets 0B74-0BA8, and 1244-1260.

Regards,

Pete

##### Share on other sites

Hello,

I have a problem. You told me the offsets to read out the fuel of each tank in a former post, but I don't know how interpret the value I get. For example, I used the offset 0B7C for the left tank and a Boing 737-400. The tank contains 56% and 840Gallons but my program using the offset above shows me a 71. But what does that 71 mean and what means "%*128*65536" ?

I need the precise valu of the fuel.

Thanks a lot and good evening.

MotoxX

##### Share on other sites

I have a problem. You told me the offsets to read out the fuel of each tank in a former post, but I don't know how interpret the value I get. For example, I used the offset 0B7C for the left tank and a Boing 737-400. The tank contains 56% and 840Gallons but my program using the offset above shows me a 71. But what does that 71 mean and what means "%*128*65536" ?

If you are reading "71" you are only reading the high word (2 bytes or 16 bits at 0B7E). With 56% capacity the value in 0B7C as a 32-bit value is 4698168. This would give 71 if divided by 65536 -- in other words the value in the high 16 bits is 71.

But take your 71 (ignore the fractional part for now) and calculate that as a percentage of 128.

(71 * 100) / 128 = 55.47

The missing portion of the true % value is lost in the fraction part. Take the full 32 bit value and do the calculation implied by the description:

(4698168 * 100) / (128 * 65536) = 56.01%

If you want the amount of fuel in US Gallons, read the capacity also (from 0B80 in this case and calculate 56% of that. If you want it in pounds weight use the conversion value given by the offset 0AF4 (the relationship will change slightly with altitude).

Please look inside the FSUIPC SDK package, and find and install FSInterrogate. Run that next to FS and tell it to load the FSUIPC.FSI file I provide. You will find it very instructive to use FSInterrogate to learn about any of the FS variables you are interested in, and to check your own work. It will read any or all FS values and display them in a multitude of ways. You can also see the formulae I give actually work in practice, and so see how to do things.

Regards,

Pete

## Create an account

Register a new account