Results 1 to 6 of 6
Thread: Fuel level offset
-
02-02-2005, 01:37 AM #1Phil WaeckerGuest
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
-
02-02-2005, 07:44 AM #2Peter DowsonGuest
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
-
02-02-2005, 07:55 AM #3Phil WaeckerGuest
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
-
02-02-2005, 08:19 AM #4Peter DowsonGuest
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
-
02-02-2005, 11:04 AM #5Phil WaeckerGuest
Fuel level offset
Thanks very much. I will try that tonight !
Phil
-
02-02-2005, 03:15 PM #6Phil WaeckerGuest
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
-
Need the fuel offset
By mondo50m in forum I/O Interfacing Hardware and SoftwareReplies: 5Last Post: 12-19-2010, 01:00 PM -
Fuel Handle and APU fuel consumption
By eudoniga in forum PM General Q & AReplies: 9Last Post: 02-04-2008, 10:59 AM -
FUEL level indicator..having problems
By lineman55 in forum FS2Phidget UsersReplies: 9Last Post: 03-13-2005, 07:18 PM -
fuel temp offset?
By Rob Archer in forum PM General Q & AReplies: 2Last Post: 11-27-2004, 07:37 PM
Explore Consensual Connections: Discover a Safe, Honest Dating Platform for Adult Encounters ...
Where to run FMGS if using a...