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

KT76C transponder

Messages
118
Country
israel
Hi,

I would like to develop KT76C transponder like this:

317P0vhX-OL.jpg


and I dont know how to code 8 keyboard and clr btn for set transponder code...

does anyone knows ?
 
Use 4 L vars for the for digits of the code that were entered.
They are kept there until all 4 are entered.
Then they are combined and loaded into the active code.

Use another L var to keep track of the transponder's input state.
Based on that you control what is shown on the display.
State 0: nothing is being entered, display active code
State 1: digit 1 is being entered, display cursor at digit 1
State 2: digit 2 is being entered, display cursor at digit 2 and digit 1
State 3: digit 3 is being entered, display cursor at digit 3 and digit 1 and 2
State 4: digit 4 is being entered, display cursor at digit 4 and digit 1, 2 and 3

The numbered buttons do different things depending on the state.
State 0: number of button pressed is loaded into digit 1, state is set to 2
State 1: number of button pressed is loaded into digit 1, state is set to 2
State 2: number of button pressed is loaded into digit 2, state is set to 3
State 3: number of button pressed is loaded into digit 3, state is set to 4
State 4: number of button pressed is loaded into digit 4, digits are combined and loaded into active code, state is set to 0
(state 1 is skipped as the code entry starts by entering the first digit.)

The CLR button will set the state to 0.
The VFR button loads 1200 into active code and sets the state to 0.
 
Last edited:
This is the default Bendix King Transponder. You can dig the button code out of it.

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,BCO 16) 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,BCO 16) 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,BCO 16) 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,BCO 16) 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,BCO 16) (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,BCO 16) (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,BCO 16) (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,BCO 16) (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,BCO 16) (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,BCO 16) (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,BCO 16) (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,BCO 16) (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">
    <Cursor Type="Hand"/>
    <Click>1 (&gt;L:Xpndr Ident,Bool) (E:LOCAL TIME,Seconds) 3 + (&gt;L:Timer_02,Seconds)</Click>
  </Area>
</Mouse>

</Gauge>
 
Back
Top