FS2004 Fuel Gauge question

#1
Hello everyone

I have a problem which I haven't been able to fix since several days of looking; that's why I dare to ask for help.
Basically, it is a conditional text issue where one of two conditions is not updating a reading from an A:Var, that's odd for me, because the A:Var in
question is included in the first selection that is working as it should. The gauge is a Fuel Display Indicator. Since I can't see where the problem resides,
I will provide as much information as I can.

The Bell 407 has three fuel tanks, and I will list the variables I used for each fuel tank:
Gauge A:Vars
(A:FUEL TANK CENTER QUANTITY,gallon)
(A:FUEL TANK LEFT AUX QUANTITY,gallon)
(A:FUEL TANK EXTERNAL1 QUANTITY,gallon)

Aircraft.cfg file equivalent used in [Fuel] header
Center1 (92 usable gallons)
LeftAux (38 idem)
External1 (19 idem)

A switch controls what information should be displayed and the custom variable I used to toggle between two options is (L:Bell_407_Fuel_QTY_FWD_Tank,bool).
  1. If the variable (L:Bell_407_Fuel_QTY_FWD_Tank,bool) is false, then reading in the LCD is the sum of the fuel loaded all fuel tanks. This is the option that is working like it is meant to be. It updates the reading as the engine burns fuel.
  2. If the variable (L:Bell_407_Fuel_QTY_FWD_Tank,bool) is true, then reading in the LCD is the fuel quantity in the Left Auxiliary Tank. Here is the problem: I can read number 254.6 lbs of fuel (38 gallons * 6.7 lb/gal) but the reading is never updated!!! No matter if the engine is burning fuel.
The code includes an update section where (L:Bell_407_Fuel_Digital_Reading,gallon) is a custom variable which is used to store the fuel on board.
HTML:
      <Update>
          (L:Bell_407_Fuel_QTY_FWD_Tank,bool) !
                if{
                    (A:FUEL TANK CENTER QUANTITY,gallon) (A:FUEL TANK EXTERNAL1 QUANTITY,gallon) + (A:FUEL TANK LEFT AUX QUANTITY,gallon) + 6.7 *
                    (>L:Bell_407_Fuel_Digital_Reading,gallon)
                   }
              
          (L:Bell_407_Fuel_QTY_FWD_Tank,bool)
                if{
                    (A:FUEL TANK LEFT AUX QUANTITY,gallon) 6.7 *
                    (>L:Bell_407_Fuel_Digital_Reading,gallon)
                  }
      </Update>
And the conditional text is this:
HTML:
      <Element>
          <Position X="188" Y="354"/>
          <Visible>(A:Circuit general panel on, bool) </Visible>
          <FormattedText X="178" Y="80" Bright="Yes" Length="6" Font="Quartz" FontSize="80" Color="#8c9e6b" Adjust="Right" VerticalAdjust="Center">
              <Axis X="24" Y="0"/>
                  <String>
                      %((L:Bell_407_Fuel_Digital_Reading,gallon))%!03.1f!
                  </String>
          </FormattedText>
      </Element>
Also, I've attached the entire gauge code (if you want to see it).

In advance, thank you kindly.
Sergio.
 

Attachments

Last edited:
#3
Just a quick note on the gauge: In the real-life aircraft, when the Ext1 tank has fuel in it, it keeps the quantity in the other two full, or unchanging. If starting with full fuel in all three in other words, as the EXT1 empties, the quantity in the other two remains constantly full. Once the EXT1 empties, the aircraft draws fuel equally from the other two. Obviously, the LAUX will drain first, since it has less fuel in it, and once it's empty, the aircraft, obviously, will only draw from the CENTER.
The aircraft in the sim actually works this way the way it's set up. There are switches to activate both Boost and Transfer pumps, ensuring the fuel is burned in the correct order, and keep the quantities correct. It's easy to check on the situation in the Fuel and Payload menu.
The problem is getting the gauge to display the LAUX tank quantity ONLY, as it burns down. For some reason it's not.

I'm helping Sergio work this gauge at the moment, is how I know about it. Having said that, I am a complete tyro when it comes to XML, but am learning as we go.
Any help with this will be hugely appreciated!
Pat☺
 

Heretic

Resource contributor
#4
I'm with Roman. Check the fuel selector. Default burn sequence is "External -> Tip -> Aux -> Wing -> Center", making it unusable for airliners since center is always drained first.

If you want to be 110% sure that the right tank is used at the right time, you'll have to implement a custom fuel selector logic.
 
#5
Well, empirical testing has shown the fuel tank usage, with the way all the gauges, switches, etc, are currently written, IS correct. It drains the EXT1 tank first, THEN the other two at the same rate and time.
IE: EXT1 is used before any other fuel is touched, as it should be, then the LAUX and Center drain together. That part of the whole affair functions exactly as it should.
I believe Sergio's problem is only the way the gauge displays that usage.
Pat☺
 
#6
Hi lads!!!

@Roman, Pat, Bjoern:
As always, thank you for the swift replies! I am sure it is what you've teached me; however, I am clueless this time. How on earth can I control A:Vars?

I'm with Roman. Check the fuel selector. Default burn sequence is "External -> Tip -> Aux -> Wing -> Center", making it unusable for airliners since center is always drained first.

If you want to be 110% sure that the right tank is used at the right time, you'll have to implement a custom fuel selector logic.
Holy cow! I never read that in the FS9's SDK! Thanks for that, I didn't knew that

I am beginning to suspect, that there's much more in this regard :oops:
First of all, I will carefully read Roman's link; right after, I will come back to share what I learned.

Thank you all!
Sergio.
:)
 
Last edited:
#8
Sergio,, please no !!
Don't do that..

That code was just to monitor what is going on with the tank switching, if any, to give further insight.
Your original code is just fine as is..

XML:
<Element>
          <Position X="XX" Y="YY"/>  <!-- Somewhere out of the way to monitor -->
          <Visible>(A:Circuit general panel on, bool) </Visible>
          <FormattedText X="178" Y="80" Bright="Yes" Length="2" Font="Quartz" FontSize="80" Color="#8c9e6b" Adjust="Right" VerticalAdjust="Center">
              <Axis X="24" Y="0"/>
                  <String>
                      %((A:FUEL TANK SELECTOR 1, number))%!d!
                  </String>
          </FormattedText>
      </Element>
 
#9
Sergio,, please no !!
Don't do that..

That code was just to monitor what is going on with the tank switching, if any, to give further insight.
Your original code is just fine as is..
Roman, you're a life saver! I will see what's going on and implement the gauge monitor you kindly wrote for me. :wizard: :wizard: :wizard:
I will "refresh" my ideas and come back to you shortly. Thank you kindly my friend; I really appreciate it.

Sergio.
:)
 
#10
Hello friends!

I think I have a working version now; both as a 2D gauge and 3D parts working in tandem. Since the code is very large, I wasn't unable to posted as I usually do. However, if somebody wants is interested to have it or just read the code, just let me know.

Dear friends, thank you kindly for your valuable help.
All the best,
Sergio.
;)
 
Top