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.
<Element>
<Select>
<Value>(L:FLD_State,enum) 2 (L:FLD_State,enum) 0 if{ (L:EAFS, enum) (A:FUEL TOTAL QUANTITY,gallons) - (>L:EAFS,enum) }</Value>
.................
<Value>(L:FLD_State,enum) 2 (L:FLD_State,enum) 0 if{ (L:EAFS,enum) (A:FUEL TOTAL QUANTITY,gallons) - (>L:EAFS, enum) } </Value> increases value
<Value>(L:FLD_State,enum) 2 (L:FLD_State,enum) 0 if{ (>L:EAFS,enum) -- (A:FUEL TOTAL QUANTITY,gallons) (L:EAFS, enum) /-/ } </Value> increases value
<Value>(L:FLD_State,enum) 2 (L:FLD_State,enum) 0 if{ (L:EAFS,enum) -- (A:FUEL TOTAL QUANTITY,gallons) (>L:EAFS, enum) /-/ } </Value>
<Value>(L:FLD_State,enum) 2 (L:FLD_State,enum) 0 if{ (L:EAFS,enum) (A:FUEL TOTAL QUANTITY,gallons) (>L:EAFS, enum) -} </Value>
<Value>(L:FLD_State,enum) 2 (L:FLD_State,enum) 0 if{ (L:EAFS,enum) (A:FUEL TOTAL QUANTITY,gallons) (>L:EAFS, enum) -} </Value>
<Value>(L:FLD_State,enum) 2 (L:FLD_State,enum) 0 if{0} (L:EAFS,enum) (A:FUEL TOTAL QUANTITY,gallons) (>L:EAFS, enum) -} </Value>
<Value>(L:FLD_State,enum) 2 (L:FLD_State,enum) 0 if{ (A:FUEL TOTAL QUANTITY,gallons) (L:EAFS, enum) (>L:EAFS,enum) -}</Value> all increases value

&&
<Value>(L:FLD_State,enum) 2 == (L:FLD_State,enum) 0 == && if{ (L:EAFS,enum) (A:FUEL TOTAL QUANTITY,gallons) - (>L:EAFS, enum) } </Value> increases value
<Element>
<Select>
<Value>(L:FLD_State,enum) 2 == (L:FLD_State,enum) 0 == && if{ (L:EAFS, enum) (A:FUEL TOTAL QUANTITY,gallons) - (>L:EAFS, enum) } </Value>
</Select>
</Element>
</Gauge>
Yes that's correct.Also, the way you have the above line written you are subtracting the FUEL TOTAL QUANTITY from L:EAFS. Is this what you want?
<Gauge Name="EAFS_fuel_Level" Version="1.0">
<Image Name="EAFS_solid1.bmp"/>
<Element>
<Position X="151" Y="151"/>
<Image Name="needleVolts.bmp" PointsTo="North">
<Axis X="2" Y="55"/>
</Image>
<Rotate>
<Value Maximum="10000" Minimum="0"> (L:EAFS, number)</Value>
<Nonlinearity>
<Item Value="0" X="95" Y="247"/>
<Item Value="1000" X="53" Y="208"/>
<Item Value="2000" X="36" Y="152"/>
<Item Value="3000" X="53" Y="95"/>
<Item Value="4000" X="94" Y="53"/>
<Item Value="5000" X="150" Y="41"/>
<Item Value="6000" X="206" Y="55"/>
<Item Value="7000" X="247" Y="95"/>
<Item Value="8000" X="264" Y="150"/>
<Item Value="9000" X="248" Y="208"/>
<Item Value="10000" X="210" Y="245"/>
</Nonlinearity>
<Delay DegreesPerSecond="2"/>
</Rotate>
</Element>
<Element>
<Select>
<Value>(L:FLD_State,enum) 2 == (L:FLD_State,enum) 0 == && if{ (L:EAFS, enum) (A:FUEL TOTAL QUANTITY,gallons) - (>L:EAFS, enum) } </Value>
</Select>
</Element>
</Gauge>
<Value>(L:FLD_State,enum) 2 == (L:FLD_State,enum) 0 == && if{ (L:EAFS, enum) 10000 < if{ (L:EAFS, enum) (A:FUEL TOTAL QUANTITY,gallons) - (>L:EAFS, enum) } } </Value>
(L:FLD_State,enum) 2 == (L:FLD_State,enum) 0 ==
<Value>(L:FLD_State,enum) 2 == (L:FLD_State,enum) 0 == && if{ 0 } (L:EAFS, enum) 10000 < if{ (L:EAFS, enum) (A:FUEL TOTAL QUANTITY,gallons) - (>L:EAFS, enum) } els{ 2 } } </Value>



Hi TomYou cannot tie them all together that way. They need to be two separate statements as I wrote above. Four steps:
1. Set the State to 2, and set the tanksub to 1 at the same time.
2. In a separate statement, check for state = 0 and tanksub = 1. If true, go to step 3.
3. If true, do your unloading.
4. Then at the end of the unloading code, set the tanksub to 0.
<Element>
<Select>
<Value> (L:FLD_State,enum) 2 d / max ++ (>L:TankSub, number) </Value>
</Select>
</Element>
<Element>
<Select>
<Value> (L:FLD_State,enum) 0 == (L:TankSub, number) 2 == if{ (L:EAFS, enum) (A:FUEL TOTAL QUANTITY,gallon) - } els{ (L:FUEL TOTAL LEVEL,percent) 99 > 0 (>L:TankSub, number) } </Value>
</Select>
</Element>

<Element>
<Select>
<Value> (L:FLD_State,enum) 2 == if{ 1 (>L:TankSub, number) } </Value>
</Select>
</Element>
<Element>
<Select>
<Value> (L:FLD_State,enum) 0 == (L:TankSub, number) 2 == && if{ (L:EAFS, enum) (A:FUEL TOTAL QUANTITY,gallon) - (>L:EAFS, enum) 0 (>L:TankSub, number) } </Value>
</Select>
</Element>
Sorry, I don't understand what this code is supposed to do.Sorry, I don't understand what this code is supposed to do. And you have the tanksub going to 0 in the ELSE part of the statement, which means it happens when the conditions are NOT true. It should happen when they ARE TRUE - i.e. in the IF part of the statement. And why is there an ELSE section at all? And what is the test for 99 percent fuel for? And in the IF section you are not saving the results of the L:EAFS minus Total Fuel to anything. And you are missing the AND function.
Perhaps something like:
XML:<Element> <Select> <Value> (L:FLD_State,enum) 2 == if{ 1 (>L:TankSub, number) } </Value> </Select> </Element> <Element> <Select> <Value> (L:FLD_State,enum) 0 == (L:TankSub, number) 2 == && if{ (L:EAFS, enum) (A:FUEL TOTAL QUANTITY,gallon) - (>L:EAFS, enum) 0 (>L:TankSub, number) } </Value> </Select> </Element>
I would normally have the first Element's 1 saved into TankSub instead in a click statement that actually changes the L:FLD_state variable to 2. That way it's only run once. Better coding, but not critical.