#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    2
    Rep Power
    0

    Microsoft Flight Simulator XLM question


    Hi folks,

    Below is a bit of code from an XML file that defines some of the functions of a MFD (Multifunction Display) in the cockpit of a small business jet I purchased.

    The section labelled "RANGE NM" is the bit that is wrong, it returns a result on the display in the cockput that is about 50% low.

    The actual range remaining in nautical miles should be calculated based on the total remaining fuel in pounds, divided by the fuel flow in pounds per hour, and then multiplied by the ground speed in knots.

    However I think the dude that wrote this got it wrong. The problem is I have no idea how to code in XML so I would appreciate someone point out his mistake and correct it. I can then recompile the MFD and have it display the correct value when I am flying the aircraft.

    I have included another section called ENDUR, which returns a correct result.



    <!-- ******* ENDUR ................... -->

    <Element>
    <Position X="68" Y="207"/>
    <FormattedText X="56" Y="20" Font="Arial Bold" Adjust="Left" Color="Green" FontSize="18" Bright="Yes" >
    <String>%((A:FUEL TOTAL QUANTITY WEIGHT, pounds) (A:ENG1 FUEL FLOW PPH, pound per hour) / s0 flr s1 )%!02d!:%(l0 l1 - 60 *)%!02d! </String>
    </FormattedText>
    </Element>

    <!-- ******* RANGE NM ..................... -->

    <Element>
    <Position X="70" Y="229"/>
    <FormattedText X="36" Y="20" Font="Arial Bold" FontSize="18" Adjust="Right" Color="Green" Bright="Yes">
    <String>%((A:FUEL TOTAL QUANTITY WEIGHT, pounds) (A:ENG1 FUEL FLOW PPH, pounds per hour) (A:ENG1 FUEL FLOW PPH, pounds per hour) + / (A:GROUND VELOCITY,knots) *)%!d!</String>
    </FormattedText>
    </Element>
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,232
    Rep Power
    9400
    Code:
    <Element>
    <Position X="70" Y="229"/>
    <FormattedText X="36" Y="20" Font="Arial Bold" FontSize="18" Adjust="Right" Color="Green" Bright="Yes">
    <String>%((A:FUEL TOTAL QUANTITY WEIGHT, pounds) (A:ENG1 FUEL FLOW PPH, pounds per hour) (A:ENG1 FUEL FLOW PPH, pounds per hour) + / (A:GROUND VELOCITY,knots) *)%!d!</String>
    </FormattedText>
    </Element>
    The stuff in blue is XML. The stuff in black is not.
    Code:
    %((A:FUEL TOTAL QUANTITY WEIGHT, pounds) (A:ENG1 FUEL FLOW PPH, pounds per hour) (A:ENG1 FUEL FLOW PPH, pounds per hour) + / (A:GROUND VELOCITY,knots) *)%!d!
    That is what you need to edit. So long as you don't need <s, >s, or &s then you can put whatever you want in there.

    As for how to edit it, it looks like a formula in RPN (X Y +). If you can give me the formula in normal infix notation (X+Y), using the right symbols and syntax, then I can rearrange it into RPN for you.


    [edit] Half the value it should be? I think the second ENG1 FUEL FLOW PPH doesn't belong.
    Code:
    %((A:FUEL TOTAL QUANTITY WEIGHT, pounds) (A:ENG1 FUEL FLOW PPH, pounds per hour) / (A:GROUND VELOCITY,knots) *)%!d!
    Last edited by requinix; August 1st, 2011 at 12:33 PM.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    2
    Rep Power
    0
    Thankyou for your assistance. The correct code turned out to be

    <String>%((A:FUEL TOTAL QUANTITY WEIGHT, pounds) (A:ENG1 FUEL FLOW PPH, pounds per hour) / (A:GROUND VELOCITY,knots) *)%!d!</String>

IMN logo majestic logo threadwatch logo seochat tools logo