• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FS2004 Fuel Gauge question

Messages
1,451
Country
mexico
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

  • Fuel_Bell_407_lbs.zip
    2.4 KB · Views: 189
Last edited:
Messages
440
Country
us-wisconsin
Seems to look good, looked at full code...
Maybe try emptying the center & auxiliary tanks while engine running.
It may be the tank switching logic involved, if the the tank selector is set to "ALL" or maybe even "LEFT" they will burn in this order (IIRC) until empty -
EXT 1, L.AUX, CENTER

Again if IIRC :scratchch:banghead::stirthepo

Use (A:FUEL TANK SELECTOR 1, number) & https://msdn.microsoft.com/en-us/library/cc526981.aspx#FuelTankSelection to see what's up
 
Messages
113
Country
unitedstates
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
Messages
6,830
Country
germany
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.
 
Messages
113
Country
unitedstates
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☺
 
Messages
1,451
Country
mexico
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:
Messages
440
Country
us-wisconsin
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>
 
Messages
1,451
Country
mexico
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.
:)
 
Messages
1,451
Country
mexico
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