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

FSX Auto Flaps

Messages
11
Country
us-pennsylvania
Was messing around with an xml gauge, but it doesn't seem to work. Was hoping the experts here could chime in and help this rookie xml guy.

Here is my code:

<Gauge Name="Autoflaps" Version="1.0">
<Element>
<Update Frequency="1"/>
(A:RADIO HEIGHT,feet)1000 &lt; (A:RADIO HEIGHT,feet)5 &gt; &amp;&amp;
if {
100 (&gt; K:FLAPS HANDLE, Percent)
1 (&gt; K:LIGHT STROBE, bool)
1 (&gt; K:SMOKE ENABLE, bool)
}
(A:RADIO HEIGHT,feet)5 &lt;
if {
0 (&gt; K:FLAPS HANDLE, Percent)
0 (&gt; K:LIGHT STROBE, bool)
0 (&gt; K:SMOKE ENABLE, bool)
}
</Update>
</Element>
</Gauge>

Basically, I want the flaps, strobe, and smoke to automatically turn on below 5,000 feet and then turn off at 5 feet.

Thanks in advance for any advice.

Scott
 
I may be wrong, but I can't find those key events in the SDK. For example the SDK gives

KEY_FLAPS_UP
KEY_FLAPS_1
KEY_FLAPS_2
KEY_FLAPS_3
KEY_FLAPS_DOWN
KEY_FLAPS_INCR
KEY_FLAPS_DECR
 
Also:
KEY_AXIS_FLAPS_SET, Sets flap handle to closest increment (-16383 - +16383)
KEY_FLAPS_SET, Sets flap handle to closest increment (0 to 16383)
 
Thanks for the responses. I looked in the Key Commands list for xml gauges and found the flaps ones referenced above and the ones for strobes and smoke. So here is the latested version:

<Gauge Name="Autoflaps" Version="1.0">
<Element>

<Update Frequency="1"/>
(A:RADIO HEIGHT,feet)1000 &lt; (A:RADIO HEIGHT,feet)5 &gt; &amp;&amp;
if {
(&gt; K:FLAPS_DOWN)
(&gt; K:STROBES_ON)
(&gt; K:SMOKE_ON)
}
(A:RADIO HEIGHT,feet)5 &lt;
if {
(&gt; K:FLAPS_UP)
(&gt; K:STROBES_OFF)
(&gt; K:SMOKE_OFF)
}
</Update>
</Element>
</Gauge>

If anyone sees anything wrong with the code, please chime in. Thanks again for the suggestions. I will test this out tonight, along with any other suggestions.
 
You should do some checks of the current state of all your controls before firing them otherwise you will have constant firing which will cause problems during multiplayer sessions amongst a plethora of other non-multiplayer problems..

Ex. If strobes are on and need to be off -

(A:LIGHT STROBE, bool) if{ (&gt; K:STROBES_OFF) }

If strobes are off and need to be on -

(A:LIGHT STROBE, bool) ! if{ (&gt; K:STROBES_ON) }

Etc.. Follow the above for each of the different controls you may be using.
 
I may be wrong, but I can't find those key events in the SDK. For example the SDK gives

Gerry, anything with a KEY_ prefix in the SDK is the C equivalent of the XML command...

...which are charmingly mislabled in the SDK as "SimConnect" events. :rolleyes:
 
If anyone sees anything wrong with the code, please chime in. Thanks again for the suggestions. I will test this out tonight, along with any other suggestions.

Yes, just remove both <Element> and </Element> and, good or bad, at least should work ...:)

Tom
 
Nice collection of xlm space traps ;)
Missing space that kills...
Space too much that kills...

Code:
<Gauge Name="Autoflaps" Version="1.0">
[B][COLOR="Red"]<Element> -> Delete[/COLOR][/B]
<Update Frequency="1"/>
(A:RADIO HEIGHT,feet)[B][COLOR="red"](add space)[/COLOR][/B]1000 &lt; 
(A:RADIO HEIGHT,feet)[B][COLOR="red"](add space)[/COLOR][/B]5 &gt; &amp;&amp;
[B][COLOR="Red"]if(no space here){ [/COLOR][/B]100 (&gt;[B][COLOR="Red"](no space here?)[/COLOR][/B]K:FLAPS HANDLE, Percent)
1 (&gt;[B][COLOR="Red"](no space here?)[/COLOR][/B]K:LIGHT STROBE, bool)
1 (&gt;[B][COLOR="Red"](no space here?)[/COLOR][/B]K:SMOKE ENABLE, bool)
}
(A:RADIO HEIGHT,feet)[B][COLOR="red"](add space)[/COLOR][/B]5 &lt;
[B][COLOR="Red"]if(no space here){ [/COLOR][/B]
0 (&gt;[B][COLOR="Red"](no space here?)[/COLOR][/B]K:FLAPS HANDLE, Percent)
0 (&gt;[B][COLOR="Red"](no space here?)[/COLOR][/B]K:LIGHT STROBE, bool)
0 (&gt;[B][COLOR="Red"](no space here?)[/COLOR][/B]K:SMOKE ENABLE, bool)
}
</Update>
[B][COLOR="Red"]</Element> -> Delete[/COLOR][/B]
</Gauge>
 
Gerry, anything with a KEY_ prefix in the SDK is the C equivalent of the XML command...

...which are charmingly mislabled in the SDK as "SimConnect" events. :rolleyes:

True, but they both are presented in the same table in which the first column is the Event ID for C gauges but the adjacent 2nd column is the String Name for SimConnect clients and XML authored gauges, followed by its description and multiplayer useage.. For example

Code:
[B]Event ID         String Name  Description                               Multiplayer [/B]
KEY_FLAPS_UP     FLAPS_UP     Sets flap handle to full retract position All aircraft

That's surely the starting point?
 
I had something similar when I was doing a flaps isolate switch to inhibit flaps use until approach.
This was the only thing that worked:-
vololiberista
Code:
[<Click>
(L:flaps_isol_switch,bool) 0 == [COLOR="Red"](A:TRAILING EDGE FLAPS0 LEFT PERCENT, percent) 1 &lt;[/COLOR] and
if{
1 (&gt;L:flaps_isol_switch,bool)
1 (>L:Flaps_Inhibit,bool) (P:local time, seconds) 2.80 + (>L:flapss,number) (P:local time, seconds) 1.50 + (>L:slatss,number) (P:local time, seconds) 3.15 + (>L:flapwarn,number)
}
els{
0 (&gt;L:flaps_isol_switch,bool)
0 (>L:Flaps_Inhibit,bool)
1 (>L:Sound_button,enum)
}
1 (>L:Sound_button,enum) (P:local time, seconds) 2.80 + (>L:flapss,number) (P:local time, seconds) 1.50 + (>L:slatss,number)
</Click>/CODE]
 
Nice collection of xlm space traps ;)
Missing space that kills...
Space too much that kills...

True.
Actually a correct code should be:

Code:
<Gauge Name="Autoflaps" Version="1.0">
<Update Frequency="1"/>
(A:RADIO HEIGHT,feet) 1000 &lt; (A:RADIO HEIGHT,feet) 5 > and
if{
     (>K:FLAPS_DOWN)  
     (>K:STROBES_ON)
     (>K:SMOKE_ON)
}   
(A:RADIO HEIGHT,feet) 5 &lt; 
if{
     (>K:FLAPS_UP)
     (>K:STROBES_OFF)
     (>K:SMOKE_OFF)
}
</Update>
</Gauge>

To optimize the code test should be done for current flaps,strobes, etc situations as to avoid firing those events constantly, as advised by spokes2112 on a post below.

Tom
 
True.
Actually a correct code should be:

Code:
<Gauge Name="Autoflaps" Version="1.0">
<Update Frequency="1"/>
(A:RADIO HEIGHT,feet) 1000 &lt; (A:RADIO HEIGHT,feet) 5 > and
if{
     (>K:FLAPS_DOWN)  
     (>K:STROBES_ON)
     (>K:SMOKE_ON)
}   
(A:RADIO HEIGHT,feet) 5 &lt; 
if{
     (>K:FLAPS_UP)
     (>K:STROBES_OFF)
     (>K:SMOKE_OFF)
}
</Update>
</Gauge>

To optimize the code test should be done for current flaps,strobes, etc situations as to avoid firing those events constantly, as advised by spokes2112 on a post below.

Tom

Tom thanks for the code, however, I still can't get it to work. I have tried the other suggestions above as well with no luck. I even reduced it to just the flaps code and still no luck. Guess I am missing something somewhere along the line.
 
Tried removing the "/" in the first update, but still nothing. Maybe my panel entry is wrong, here is what I am using:

gauge00=autoflaps, 0,0,0,0

EDIT
Not sure what I did, but it is working now!!! Thanks to everyone for their helpful comments.
 
Last edited:
Back
Top