Hi fellow builders,

finally I managed to get my real Gables transponder working.

The transponder originally has one common lead for all inputs (i.e. 18 inputs) which I wanted to connect to OpenCockpits cards. However, since they can only handle 9 commonly connected inputs, I did what I usually try to avoid as much as possible: following Nico Kaan's suggestion I separated (= cut) some of the the commonly connected inputs (if I manage to upload the pictures they will be there...see picture, blue and lower red arrow) and soldered new ground where needed (red arrows). Actually, that was my first time soldering (after a few test solders with some cables).
I have sacrificed backlighting, since that uses 28 V and I don't want to take any risks of 24 V floating around close to my OC cards.

Each numer is encoded by three inputs: one encodes uneven numbers, one encodes "high" numbers (4-7) and one encodes "2, 3, 6, 7".

Until now I have written the SIOC script for the Squawk code. For the rest of the inputs (Ident, Standby etc) I will check if there are FSUIPC offsets for Squawkbox, otherwise I will try to address them for VATSIM flying via virtual joysticks. The flashing green light will probably be switched va a relais, since my Output cards are at 24V to drive my Korrys.

Here is the SIOC code - it's great to see the numbers in the sim change with the Tx.



Var 3400, name FI_XPDR Link FSUIPC_OUT Offset $0354 Length 2 // FSUIPC Transponder Code
Var 3401, name XPDRCode
{
&FI_XPDR = TOBCD &XPDRCode
}
Var 3402, name TxDigit1
{
CALL &CalculateTxSub
}
Var 3403, name TxDigit10
{
CALL &CalculateTxSub
}
Var 3404, name TxDigit100
{
CALL &CalculateTxSub
}
Var 3405, name TxDigit1000
{
CALL &CalculateTxSub
}



Var 3410, name TxSingleUneven, Link IOCARD_SW, Device 1, Input 268
{
CALL &TxSingle_Sub
}
Var 3411, name TxSingleHigh, Link IOCARD_SW, Device 1, Input 267
{
CALL &TxSingle_Sub
}
Var 3412, name TxSingleDouble, Link IOCARD_SW, Device 1, Input 269
{
CALL &TxSingle_Sub
}
Var 3413, name Tx10Uneven, Link IOCARD_SW, Device 1, Input 265
{
CALL &Tx10_Sub
}
Var 3414, name Tx10High, Link IOCARD_SW, Device 1, Input 264
{
CALL &Tx10_Sub
}
Var 3415, name Tx10Double, Link IOCARD_SW, Device 1, Input 266
{
CALL &Tx10_Sub
}
Var 3416, name Tx100Uneven, Link IOCARD_SW, Device 1, Input 259
{
CALL &Tx100_Sub
}
Var 3417, name Tx100High, Link IOCARD_SW, Device 1, Input 260
{
CALL &Tx100_Sub
}
Var 3418, name Tx100Double, Link IOCARD_SW, Device 1, Input 258
{
CALL &Tx100_Sub
}
Var 3419, name Tx1000Uneven, Link IOCARD_SW, Device 1, Input 263
{
CALL &Tx1000_Sub
}
Var 3420, name Tx1000High, Link IOCARD_SW, Device 1, Input 262
{
CALL &Tx1000_Sub
}
Var 3421, name Tx1000Double, Link IOCARD_SW, Device 1, Input 261
{
CALL &Tx1000_Sub
}


// ******************** TX Subroutines
Var 7101, name TxSingle_Sub, Link SUBRUTINE
{
IF &TxSingleUneven = 1 // If Transponder Single Number is Uneven
{
IF &TxSingleHigh = 1 // If Transponder Single Number is High (4-7)
{
IF &TxSingleDouble = 1 // If Transponder Single Number is 2/3 or 6/7
{
&TxDigit1 = 7
}
ELSE
{
&TxDigit1 = 5
}
}
ELSE // If Transponder Single Number is NOT High (0-3)
{
IF &TxSingleDouble = 1 // If Transponder Single Number is 2/3 or 6/7
{
&TxDigit1 = 3
}
ELSE
{
&TxDigit1 = 1
}
}
}
ELSE // If Transponder Single Number is Even
{
IF &TxSingleHigh = 1 // If Transponder Single Number is High (4-7)
{
IF &TxSingleDouble = 1 // If Transponder Single Number is 2/3 or 6/7
{
&TxDigit1 = 6
}
ELSE
{
&TxDigit1 = 4
}
}
ELSE // If Transponder Single Number is NOT High (0-3)
{
IF &TxSingleDouble = 1 // If Transponder Single Number is 2/3 or 6/7
{
&TxDigit1 = 2
}
ELSE
{
&TxDigit1 = 0
}
}
}
}
Var 7102, name Tx10_Sub, Link SUBRUTINE
{
IF &Tx10Uneven = 1 // If Transponder 10 Number is Uneven
{
IF &Tx10High = 1 // If Transponder 10 Number is High (4-7)
{
IF &Tx10Double = 1 // If Transponder 10 Number is 2/3 or 6/7
{
&TxDigit10 = 7
}
ELSE
{
&TxDigit10 = 5
}
}
ELSE // If Transponder 10 Number is NOT High (0-3)
{
IF &Tx10Double = 1 // If Transponder 10 Number is 2/3 or 6/7
{
&TxDigit10 = 3
}
ELSE
{
&TxDigit10 = 1
}
}
}
ELSE // If Transponder 10 Number is Even
{
IF &Tx10High = 1 // If Transponder 10 Number is High (4-7)
{
IF &Tx10Double = 1 // If Transponder 10 Number is 2/3 or 6/7
{
&TxDigit10 = 6
}
ELSE
{
&TxDigit10 = 4
}
}
ELSE // If Transponder 10 Number is NOT High (0-3)
{
IF &Tx10Double = 1 // If Transponder 10 Number is 2/3 or 6/7
{
&TxDigit10 = 2
}
ELSE
{
&TxDigit10 = 0
}
}
}
}

Var 7103, name Tx100_Sub, Link SUBRUTINE
{
IF &Tx100Uneven = 1 // If Transponder 100 Number is Uneven
{
IF &Tx100High = 1 // If Transponder 100 Number is High (4-7)
{
IF &Tx100Double = 1 // If Transponder 100 Number is 2/3 or 6/7
{
&TxDigit100 = 7
}
ELSE
{
&TxDigit100 = 5
}
}
ELSE // If Transponder 100 Number is NOT High (0-3)
{
IF &Tx100Double = 1 // If Transponder 100 Number is 2/3 or 6/7
{
&TxDigit100 = 3
}
ELSE
{
&TxDigit100 = 1
}
}
}
ELSE // If Transponder 100 Number is Even
{
IF &Tx100High = 1 // If Transponder 100 Number is High (4-7)
{
IF &Tx100Double = 1 // If Transponder 100 Number is 2/3 or 6/7
{
&TxDigit100 = 6
}
ELSE
{
&TxDigit100 = 4
}
}
ELSE // If Transponder 100 Number is NOT High (0-3)
{
IF &Tx100Double = 1 // If Transponder 100 Number is 2/3 or 6/7
{
&TxDigit100 = 2
}
ELSE
{
&TxDigit100 = 0
}
}
}
}
Var 7104, name Tx1000_Sub, Link SUBRUTINE
{
IF &Tx1000Uneven = 1 // If Transponder 1000 Number is Uneven
{
IF &Tx1000High = 1 // If Transponder 1000 Number is High (4-7)
{
IF &Tx1000Double = 1 // If Transponder 1000 Number is 2/3 or 6/7
{
&TxDigit1000 = 7
}
ELSE
{
&TxDigit1000 = 5
}
}
ELSE // If Transponder 1000 Number is NOT High (0-3)
{
IF &Tx1000Double = 1 // If Transponder 1000 Number is 2/3 or 6/7
{
&TxDigit1000 = 3
}
ELSE
{
&TxDigit1000 = 1
}
}
}
ELSE // If Transponder 1000 Number is Even
{
IF &Tx1000High = 1 // If Transponder 1000 Number is High (4-7)
{
IF &Tx1000Double = 1 // If Transponder 1000 Number is 2/3 or 6/7
{
&TxDigit1000 = 6
}
ELSE
{
&TxDigit1000 = 4
}
}
ELSE // If Transponder 1000 Number is NOT High (0-3)
{
IF &Tx1000Double = 1 // If Transponder 1000 Number is 2/3 or 6/7
{
&TxDigit1000 = 2
}
ELSE
{
&TxDigit1000 = 0
}
}
}
}
Var 7105, name CalculateTxSub Link SUBRUTINE
{
L0 = &TxDigit10 * 10
L1 = &TxDigit100 * 100
L2 = L0 + L1
L0 = L2 + &TxDigit1
L1 = &TxDigit1000 * 1000
&XPDRCode = L0 + L1
}