• 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.

FSXA Simple Fuel flow XML code

Messages
29
Country
us-nevada
I am having trubble trying to find a simple XML code for fuel flow on a twin engine warbird. I am building a P2 neptune and trying to build all 3D gauges for it but have run into a problem when using default FSX XML's as there are not many that will work for the gauges I am building.
 

Attachments

  • panel009.jpg
    panel009.jpg
    97 KB · Views: 666
  • panel008.jpg
    panel008.jpg
    40 KB · Views: 646
Last edited:
I am having trubble trying to find a simple XML code for fuel flow on a twin engine warbird.

If you're building (coding) your own gauges as you say, just make use of the fuel flow A:Vars

(A:ENG1 FUEL FLOW GPH, gallons per hour)
(A:ENG2 FUEL FLOW GPH, gallons per hour)

or

(A:ENG1 FUEL FLOW PPH, pounds per hour)
(A:ENG2 FUEL FLOW PPH, pounds per hour)

Or, are you really looking for completely functional gauges that you can plug into your panel, in this case, a twin engine fuel flow gauge, vintage 1940's military?

Bob
 
Last edited:
If you're building (coding) your own gauges as you say, just make use of the fuel flow A:Vars

(A:ENG1 FUEL FLOW GPH, gallons per hour)
(A:ENG2 FUEL FLOW GPH, gallons per hour)

or

(A:ENG1 FUEL FLOW PPH, pounds per hour)
(A:ENG2 FUEL FLOW PPH, pounds per hour)

Or, are you really looking for completely functional gauges that you can plug into your panel, in this case, a twin engine fuel flow gauge, vintage 1940's military?

Bob

Thank you for the quick reply. Ya I was looking for just the xml code to put in modeldef, I am not good with writing xml's, will be learning at anothe date or after I get this these model done.
 
I have been trying to build some xml code but I have no clue what I am doing. I realy don't understand xml at all and don't understand how all the diferent codes work, I would love to be able to write my own xml's but if I have no clue what it is I am doing then I don't feel that I am learning anything. If someone could help me it would be much appreciated.
 
I honestly don't know how to help you. I started by looking at existing XML gauges. If you start with a relatively simple gauge (like one with a single needle) you will be able to see how a gauge is constructed. Then try modifying things to see how this changes the output display. Then move on to more complicated gauges.

There are many fuel flow gauges out there, but I'll post one here for reference - this is a round gauge with a needle for Engine #1. I've included comments within the gauge code which should help:

Code:
<Gauge Name="Fuel Flow 1" Version="1.0">
   <Image Name="FF_BACK.bmp" /> <!-- gauge background bitmap -->

   <Element>
      <Position X="150" Y="150"/>  <!-- position of the axis of the needle on the background bitmap -->
      <Image Name="ENG_1_ND2.bmp" PointsTo="East">  <!-- needle bitmap, with needle pointing to the right (East) --> 
         <Axis X="60" Y="12.5"/>  <!-- position of the needle axis on the needle bitmap -->
      </Image>
      <Rotate>
         <Value Minimum="0" Maximum="1000">(A:Eng fuel flow PPH:1, pounds per hour)</Value>  <!-- variable used to control the needle, with a maximum of 1000 and minimum of 0 (needle static outside those limits) -->
         <Failures>  <!-- if the engine fails, fail this gauge too -->
            <SYSTEM_ENGINE Action="0"/>
         </Failures>
         <Nonlinearity>  <!-- the needle will point to these pixel locations on the background bitmap when the variable reaches these values -->
            <Item Value="0" X="90" Y="250"/>
            <Item Value="200" X="30" Y="150"/>
            <Item Value="400" X="90" Y="46"/>
            <Item Value="600" X="209" Y="46"/>
            <Item Value="800" X="270" Y="150"/>
            <Item Value="1000" X="209" Y="252"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="90"/>  <!-- slow the movement of the needle down so it won't move instantaneously when the value changes rapidly -->
      </Rotate>
   </Element>
 
   <Mouse>  <!-- normally used for clickable areas, but in this case only provides a tool tip -->
         <Tooltip>Engine 1 FUEL FLOW (%((A:Eng fuel flow PPH:1, pounds per hour))%!d! PPH)</Tooltip>  <!-- This will read: Engine 1 FUEL FLOW (475 PPH) (%!d! means integer display, the odd %( ) format is used for displaying variables within strings) -->
   </Mouse>
   <copyright>(c)2012 Tom Gibson</copyright>
</Gauge>

While this is in FS2004 format, it will also work OK in FSX.

Hope this helps,
 
Last edited:
I honestly don't know how to help you. I started by looking at existing XML gauges. If you start with a relatively simple gauge (like one with a single needle) you will be able to see how a gauge is constructed. Then try modifying things to see how this changes the output display. Then move on to more complicated gauges.

There are many fuel flow gauges out there, but I'll post one here for reference - this is a round gauge with a needle for Engine #1. I've included comments within the gauge code which should help:

Code:
<Gauge Name="Fuel Flow 1" Version="1.0">
   <Image Name="FF_BACK.bmp" /> <!-- gauge background bitmap -->

   <Element>
      <Position X="150" Y="150"/>  <!-- position of the axis of the needle on the background bitmap -->
      <Image Name="ENG_1_ND2.bmp" PointsTo="East">  <!-- needle bitmap, with needle pointing to the right (East) --> 
         <Axis X="60" Y="12.5"/>  <!-- position of the needle axis on the needle bitmap -->
      </Image>
      <Rotate>
         <Value Minimum="0" Maximum="1000">(A:Eng fuel flow PPH:1, pounds per hour)</Value>  <!-- variable used to control the needle, with a maximum of 1000 and minimum of 0 (needle static outside those limits) -->
         <Failures>  <!-- if the engine fails, fail this gauge too -->
            <SYSTEM_ENGINE Action="0"/>
         </Failures>
         <Nonlinearity>  <!-- the needle will point to these pixel locations on the background bitmap when the variable reaches these values -->
            <Item Value="0" X="90" Y="250"/>
            <Item Value="200" X="30" Y="150"/>
            <Item Value="400" X="90" Y="46"/>
            <Item Value="600" X="209" Y="46"/>
            <Item Value="800" X="270" Y="150"/>
            <Item Value="1000" X="209" Y="252"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="90"/>  <!-- slow the movement of the needle down so it won't move instantaneously when the value changes rapidly -->
      </Rotate>
   </Element>
 
   <Mouse>  <!-- normally used for clickable areas, but in this case only provides a tool tip -->
         <Tooltip>Engine 1 FUEL FLOW (%((A:Eng fuel flow PPH:1, pounds per hour))%!d! PPH)</Tooltip>  <!-- This will read: Engine 1 FUEL FLOW (475 PPH) (%!d! means integer display, the odd %( ) format is used for displaying variables within strings) -->
   </Mouse>
   <copyright>(c)2012 Tom Gibson</copyright>
</Gauge>

While this is in FS2004 format, it will also work OK in FSX.

Hope this helps,

Thank you Tom I will look this over and try to make it work for a 3D gauge xml code. I am building a two needle fuel flow gauge in G-max, one needle will be for engine one and the other will be for engine two.
 
This is a typical twin brake pressure gauge again for FS2004 so you can see it's fairly straightforward!
vololiberista
Code:
<Gauge Name="brake_pressure" Version="1.0">
  <Image Name="hydraulic_pressure_background.bmp"  Luminous="1"/>
  
  <!-- ========================= Brake Pressure Gauge ========== -->
  <Element>
    <Position X="35" Y="155"/>
    <Image Name="hydr_press_left_needle.bmp" PointsTo="East" UseTransparency="Yes"  Luminous="1">
      <Axis X="-64" Y="6"/>
    </Image>
    <Rotate>
      <Value Minimum="0" Maximum="100">(A:Brake Left Position, percent)</Value>
      <Nonlinearity> 
         <Item Value="100" X="121" Y="69"/>
         <Item Value="50" X="156" Y="156"/>
         <Item Value="0" X="121" Y="243"/>
      </Nonlinearity>
<Delay DegreesPerSecond="60"/>
    </Rotate>
  </Element>
  
    <Element>
      <Position X="275" Y="155"/>
      <Image Name="hydr_press_right_needle.bmp" PointsTo="West" UseTransparency="Yes"  Luminous="1">
        <Axis X="120" Y="6"/>
      </Image>
      <Rotate>
        <Value Minimum="0" Maximum="100">(A:Brake Right Position, percent)</Value>
        <Nonlinearity> 
           <Item Value="0" X="188" Y="243"/>
           <Item Value="50" X="156" Y="156"/>
           <Item Value="100" X="188" Y="69"/>
        </Nonlinearity>
<Delay DegreesPerSecond="60"/>
      </Rotate>
    </Element>
  
  <Mouse>
    <Tooltip>Brake hydraulic pressure</Tooltip>
  </Mouse>
</Gauge>
 
This is what I have for a gauge and what I have for a xml code.
I was just working on making one needle move and the was going to add code to make the other move.

<PartInfo>
<Name>Fuel Flow</Name>
<AnimLength>200</AnimLength>
<Animation>
<Parameter>
<Sim>
<Variable>(A:ENG FUEL FLOW PPH:1, pph)</Variable>
<Units>degrees</Units>
<Scale>1</Scale>
<MinValue>0</MinValue>
<MaxValue>200</MaxValue>
</Sim>
</Parameter>
</Animation>
</PartInfo>
 

Attachments

  • panel017.jpg
    panel017.jpg
    16 KB · Views: 779
  • panel016.jpg
    panel016.jpg
    21.7 KB · Views: 760
I don't make 3D gauges, but I'll give you what I think I know...

Does the needle go to 0 when the engines are shut off? (the fuel boost pumps must also be off). It looks like it is pegged at 200 PPH. AFAIK in 3D gauges the needle keyframe is the value of the variable used, as modified by the Bias and Scale values.

So with a Scale of 1 you have it set to only move the needle between 0 and 200 PPH - OK for a small GA plane, I guess, but most engines will go quite a bit higher than 200 PPH. The R-3350 engines of a P-2 Neptune probably reach a fuel flow of greater than 1000 PPH.

I believe you can fix this by changing the Maximum value to 2000 and using a Scale of 0.1. This will scale the variable that runs between 0 and 2000 into keyframes that run between 0 and 200.

Hope this helps,
 
This pic was taken in g-max but with the xml code that i have i get no movement at all with engine on or off.
I tryed what you sugested and still got nothing.
 
Last edited:
Have you done this?

If so, you physically animate the object, then click on the FSXTools tab on top, click Animation Manager, set the keyframes, such as 0 thru 100, find the animation on the list, and click Attach.

Done.

Compile and test in FSX to see if its working right. If not, repeat the procedure.
 
Have you done this?

Yep, I have done all the key frames and attached the fuel flow tag to it and have done many edits and reattached the tad agine just to make sure. I key framed it from 0 to 200 keys and setup the xml to work from 0 to 200 keys but i still get no movement. This is what I have done with no results.

<PartInfo>
<Name>Fuel Flow</Name>
<AnimLength>200</AnimLength>
<Animation>
<Parameter>
<Sim>
<Variable>RECIP_ENGINE1_FUELFLOW_PPH</Variable>
<Units>Pounds per hour</Units>
<Scale>0.1</Scale>
<MinValue>0</MinValue>
<MaxValue>2000</MaxValue>
</Sim>
</Parameter>
</Animation>
</PartInfo>
 
The Variable should be RECIP ENG FUEL FLOW:1 when you use the<sim> format. Variables do not have underscores.

Did you also remember to include the Animation name= line with a unique guid?

You might find it easier to use <Code> rather than <sim>

Here is a working example of a fuel flow gauge:
Code:
<Animation name="needle_fuel_flow" guid="58279E46-3122-4252-AECD-BE08A11AFCCF" type="Sim" typeParam2="needle_fuel_flow" length="120" typeParam="AutoPlay"/>
Code:
<PartInfo>
		<Name>needle_fuel_flow</Name>
		<AnimLength>120</AnimLength>
		<Animation>
			<Parameter>
				<Code>(A:TURB ENG FUEL FLOW PPH:1,Pounds per hour) 100 /</Code>
			</Parameter>
		</Animation>
	</PartInfo>

This is for a turbine with up to 12,000 pounds per hour fuel flow. I'll let you do the variable and AnimLength changes

Roy
 
The Variable should be RECIP ENG FUEL FLOW:1 when you use the<sim> format. Variables do not have underscores.

Did you also remember to include the Animation name= line with a unique guid?

You might find it easier to use <Code> rather than <sim>

Here is a working example of a fuel flow gauge:
Code:
<Animation name="needle_fuel_flow" guid="58279E46-3122-4252-AECD-BE08A11AFCCF" type="Sim" typeParam2="needle_fuel_flow" length="120" typeParam="AutoPlay"/>
Code:
<PartInfo>
		<Name>needle_fuel_flow</Name>
		<AnimLength>120</AnimLength>
		<Animation>
			<Parameter>
				<Code>(A:TURB ENG FUEL FLOW PPH:1,Pounds per hour) 100 /</Code>
			</Parameter>
		</Animation>
	</PartInfo>

This is for a turbine with up to 12,000 pounds per hour fuel flow. I'll let you do the variable and AnimLength changes

Roy

Thank you Roy for the reply, Yep I put the name and new guid in (I have a notepad with a bunch of new guids in it for making new xml's), I am very new to xml, well a first timmer trying to understand how every thing works and how to write xml's. I will look at your working xml and my not working xml and see where iI whent wrong thank you all for the help and I will post a pick of the final gauge when compleet.
 
Last edited:
Thank you Roy I now have a working fuel flow gauge and my first xml ever created. Here is the XML that is working for me now, this xml works with number one engine and fuel flow gauge that starts from 0 to 20 x by 100= 2000 pounds per hour.

Code:
<Animation name="Needle_Fuel_Flow_1" guid="09b5740e-0261-45c7-a40f-20cd13aedf18" length="200" type="Sim" typeParam2="Needle_Fuel_Flow_1" typeParam="AutoPlay" />

Code:
<PartInfo>
      <Name>Needle_Fuel_Flow_1</Name>
      <AnimLength>200</AnimLength>
      <Animation>
      <Parameter>
           <Sim>
             <Variable>RECIP ENG FUEL FLOW:1</Variable>
               <Units>Pounds per hour</Units>
               <Scale>0.1</Scale>
               <MinValue>0</MinValue>
               <MaxValue>2000</MaxValue>
           </Sim>
     </Parameter>
      </Animation>
</PartInfo>
 
Now with working xml comes a good working gauge. I just added a new xml entry for engine two to make the second needle work and now I have a two needle fuel flow gauge. I wount to thank every one that helped me on this one. Hope now that I have somewhat of a understanding how xml's work I will beable to build all my gauges needed for this aircraft.
 

Attachments

  • gauge000.jpg
    gauge000.jpg
    35.8 KB · Views: 742
Last edited:
Still using the <Code> format instead of the <Sim> format will make it a lot easier. The way the math is done is reverse polish notation ie you first have your 2 operands in and then the operator. Any operator after that will use the 2 operands behind it even if they are the results of calculations.

so instead of 1 + 1 = 2 it will be 1 1 + = 2. To add more it would be like this:

1 1 + 2 + = 4.

You have far more control over your output to the frame number in the animation using <Code> than using <Sim> as you can use a multitude of other math functions plus if{ }/els{ } functions.
 
Back
Top