// ***************************************************************************** // * Config_SIOC ver 3.7B1 - By Manolo Vélez - www.opencockpits.com // ***************************************************************************** // * FileName : TRANSPONDER 1 ENCODERS.txt // * Date : 28/08/2009 Var 0000, Value 0 { &PUSHSTATUS = 1 } Var 0121 { CALL &XPNDRCALC } Var 0122 { CALL &XPNDRCALC } Var 0123 { CALL &XPNDRCALC } Var 0124 { CALL &XPNDRCALC } Var 0125, name XPNDRENCODER, Link IOCARD_ENCODER, Input 2, Aceleration 2, Type 2 { IF &PUSHSTATUS = 1 { CALL &INPXPNDR1 } IF &PUSHSTATUS = 2 { CALL &INPXPNDR10 } IF &PUSHSTATUS = 3 { CALL &INPXPNDR100 } IF &PUSHSTATUS = 4 { CALL &INPXPNDR1000 } } Var 0129, Link IOCARD_SW, Input 63 // VFR button { &XPNDRDISP = 7000 // VFR Code (CH 7000, USA 1200, Germany 002 &XPNDRTOFS = TOBCD &XPNDRDISP } Var 0130, name XPNDRDISP, Link IOCARD_DISPLAY, Digit 10, Numbers 4 // Display { L0 = &XPNDRDISP } Var 0131, name XPNDRTOFS, Link FSUIPC_INOUT, Offset $0354, Length 2 // XPNDR { L0 = &XPNDRDISP } Var 0132, name XPNDRIN, Value 7000 // XPNDR Input from FS Var 0133, Link FSUIPC_OUT, Offset $7B93, Length 4 // IDT button for Squawkbox Var 0134, Link IOCARD_SW, Input 62 // IDT button { V0133 = V0134 } Var 0135, name SWENCXPDR, Link IOCARD_SW, Input 23 // PUSHBUTTON OF ENCODER { IF &SWENCXPDR = 1 { &PUSHSTATUS = &PUSHSTATUS + 1 } } Var 0136, name PUSHSTATUS // STATUS OF PUSHBUTTON { IF &PUSHSTATUS > 4 { &PUSHSTATUS = 1 } } Var 0150, name XPNDRCALC, Link SUBRUTINE // Code calculation { L0 = V0121 * 1000 L1 = V0122 * 100 L0 = L0 + L1 L1 = V0123 * 10 L0 = L0 + L1 L0 = L0 + V0124 &XPNDRTOFS = TOBCD L0 &XPNDRDISP = L0 } Var 0151, name INPXPNDR1000, Link SUBRUTINE { V0121 = V0121 + &INPXPNDR1000 V0121 = ROTATE 0 ,7 ,0 } Var 0152, name INPXPNDR100, Link SUBRUTINE { V0122 = V0122 + &INPXPNDR100 V0122 = ROTATE 0 ,7 ,0 } Var 0153, name INPXPNDR10, Link SUBRUTINE { V0123 = V0123 + &INPXPNDR10 V0123 = ROTATE 0 ,7 ,0 } Var 0154, name INPXPNDR1, Link SUBRUTINE { V0124 = V0124 + &INPXPNDR1 V0124 = ROTATE 0 ,7 ,0 }