• 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 systems!

Messages
206
Country
unitedkingdom
Hi,

I have been trying to make a fuel selector system that determines which tanks the engines are fed by depending on the fuel pumps that are turned on...

I have read several threads on this, and I think I am really close to making it work, however, I can't work out what variable to "look" at to check that my settings are correct...

Code:
<!-- Fuel from RIGHT -->
<Element>
	<Select>
	<Value>(L:RFUELPUMPFW, bool) (L:RFUELPUMPBW, bool) or if{ 1 (>L:Rfuelfeed, bool) } els{ 0 (>L:Rfuelfeed, bool) }</Value>
	</Select>
</Element>

<!-- Fuel from CENTER -->
<Element>
	<Select>
	<Value>(L:CFUELPUMPFW, bool) (L:CFUELPUMPBW, bool) or if{ 1 (>L:Cfuelfeed, bool) } els{ 0 (>L:Cfuelfeed, bool) }</Value>
	</Select>
</Element>

<!-- Fuel from LEFT -->
<Element>
	<Select>
	<Value>(L:LFUELPUMPFW, bool) (L:LFUELPUMPBW, bool) or if{ 1 (>L:Lfuelfeed, bool) } els{ 0 (>L:Lfuelfeed, bool) }</Value>
	</Select>
</Element>

<!-- Fuel from LEFT or RIGHT X-FEED -->
<Element>
	<Select>
	<Value>(L:Lfuelfeed, bool) 1 == (L:Rfuelfeed, bool) 1 == OR (L:FuelXfeed, bool) AND if{ 1 (>L:Lfuelfeed, bool) 1 (>L:Rfuelfeed, bool) }</Value>
	</Select>
</Element>

<!-- Fuel from RIGHT ONLY -->
<Element>
	<Select>
	<Value>(L:Rfuelfeed, bool) (L:Cfuelfeed, bool) ! &amp;&amp; (L:Lfuelfeed, bool) ! &amp; if{ 3 (>L:fset,enum) }</Value>
	</Select>
</Element>

<!-- Fuel from CENTER ONLY -->
<Element>
	<Select>
	<Value>(L:Rfuelfeed, bool) ! (L:Cfuelfeed, bool) &amp;&amp; (L:Lfuelfeed, bool) ! &amp; if{ 6 (>L:fset,enum) }</Value>
	</Select>
</Element>

<!-- Fuel from LEFT ONLY -->
<Element>
	<Select>
	<Value>(L:Rfuelfeed, bool) ! (L:Cfuelfeed, bool) ! &amp;&amp; (L:Lfuelfeed, bool) &amp; if{ 2 (>L:fset,enum) }</Value>
	</Select>
</Element>

<!-- Fuel from L & C -->
<Element>
	<Select>
	<Value>(L:Rfuelfeed, bool) ! (L:Cfuelfeed, bool) &amp;&amp; (L:Lfuelfeed, bool) &amp; if{ (A:FUEL TANK CENTER LEVEL, percent) 11 &lt; (A:FUEL TOTAL QUANTITY, gallons) (A:FUEL TANK CENTER QUANTITY, 

gallons) &gt; &amp;&amp; if{ 2 (>L:fset,enum) } els{ 6 (>L:fset,enum) }}</Value>
	</Select>
</Element>

<!-- Fuel from R & C -->
<Element>
	<Select>
	<Value>(L:Rfuelfeed, bool) (L:Cfuelfeed, bool) &amp;&amp; (L:Lfuelfeed, bool) ! &amp; if{ (A:FUEL TANK CENTER LEVEL, percent) 11 &lt; (A:FUEL TOTAL QUANTITY, gallons) (A:FUEL TANK CENTER QUANTITY, 

gallons) &gt; &amp;&amp; if{ 3 (>L:fset,enum) } els{ 6 (>L:fset,enum) }}</Value>
	</Select>
</Element>

<!-- Fuel from L & R -->
<Element>
	<Select>
	<Value>(L:Rfuelfeed, bool) (L:Cfuelfeed, bool) ! &amp;&amp; (L:Lfuelfeed, bool) &amp; if{ 16 (>L:fset,enum) }</Value>
	</Select>
</Element>

<!-- Fuel from ALL Tanks -->
<Element>
	<Select>
	<Value>(L:Rfuelfeed, bool) (L:Cfuelfeed, bool) &amp;&amp; (L:Lfuelfeed, bool) &amp; if{ (A:FUEL TANK CENTER LEVEL, percent) 11 &lt; (A:FUEL TOTAL QUANTITY, gallons) (A:FUEL TANK CENTER QUANTITY, 

gallons) &gt; &amp;&amp; if{ 1 (>L:fset,enum) } els{ 6 (>L:fset,enum) }}</Value>
	</Select>
</Element>

<!-- Feed unavailable force selector to zero setting -->
<Element>
	<Select>
	<Value>(L:FENG1AVAIL, enum) 0 == (L:FENG2AVAIL, enum) 0 == &amp;&amp; if{ 0 (>L:fset,enum) }</Value>
	</Select>
</Element>

<!-- Change sim setting when local setting has changed -->
<Element>
	<Select>
	<Value>(L:fset,enum) (L:Fsetprev,enum) != if{ (L:fset,enum) (>K:FUEL_SELECTOR_SET) (L:fset,enum) (>L:fsetprev,enum) }</Value>
	</Select>
</Element>

The above code does find the correct settings for the fuel selector and then looking at the (A:FUEL TANK SELECTOR 1, enum) value I see that it is indeed set in FS. However, the (A:FUEL SELECTED QUANTITY ,gallons) value is not the expected value - in fact, it is always zero! What is wrong?

Geoff
 
Funnily enough, this just suddenly seemed to start working. I must have done something stupid initially!

Reading out the value
Code:
(A:FUEL TANK SELECTOR 1, enum)
does tell me the right selector is getting set, but strangely the following code always returns true, even when the two numbers must be the same (based on sim behaviour)!

Code:
(A:FUEL TANK SELECTOR 1, enum) (L:Fsetprev,enum) != if{ etc.. }

The total fuel selected also still fails but then the expression " (total fuel) (total capacity) / " gets around that!

Geoff
 
Back
Top