• 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 2 transponder codes

Messages
61
Country
france
I would like to know if it is possible to have 2 transponder codes an to swap them (activ/standby)

Thank you for your help.
 
Yes, it's possible. Store the standby as an L:Var then in a Mouse click, perform the swap.

(>K:XPNDR_SET) is the Key Event that sets the active transponder code, and (A:TRANSPONDER1 CODE, enum) reads the decimal value. Keep in mind that K:XPNDR_SET requires 'hexadecimal' number input.

As an XML example, this Mouse Click will swap transponder codes:

Code:
<Click>
    (A:TRANSPONDER1 CODE, enum) (>L:XpndrStdbyTemp, enum)
    '0x' (L:XpndrStdby, enum) scat (>K:XPNDR_SET)
    (L:XpndrStdbyTemp, enum) (>L:XpndrStdby, enum)
</Click>

where (A:TRANSPONDER1 CODE, enum) is the Active, and (L:XpndrStdby, enum) is the Standby.

Bob
 
Last edited:
Lesse... it's actually (A:TRANSPONDER CODE:index) and 1 is the only supported index and it's a BCO16 not an enum. While in XML all numbers are just numbers... for code readability when you have to come back to it in 5 years as well as for anyone else trying to figure out what you did... use the correct units.

Other than that... yes, you can use an L:Var to mimic having two codes available.
 
Lesse... it's actually (A:TRANSPONDER CODE:index) and 1 is the only supported index and it's a BCO16 not an enum. While in XML all numbers are just numbers... for code readability when you have to come back to it in 5 years as well as for anyone else trying to figure out what you did... use the correct units.

Other than that... yes, you can use an L:Var to mimic having two codes available.

Thank you, Ed,

Big mistakes. Let's get it right and use this instead:

Code:
<Click> 
   (A:TRANSPONDER CODE:1, Bco16) (>L:XpndrStdbyTemp, Bco16)
   (L:XpndrStdby, Bco16) (>K:XPNDR_SET)
   (L:XpndrStdbyTemp, Bco16) (>L:XpndrStdby, Bco16)
</Click>

The Standby code can be set using enum units: 1200 (>L:XpndrStdby, enum).
 
Last edited:
Although you are correct in that the SDK states that the units are BCO16, for most gauge applications Number or Enum is required to display as ASCII digits.
 
Hi Chris,

Terima kasih banyak!

I appreciate the professor pointing out mistakes in my first version ;). I really was way off. In the second version, using Bco16 units, the 4 digit code displays correctly in the stock FS Baron transponder and the codes swap as intended.

Anyway, its shorter than (L:XpndrStdby, enum) s0 10 % l0 10 / int 10 % 16 * + l0 100 / int 10 % 256 * + l0 1000 / int 4096 * + (>K:XPNDR_SET)

Getting hot down there yet?

Bob
 
Design the user input - the buttons/knobs that the pilot would use to input the transponder code. That should build the variable (L:XpndrStdby, enum) in regular decimal format. If the transponder code is supposed to be VFR 1200, then (L:XpndrStdby, enum) is '1200'.

If you are looking for examples of XML script used to mimic the buttons/knobs of transponders, then try searching in the forum for those examples.
 
Here's my Bendix-King Radio Xpndr;
You'll need to adjust the mouse areas if you're using something else.
Code:
<Gauge Name="Xpndr" Version="1.0">
<Image Name="Xpndr_Background.bmp" />

<Element>
  <Position X="64" Y="14" />
   <Text X="360" Y="28" Length="18" Fixed="Yes" Font="Quartz" Adjust="Center" VerticalAdjust="Center" Color="%('#FFFF00' '#FF8000' (L:Xpndr Ident,Bool) ?)" Bright="Yes">
    <String>%((A:TRANSPONDER CODE:1,Number))%!04d!</String>
    <Failures>
      <SYSTEM_ELECTRICAL_PANELS Action="" />
      <SYSTEM_ELECTRICAL_AVIONICS Action="" />
    </Failures>
  </Text>
</Element>

<!-- Check for button pressed -->
<Element>
  <Select>
    <Value>(E:LOCAL TIME,Seconds) (L:Timer_01,Seconds) &lt; if{ 1 (&gt;L:Button Pressed,Bool) }</Value>
  </Select>
</Element>

<!-- x000 -->
<Element>
  <Select>
    <Value>(L:Button Pressed,Bool) (L:Xpndr Digit,Number) 0 == &amp;&amp; if{ (A:TRANSPONDER1 CODE, BCO16) 4095 &amp; (* 0FFFx *) s0 (L:Xpndr Button,BCO16) 12 &lt;&lt; l0 | (&gt;K:XPNDR_SET) }</Value>
  </Select>
</Element>

<!-- 0x00 -->
<Element>
  <Select>
    <Value>(L:Button Pressed,Bool) (L:Xpndr Digit,Number) 1 == &amp;&amp; if{ (A:TRANSPONDER1 CODE, BCO16) 61695 &amp; (* F0FFx *) s0 (L:Xpndr Button,BCO16) 8 &lt;&lt; l0 | (&gt;K:XPNDR_SET) }</Value>
  </Select>
</Element>

<!-- 00x0 -->
<Element>
  <Select>
    <Value>(L:Button Pressed,Bool) (L:Xpndr Digit,Number) 2 == &amp;&amp; if{ (A:TRANSPONDER1 CODE, BCO16) 65295 &amp; (* FF0Fx *) s0 (L:Xpndr Button,BCO16) 4 &lt;&lt; l0 | (&gt;K:XPNDR_SET) }</Value>
  </Select>
</Element>

<!-- 000x -->
<Element>
  <Select>
    <Value>(L:Button Pressed,Bool) (L:Xpndr Digit,Number) 3 == &amp;&amp; if{ (A:TRANSPONDER1 CODE, BCO16) 65520 &amp; (* FFF0x *) s0 (L:Xpndr Button,BCO16) l0 | (&gt;K:XPNDR_SET) }</Value>
  </Select>
</Element>

<!-- Digit Loop, reset timer & button -->
<Element>
  <Select>
    <Value>(L:Button Pressed,Bool) if{ (L:Xpndr Digit,Number) 1 + 4 % (&gt;L:Xpndr Digit,Number) (E:LOCAL TIME,Seconds) (&gt;L:Timer_01,Seconds) 0 (&gt;L:Button Pressed,Bool) }</Value>
  </Select>
</Element>

<!-- Reset Ident -->
<Element>
  <Select>
    <Value>(E:LOCAL TIME,Seconds) (L:Timer_02,Seconds) &gt; if{ 0 (&gt;L:Xpndr Ident,Bool) }</Value>
  </Select>
</Element>

<Mouse>
  <Tooltip ID="TOOLTIPTEXT_TRANSPONDER_ID" />
<!-- VFR Button -->
  <Area Top="62" Bottom="74" Left="226" Right="246">
    <Tooltip>Set Transponder to 1200</Tooltip>
    <Cursor Type="Hand"/>
    <Click>4608 (&gt;K:XPNDR_SET)</Click>
  </Area>
<!-- 1000 Digit -->
  <Area Top="10" Bottom="27" Left="65" Right="80">
     <Cursor Type="UpArrow"/>
    <Click Repeat="Yes">(&gt;K:XPNDR_1000_INC)</Click>
  </Area>
  <Area Top="28" Bottom="45" Left="65" Right="80">
     <Cursor Type="DownArrow"/>
    <Click Repeat="Yes">(&gt;K:XPNDR_1000_DEC)</Click>
  </Area>
<!-- 100 Digit -->
  <Area Top="10" Bottom="27" Left="85" Right="100">
     <Cursor Type="UpArrow"/>
    <Click Repeat="Yes">(&gt;K:XPNDR_100_INC)</Click>
  </Area>
  <Area Top="28" Bottom="45" Left="85" Right="100">
     <Cursor Type="DownArrow"/>
    <Click Repeat="Yes">(&gt;K:XPNDR_100_DEC)</Click>
  </Area>
<!-- 10 Digit -->
  <Area Top="10" Bottom="27" Left="105" Right="120">
     <Cursor Type="UpArrow"/>
    <Click Repeat="Yes">(&gt;K:XPNDR_10_INC)</Click>
  </Area>
  <Area Top="28" Bottom="45" Left="105" Right="120">
     <Cursor Type="DownArrow"/>
    <Click Repeat="Yes">(&gt;K:XPNDR_10_DEC)</Click>
  </Area>
<!-- 1 Digit -->
  <Area Top="10" Bottom="27" Left="125" Right="140">
     <Cursor Type="UpArrow"/>
    <Click Repeat="Yes">(&gt;K:XPNDR_1_INC)</Click>
  </Area>
  <Area Top="28" Bottom="45" Left="125" Right="140">
     <Cursor Type="DownArrow"/>
    <Click Repeat="Yes">(&gt;K:XPNDR_1_DEC)</Click>
  </Area>
<!-- Button 0 -->
  <Area Top="60" Bottom="72" Left="10" Right="28">
     <Cursor Type="Hand"/>
    <Click>0 (&gt;L:Xpndr Button,BCO16) (E:LOCAL TIME,Seconds) 3 + (&gt;L:Timer_01,Seconds)</Click>
  </Area>
<!-- Button 1 -->
  <Area Top="60" Bottom="72" Left="33" Right="50">
     <Cursor Type="Hand"/>
    <Click>1 (&gt;L:Xpndr Button,BCO16) (E:LOCAL TIME,Seconds) 3 + (&gt;L:Timer_01,Seconds)</Click>
  </Area>
<!-- Button 2 -->
  <Area Top="60" Bottom="72" Left="55" Right="72">
     <Cursor Type="Hand"/>
    <Click>2 (&gt;L:Xpndr Button,BCO16) (E:LOCAL TIME,Seconds) 3 + (&gt;L:Timer_01,Seconds)</Click>
  </Area>
<!-- Button 3 -->
  <Area Top="60" Bottom="72" Left="77" Right="94">
     <Cursor Type="Hand"/>
    <Click>3 (&gt;L:Xpndr Button,BCO16) (E:LOCAL TIME,Seconds) 3 + (&gt;L:Timer_01,Seconds)</Click>
  </Area>
<!-- Button 4 -->
  <Area Top="60" Bottom="72" Left="99" Right="116">
     <Cursor Type="Hand"/>
    <Click>4 (&gt;L:Xpndr Button,BCO16) (E:LOCAL TIME,Seconds) 3 + (&gt;L:Timer_01,Seconds)</Click>
  </Area>
<!-- Button 5 -->
  <Area Top="60" Bottom="72" Left="121" Right="138">
     <Cursor Type="Hand"/>
    <Click>5 (&gt;L:Xpndr Button,BCO16) (E:LOCAL TIME,Seconds) 3 + (&gt;L:Timer_01,Seconds)</Click>
  </Area>
<!-- Button 6 -->
  <Area Top="60" Bottom="72" Left="143" Right="160">
     <Cursor Type="Hand"/>
    <Click>6 (&gt;L:Xpndr Button,BCO16) (E:LOCAL TIME,Seconds) 3 + (&gt;L:Timer_01,Seconds)</Click>
  </Area>
<!-- Button 7 -->
  <Area Top="60" Bottom="72" Left="165" Right="182">
     <Cursor Type="Hand"/>
    <Click>7 (&gt;L:Xpndr Button,BCO16) (E:LOCAL TIME,Seconds) 3 + (&gt;L:Timer_01,Seconds)</Click>
  </Area>
<!-- Button Clear -->
  <Area Top="60" Bottom="72" Left="189" Right="208">
     <Cursor Type="Hand"/>
    <Click>0 (&gt;L:Xpndr Digit,Number)</Click>
  </Area>
<!-- Button Ident -->
  <Area Top="15" Bottom="30" Left="5" Right="25">
    <Tooltip>Ident</Tooltip>
    <Cursor Type="Hand"/>
    <Click>1 (&gt;L:Xpndr Ident,Bool) (E:LOCAL TIME,Seconds) 3 + (&gt;L:Timer_02,Seconds)</Click>
  </Area>
<!-- Button Switch -->
  <Area Top="34" Bottom="45" Left="5" Right="25">
    <Tooltip>Switch Frequencies</Tooltip>
    <Cursor Type="Hand"/>
    <Click>(A:TRANSPONDER CODE:1,Number) (&gt;L:XpndrStdbySwap,Enum) '0x' (L:XpndrStdby,Enum) scat (&gt;K:XPNDR_SET) (L:XpndrStdbySwap,Enum) (&gt;L:XpndrStdby,Enum)</Click>
  </Area>
</Mouse>

</Gauge>
 
Back
Top