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

Flaps XML Gauge Help

Ok.

on second review I've remarked that that's exactly what you've got in your code...

<Element>
<Select>
<Value>
(A:GEAR CENTER POSITION,percent) 30 &gt;
(A:Flaps handle index, number) 2 &gt; &amp;&amp;
(A:Flaps handle index, number) 9 &lt; &amp;&amp;
if{ (&gt;K:FLAPS_2) } els{ }
</Value>
</Select>
</Element>

I'd suggest to check whether the logic below this code part doesn't set the flaps to another position (copy this code snippet to the end of your code so it's executed last to test).

I agree with n4gix that splitting the logic into several <Element> parts renders it much less intelligible, and makes proper nesting more difficult.
 
Also, you may test whether that code snippet really works.
E.g. test whether (A:GEAR CENTER POSITION,percent) returns values 0-100, or 0-1.
Such an issue had me severely scratching my head in the past, in so far as a variable declared to return "percent" didn't return 0-100, but 0-1. I've only distant memories, and didn't take any notes then, just was happy finally having resolved it, but it may have been the gear...
 
Jimi,
because of your post i was reminded how K:FLAPS_SET works! Totally forgotten!
So i did some reprogamming of my flap gauge. a night mare became a child's play!

Also your gauge interested me. so i did a try. Here is the result.
This gauge was tested on FS9 with a F16. I have not installed FSX.
But the code should work!
This gauge works only with the F6 and F7 Keys. I blocked F5 and F8.
Do make the flapslever in your F18 work you can adapt my gauge by yourself or you have to tell me the name of variable which controlls the flapslever.

Now autoflaps comes on when speed higher as 240, gear up and flapslever is up.
Above mach 0.61 flaps will be set 0.
You have to adapt the section [Flaps]. See below.

<!-- Flaps 5 ** 15 degree -->
10.5 12.0 (A:INCIDENCE ALPHA,Degrees) rng
(A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 15 !=
&amp;&amp;
if{
5 (&gt;L:FA18TB_AFlaps_to_Set,number)
}

rng means range . i'm looking for alpha being between 10.5 and 12.
alpha near 15 != means flaps are not set to 15 degree.


I made a subfolder named Falcon below the Gauge - directory.
Entry in the panel.cfg

gaugexx=Falcon!FA-18TB_Autoflaps, 0, 0, 0, 0

edi


Code:
<Gauge Name="FA-18TB_Autoflaps.xml">
<Comment>
 New Flaps setting in Aircraft.cfg

flaps-position.0= 0    //   Range 00000  00910   K:FLAPS_SET  00000
flaps-position.1= 3    //   Range 00920  02732   K:FLAPS_SET  01820
flaps-position.2= 6    //   Range 02733  04552   K:FLAPS_SET  03640
flaps-position.3= 9    //   Range 04553  06372   K:FLAPS_SET  05460
flaps-position.4= 12   //   Range 06373  08192   K:FLAPS_SET  07280
flaps-position.5= 15   //   Range 08193  10012   K:FLAPS_SET  09100
flaps-position.6= 18   //   Range 10013  11832   K:FLAPS_SET  10920
flaps-position.7= 20   //   Range 11833  13653   K:FLAPS_SET  12740
flaps-position.8= 30   //   Range 13654  15473   K:FLAPS_SET  14560
flaps-position.9= 45   //   Range 15474  16384   K:FLAPS_SET  16380


</Comment>

<Update Frequency="18"/>

<!-- Flaps Key Catcher **** Flaps Key Catcher -->
  <Keys>
    <On Event="FLAPS_INCR">
    (L:FA18TB_Autoflaps_is_ON,bool)  <!-- Key is blocked -->
    if{
      (L:FLAPS_Handle_Index,number) 1820 * (&gt;K:FLAPS_SET)
      }

    (L:FA18TB_Autoflaps_is_ON,bool) !
    (L:FA18TB_FlapsLever_by_Key,number) 2 &lt;
    &amp;&amp;
    if{
      (L:FA18TB_FlapsLever_by_Key,number) ++ (&gt;L:FA18TB_FlapsLever_by_Key,number)

      (L:FA18TB_FlapsLever_by_Key,number) 0 == if{ 0 (&gt;K:FLAPS_SET) }
      (L:FA18TB_FlapsLever_by_Key,number) 1 == if{ 14560 (&gt;K:FLAPS_SET) }
      (L:FA18TB_FlapsLever_by_Key,number) 2 == if{ 16380 (&gt;K:FLAPS_SET) }
      }
    </On>

    <On Event="FLAPS_DECR">
    (L:FA18TB_Autoflaps_is_ON,bool)  <!-- Key is blocked -->
    if{
      (L:FLAPS_Handle_Index,number) 1820 * (&gt;K:FLAPS_SET)
      }

    (L:FA18TB_Autoflaps_is_ON,bool) !
    1 7 (A:FLAPS HANDLE INDEX,number) rng
    &amp;&amp;
    if{
      (L:FLAPS_Handle_Index,number) 1820 * (&gt;K:FLAPS_SET)
      }

    (L:FA18TB_Autoflaps_is_ON,bool) !
    (L:FA18TB_FlapsLever_by_Key,number) 0 &gt;
    &amp;&amp;
    if{
      (L:FA18TB_FlapsLever_by_Key,number) -- (&gt;L:FA18TB_FlapsLever_by_Key,number)

      (L:FA18TB_FlapsLever_by_Key,number) 0 == if{ 0 (&gt;K:FLAPS_SET) }
      (L:FA18TB_FlapsLever_by_Key,number) 1 == if{ 14560 (&gt;K:FLAPS_SET) }
      (L:FA18TB_FlapsLever_by_Key,number) 2 == if{ 16380 (&gt;K:FLAPS_SET) }
      }
    </On>

    <On Event="FLAPS_UP">
<!-- Key is blocked -->
      (L:FLAPS_Handle_Index,number) 1820 * (&gt;K:FLAPS_SET)
    </On>

    <On Event="FLAPS_DOWN">
<!-- Key is blocked -->
      (L:FLAPS_Handle_Index,number) 1820 * (&gt;K:FLAPS_SET)
    </On>
  </Keys>



<Element>
  <Select>
    <Value>
    (A:FLAPS HANDLE INDEX,number) (&gt;L:FLAPS_Handle_Index,number)  <!-- for blocking the Keys -->

<!-- Init Variable -->
    (G:Var1) 18 &lt;
    if{
      (A:FLAPS HANDLE INDEX,number) (&gt;L:FA18TB_AFlaps_to_Set,number)
      (A:FLAPS HANDLE INDEX,number) (&gt;L:FA18TB_AFlaps_Prev_Set,number)
      (G:Var1) ++ (&gt;G:Var1)
      }

<!-- Interface to the FSX FA18 Flaps Lever-->
      (L:FA18TB_FlapsLever_by_Key,number) 0 == if{ 0 (&gt;L:FSX_FA18_Interface_to_FLever) }
      (L:FA18TB_FlapsLever_by_Key,number) 1 == if{ 1 (&gt;L:FSX_FA18_Interface_to_FLever) }
      (L:FA18TB_FlapsLever_by_Key,number) 2 == if{ 2 (&gt;L:FSX_FA18_Interface_to_FLever) }

<!-- Switch Autoflap On -->
    (L:FA18TB_Autoflaps_is_ON,bool) !
    (A:AIRSPEED INDICATED,knots) 240 &gt;
    (L:FA18TB_FlapsLever_by_Key,number) 0 == 
    (A:GEAR TOTAL PCT EXTENDED,percent) 0.9 &lt;       <!-- Gear is going up -->
    &amp;&amp;
    &amp;&amp;
    &amp;&amp;
    if{
      1 (&gt;L:FA18TB_Autoflaps_is_ON,bool)             <!-- Autoflap is ON -->
      }

<!-- Switch Autoflap Off -->
    (L:FA18TB_Autoflaps_is_ON,bool)
    (A:AIRSPEED INDICATED,knots) 240 &lt;
    (A:GEAR TOTAL PCT EXTENDED,percent) 0.1 &gt;        <!-- Gear is going down -->
    &amp;&amp;
    &amp;&amp;
    if{
      0 (&gt;L:FA18TB_Autoflaps_is_ON,bool)             <!-- Autoflap is OFF -->
      }


<!-- Autoflaps  ON above 0.61 -->
    (L:FA18TB_Autoflaps_is_ON,bool)
    (A:AIRSPEED MACH,Mach) 0.61 &gt;
    (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) 1 &gt;
    &amp;&amp;
    &amp;&amp;
    if{
      0 (&gt;L:FA18TB_AFlaps_to_Set,number)
      }

<!-- Autoflaps  ON below 0.6 -->
    (A:AIRSPEED MACH,Mach) 0.6 &lt;
    (A:SIM ON GROUND, bool) !
    &amp;&amp;
    (L:FA18TB_Autoflaps_is_ON,bool)
    &amp;&amp;
    if{
<!-- Flaps 0  0 degree -->
      (A:INCIDENCE ALPHA,Degrees) 2 &lt;
      (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 0 !=
      &amp;&amp;
      if{
        0 (&gt;L:FA18TB_AFlaps_to_Set,number)
        }

<!-- Flaps 1 ** 3 degree -->
      2.5 4.0 (A:INCIDENCE ALPHA,Degrees) rng
      (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 3 !=
      &amp;&amp;
      if{
        1 (&gt;L:FA18TB_AFlaps_to_Set,number)
        }

<!-- Flaps 2 ** 6 degree -->
      4.5 6.0 (A:INCIDENCE ALPHA,Degrees) rng
      (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 6 !=
      &amp;&amp;
      if{
        2 (&gt;L:FA18TB_AFlaps_to_Set,number)
        }

<!-- Flaps 3 ** 9 degree -->
      6.5 8.0 (A:INCIDENCE ALPHA,Degrees) rng
      (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 9 !=
      &amp;&amp;
      if{
        3 (&gt;L:FA18TB_AFlaps_to_Set,number)
        }

<!-- Flaps 4 ** 12 degree -->
      8.5 10.0 (A:INCIDENCE ALPHA,Degrees) rng
      (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 12 !=
      &amp;&amp;
      if{
        4 (&gt;L:FA18TB_AFlaps_to_Set,number)
        }

<!-- Flaps 5 ** 15 degree -->
      10.5 12.0 (A:INCIDENCE ALPHA,Degrees) rng
      (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 15 !=
      &amp;&amp;
      if{
        5 (&gt;L:FA18TB_AFlaps_to_Set,number)
        }

<!-- Flaps 6 ** 18 degree -->
      12.5 16.0 (A:INCIDENCE ALPHA,Degrees) rng
      (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 18 !=
      &amp;&amp;
      if{
        6 (&gt;L:FA18TB_AFlaps_to_Set,number)
        }

<!-- Flaps 5  15 degree -->
      16.5 18.0 (A:INCIDENCE ALPHA,Degrees) rng
      (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 15 !=
      &amp;&amp;
      if{
        5 (&gt;L:FA18TB_AFlaps_to_Set,number)
        }

<!-- Flaps 4  12 degree -->
      18.5 20.0 (A:INCIDENCE ALPHA,Degrees) rng
      (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 12 !=
      &amp;&amp;
      if{
        4 (&gt;L:FA18TB_AFlaps_to_Set,number)
        }

<!-- Flaps 3  9 degree -->
      20.5 22.0 (A:INCIDENCE ALPHA,Degrees) rng
      (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 9 !=
      &amp;&amp;
      if{
        3 (&gt;L:FA18TB_AFlaps_to_Set,number)
        }

<!-- Flaps 2  6 degree -->
      22.5 24.0 (A:INCIDENCE ALPHA,Degrees) rng
      (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 6 !=
      &amp;&amp;
      if{
        2 (&gt;L:FA18TB_AFlaps_to_Set,number)
        }

<!-- Flaps 1  3 degree -->
      24.5 26.0 (A:INCIDENCE ALPHA,Degrees) rng
      (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 3 !=
      &amp;&amp;
      if{
        1 (&gt;L:FA18TB_AFlaps_to_Set,number)
        }

<!-- Flaps 0  0 degree -->
      (A:INCIDENCE ALPHA,Degrees) 26.5 &gt;
      (A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees) near 0 !=
      &amp;&amp;
      if{
        0 (&gt;L:FA18TB_AFlaps_to_Set,number)
        }
      }

<!-- set new Flaps pos -->
    (L:FA18TB_AFlaps_to_Set,number) (L:FA18TB_AFlaps_Prev_Set,number) !=
    if{
      (L:FA18TB_AFlaps_to_Set,number) 1820 * (&gt;K:FLAPS_SET)
      (L:FA18TB_AFlaps_to_Set,number) (&gt;L:FA18TB_AFlaps_Prev_Set,number)
      }
    </Value>
  </Select>
</Element> 
</Gauge>
 
Last edited:
I also wrote a variablen test gauge to see what happens.

Code:
<Gauge Name="FA-18TB_Autoflaps_Debug.xml" >

<Comment>
      %A:FLAPS HANDLE INDEX,num\t%((A:FLAPS HANDLE INDEX,number))%!7.2f!\tNum\n
      %A:FLAPS HANDLE INDEX,num 1820 * \t%((A:FLAPS HANDLE INDEX,number) 1820 * )%!7.2f!\tNum\n

      %A:FLAPS NUM HANDLE POSITIONS,num\t%((A:FLAPS NUM HANDLE POSITIONS,number))%!7.2f!\tNum\n
</Comment>

<Update Frequency="18"/>

<Element Name="Background">
  <Rectangle Width="196" Height="290" FillColor="#4A525A" Color="GRAY" LineWidth="1.5" Luminous="Yes"/>
</Element>


<!-- output -->
  <Element>
    <Position X="6" Y="12"/>
    <FormattedText X="220" Y="404" Bright="Yes" Font="arial"
         Tabs="0,140R,163L" Color="blck" FontSize="10.0" Adjust="left" >
    <Color Value="orange"/>
    <String>
      %A:FLAPS HANDLE INDEX,num\t%((A:FLAPS HANDLE INDEX,number))%!7.2f!\tNum\n
      %\n
      %A:INCIDENCE ALPHA,Deg\t%((A:INCIDENCE ALPHA,Degrees))%!7.2f!\tDeg\n
      %A:TRAILING EDGE FLAPS LEFT ANGLE,Deg\t%((A:TRAILING EDGE FLAPS LEFT ANGLE,Degrees))%!7.2f!\tDeg\n
      %\n
      %A:AIRSPEED MACH,Mach\t%((A:AIRSPEED MACH,Mach))%!7.2f!\tMach\n
      %A:AIRSPEED INDICATED,knots\t%((A:AIRSPEED INDICATED,knots))%!7.2f!\tkts\n
      %\n
      %A:GEAR TOTAL PCT EXTENDED,perc\t%((A:GEAR TOTAL PCT EXTENDED,percent) 100 *)%!7.2f!\tperc\n
      %\n
      %L:FA18TB_Autoflaps_is_ON,bool\t%((L:FA18TB_Autoflaps_is_ON,bool))%!7.2f!\tBool\n
      %\n
      %L:FLAPS_Handle_Index,num\t%((L:FLAPS_Handle_Index,number))%!7.2f!\tNum\n
      %L:FA18TB_FlapsLever_by_Key,num\t%((L:FA18TB_FlapsLever_by_Key,number))%!7.2f!\tNum\n
      %\n
      %L:FA18TB_AFlaps_to_Set,num\t%((L:FA18TB_AFlaps_to_Set,number))%!7.2f!\tNum\n
      %L:FA18TB_AFlaps_Prev_Set,num\t%((L:FA18TB_AFlaps_Prev_Set,number))%!7.2f!\tNum\n
      %\n
      %\n
      %A:FLAPS HANDLE INDEX,num 1820 * \t%((A:FLAPS HANDLE INDEX,number) 1820 * )%!7.2f!\tNum\n
      %Count the proper Flapsetting,num\t%(16384 (A:FLAPS NUM HANDLE POSITIONS,number) / (A:FLAPS HANDLE INDEX,number) *)%!7.2f!\tNum\n

    </String>
    </FormattedText>
  </Element>
</Gauge>

gaugexx=Falcon!FA-18TB_Autoflaps_Debug, 30, 30, 230, 230

edi
 
Edi,

I had a chance to try your coding last night. I must say it works quite well. Thanks. I do have some observations and questions for you though.

The first has to do with the flaps indication in the cockpit...
With your coding, I noticed that the flap position is not indicated in the virtual cockpit with the gear down and flaps in manual mode. I receive the "flaps in transition" indicator, but no indication of whether the flaps are in Half or Full.

When the gear is retracted and the flaps are in auto mode, the flap position indicator is indicated in the virtual cockpits and displays the flaps in the "Half" position when the flaps lower themselves to 3 degrees and "Full" for all others.

Is there a way reverse this so that the flap position indication is displayed when flaps are in manual mode and "silenced" while the flaps are operating in auto-flap mode?

Also...
One things I really like about your coding is that the auto-flap system works only when the switch is placed in "Auto". This shows me that there might be a way to disconnect the direct relation between the position of the actual flaps, the flaps switch, and the flaps indicator. This is something I've struggled with on my own version of this auto-system.
If possible, I would like for this same auto-flap system to activate and operate on the following logic:
-Below 240 KCAS & Gear down: Flap operate in auto flap mode with flap switch in "Auto". Auto-flap mode is disconnected and flaps operate in manual mode once the aircraft is below 240 KCAS, gear is down, and flap position is in either "Half" position or "Full. Flap Position Indicator in virtual cockpit, indicates whether the flaps are in Half (30 degrees) or in Full (45 degrees)
-Above 240 KCAS: flaps mode transitions to "auto" if not there already and operates in auto-flap mode only.

Well, that's the gist of it. Thanks again for your help.
-
 
I have already written...

Do make the flapslever in your F18 work you can adapt my gauge by yourself or you have to tell me the name of the variable which controlls the flapslever.

I own the FSX but i havn't installed it!!!! The simpliest way would be you send me the gauges.
i would adapt my variables to this gauge, so the F18 - gauges would work properly.
5 minutes later...
Read your post again! maybe the F18 gauge has to be changed.
But at all it 's not a real problem. As already said, it was expected.

-Below 240 KCAS & Gear down: Flap operate in auto flap mode with flap switch in "Auto". Auto-flap mode is disconnected and flaps operate in manual mode once the aircraft is below 240 KCAS, gear is down, and flap position is in either "Half" position or "Full. Flap Position Indicator in virtual cockpit, indicates whether the flaps are in Half (30 degrees) or in Full (45 degrees)


Sorry, i don't understand it really.
ex. take off flaps 30 airborne gear up flaps up by pilot and then autoflaps on??

this could be adapted here

Code:
<!-- Switch Autoflap On -->
    (L:FA18TB_Autoflaps_is_ON,bool) !
    (A:AIRSPEED INDICATED,knots) 240 &gt;
    (L:FA18TB_FlapsLever_by_Key,number) 0 == 
    (A:GEAR TOTAL PCT EXTENDED,percent) 0.9 &lt;       <!-- Gear is going up -->
    &amp;&amp;
    &amp;&amp;
    &amp;&amp;
    if{
      1 (&gt;L:FA18TB_Autoflaps_is_ON,bool)             <!-- Autoflap is ON -->
      }

<!-- Switch Autoflap Off -->
    (L:FA18TB_Autoflaps_is_ON,bool)
    (A:AIRSPEED INDICATED,knots) 240 &lt;
    (A:GEAR TOTAL PCT EXTENDED,percent) 0.1 &gt;        <!-- Gear is going down -->
    &amp;&amp;
    &amp;&amp;
    if{
      0 (&gt;L:FA18TB_Autoflaps_is_ON,bool)             <!-- Autoflap is OFF -->
      }

edi
 
Thanks again for all the help guys...I have another quick question....

I am currently working on changes to the .air file. I am using Aired to make changes and I know how to change values in some of the charts. I do not, however, know how to actually ADD OR SUBTRACT COLUMNS from some of these charts so that extra data points can be added or deleted. Does anyone know how to do this?
 
I believe the tables are fixed in size? (i.e. no inserting or deleting). If you don't need a column, you make it the same as (or proportional between) the adjoining points.

I do know there are many tables that people would dearly love more columns!
 
Back
Top