Results 1 to 9 of 9
  1. #1
    300+ Forum Addict XOrionFE's Avatar
    Join Date
    Jan 2008
    Location
    Sugar Grove, IL
    Posts
    307
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    SIOC code issues - Can someone take a look?

    I have been modifying existing sioc script for use with the Learjet45. I am having a strange problem I cannot figure out but suspect it has to do with the inputs. Most of my switches (except for lights) are AML21s which can be setup as latching toggles (push in On, push again Off) or as Momentary if I remove a spring clip. In this code I have Battery setup as a momentary, Avionics is a toggle. Gear lever is a toggle switch (ON-OFF SPST)

    1. All of the leds on my mcp (fgc) are lit at startup and turn off when I press the buttons for each (I am using momentary switches from OC which are the same ones used in their MCP modules)

    2. My red landing gear transit lights are on when I start up and should be off.

    3. I have some toggle switches that are three position, ON-OFF-ON that I am trying to use for my Taxi and Light switch. In the Learjet when the switch is down the landing and taxi are off. In middle position just the Taxi Light will be on and in Up position the Landing Gear lights will be on. How can I code this if it is even possible.

    I have USB Expansion with 1 master card, 2 inputs breakouts, 1 outputs breakout and in addition I have a seperate Outputs card (not utilized in this code yet). All outputs are currently driven off the master card.

    Thanks for looking....

    Here is my current code:

    Var 0000, Value 0 // Initialize inputs

    {

    &BatteryStatus = 0 // BatteryStatus OFF

    }



    Var 0002, name BatteryStatus, Link FSUIPC_INOUT, Offset $3102, Length 1 // BATT on/off



    Var 0003, name BatterySW, Link IOCARD_SW, Input 11, Type P // BatteryStatus input

    {

    IF &BatterySW = 1

    {

    &BatteryStatus = 1 // FS BatteryStatus ON

    &AvionicPwrStat = 0 // Avionics OFF

    &GreenLEDNose = 1 // Nose Gear Light ON

    &GreenLEDRight = 1 // Right Gear Light ON

    &GreenLEDLeft = 1 // Left Gear Light ON

    &RedGearLED = 0 // Gear Transit LEDs OFF

    &O_AP = 0 // Autopilot LED OFF

    }

    ELSE

    {

    &BatteryStatus = 0 // FS BatteryStatus OFF

    &GreenLEDNose = 0 // Nose Gear Light OFF

    &GreenLEDRight = 0 // Right Gear Light OFF

    &GreenLEDLeft = 0 // Left Gear Light OFF

    &AP_MASTER_SW = 0 // Autopilot Master OFF

    &RedGearLED = 0 // Gear Transit LEDs OFF

    &O_AP = 0 // Autopilot LED OFF

    }

    }



    Var 0004, name AvionicPwrStat, Link FSUIPC_INOUT, Offset $3103, Length 1 // Offset AVIONIC POWER



    Var 0005, name AvionicPwrSW, Link IOCARD_SW, Input 0 // Avionic power switch

    {

    IF &AvionicPwrSW = 1

    {

    &AvionicPwrStat = 1

    }

    ELSE

    {

    &AvionicPwrStat = 0

    }

    }



    Var 0011, name EngineType, Link FSUIPC_INOUT, Offset $0609, Length 1 // Engine Type 0=Piston, 1=Jet



    Var 0006, name Engine1Start, Link FSUIPC_INOUT, Offset $0892, Length 2 // Offset ENGINE_1_START



    Var 0007, name CombustionFlag, Link FSUIPC_INOUT, Offset $0894, Length 2 // Combustion Flag



    Var 0008, name Engine1StartSW, Link IOCARD_SW, Input 45, Type P // L_Engine START

    {

    IF &EngineType = 0 // Engine is Piston

    {

    IF &Engine1StartSW = 1 // Starter Switch is ON

    {

    IF &CombustionFlag = 0 // Combustion flag = FALSE

    {

    &Engine1Start = 4 // Set ENGINE_1 to START

    }

    ELSE

    {

    &Engine1Start = 3 // Engine_1 Starter to BOTH

    }

    }

    ELSE

    {

    IF &CombustionFlag = 1 // Combustion flag = TRUE

    {

    &Engine1Start = 3 // Starter remains on BOTH

    }

    ELSE

    {

    &Engine1Start = 0

    }

    }

    }

    ELSE

    {

    &Engine1Start = &Engine1StartSW // ENGINE_1 Off/On with switch

    }

    }



    Var 0010, name Gen1Status, Link FSUIPC_INOUT, Offset $3B78, Length 2 // Offset GEN_1



    Var 0012, name Generator1SW, Link IOCARD_SW, Input 7, Type P // GEN_1

    {

    IF &Generator1SW = 1

    {

    &Gen1Status = 1

    }

    ELSE

    {

    &Gen1Status = 0

    }

    }



    Var 0014, name Engine2Start, Link FSUIPC_INOUT, Offset $092A, Length 2 // Offset ENGINE_2_START



    Var 0016, name Engine2StartSW, Link IOCARD_SW, Input 49, Type P // R_Engine START

    {

    IF &Engine2StartSW = 1

    {

    &Engine2Start = 4

    }

    ELSE

    {

    &Engine2Start = 0

    }

    }



    Var 0018, name Gen2Status, Link FSUIPC_INOUT, Offset $3AB8, Length 2 // Offset GEN_2



    Var 0020, name Generator2SW, Link IOCARD_SW, Input 9, Type P // GEN_2

    {

    IF &Generator2SW = 1

    {

    &Gen2Status = 1

    }

    ELSE

    {

    &Gen2Status = 0

    }

    }



    Var 0022, name NAC1HeatStatus, Link FSUIPC_INOUT, Offset $08B2, Length 2 // Offset ANTI_ICE-NAC Heat ENGINE 1



    Var 0024, name NAC1HeatSW, Link IOCARD_SW, Input 23 // ANTI_ICE-NAC Heat ENG_1

    {

    IF &NAC1HeatSW = 1

    {

    &NAC1HeatStatus = 1

    }

    ELSE

    {

    &NAC1HeatStatus = 0

    }

    }



    Var 0026, name NAC2HeatStatus, Link FSUIPC_INOUT, Offset $094A, Length 2 // Offset ANTI_ICE-NAC Heat ENGINE 2



    Var 0028, name NAC2HeatSW, Link IOCARD_SW, Input 24 // ANTI_ICE-NAC Heat ENG_2

    {

    IF &NAC2HeatSW = 1

    {

    &NAC2HeatStatus = 1

    }

    ELSE

    {

    &NAC2HeatStatus = 0

    }

    }



    Var 0030, name ParkBrakeStat, Link FSUIPC_INOUT, Offset $0BC8, Length 2 // Offset Parking Brake



    Var 0032, name ParkingBrakeSW, Link IOCARD_SW, Input 16 // Parking Brake

    {

    IF &ParkingBrakeSW = 1

    {

    &ParkBrakeStat = 32767

    }

    ELSE

    {

    &ParkBrakeStat = 0

    }

    }




    //***************************** Lights ***********************************



    Var 0040, name Lights, Link FSUIPC_INOUT, Offset $0D0C, Length 2, Value 0 // Offset LIGHTS



    Var 0042, name LandLightSW, Link IOCARD_SW, Input 29 // LANDING ( T1+T2 ) and TAXI (T3)

    {

    &Lights = CHANGEBIT 2 ,&LandLightSW

    IF &WeightOnWheels = 1 // Plane on ground so Taxi Lights on also

    {

    &Lights = CHANGEBIT 3 ,&LandLightSW
    }

    }



    Var 0044, name TaxiLightsSW, Link IOCARD_SW, Input 30 // TAXI ( T3 )

    {

    IF &WeightOnWheels = 1 // Plane on ground

    {

    &Lights = CHANGEBIT 3 ,&TaxiLightsSW

    }

    }



    Var 0046, name NavLightsSW, Link IOCARD_SW, Input 25 // NAV ( T5 )

    {

    &Lights = CHANGEBIT 0 ,&NavLightsSW

    }



    Var 0047, name RecogLightsSW, Link IOCARD_SW, Input 26 // RECOG

    {

    &Lights = CHANGEBIT 6 ,&RecogLightsSW

    }



    Var 0048, name BeaconSW, Link IOCARD_SW, Input 28 // BEACON ( T7 )

    {

    &Lights = CHANGEBIT 1 ,&BeaconSW

    }



    Var 0050, name StrobeSW, Link IOCARD_SW, Input 27 // STROBE ( T8 )

    {

    &Lights = CHANGEBIT 4 ,&StrobeSW

    }



    Var 0052, name PitotStatus, Link FSUIPC_INOUT, Offset $029C, Length 1 // Offset PITOT



    Var 0054, name PitotSW, Link IOCARD_SW, Input 18 // PITOT Heat( T21 )

    {

    IF &PitotSW = 1

    {

    &PitotStatus = 1

    }

    ELSE

    {

    &PitotStatus = 0

    }

    }




    //***************************** Landing Gear ***********************************



    Var 0061, name LandingGear, Link FSUIPC_INOUT, Offset $0BE8, Length 4 // LED LANDING GEAR



    Var 0063, name GreenLEDNose, Link IOCARD_OUT, Output 41 // green led nose

    {

    CALL V0075

    }



    Var 0064, name GreenLEDRight, Link IOCARD_OUT, Output 43 // green led right

    {

    CALL V0085

    }



    Var 0065, name GreenLEDLeft, Link IOCARD_OUT, Output 42 // green led left

    {

    CALL V0095

    }



    Var 0067, name WeightOnWheels, Link FSUIPC_IN, Offset $0366, Length 2 // Plane on Ground? 0=Air, 1=Gnd



    Var 0066, name LandingGearSW, Link IOCARD_SW, Input 15 // LANDING GEAR SWITCH

    {

    IF &WeightOnWheels = 0 // Plane in Air, so Gear switch is active

    {

    IF &LandingGearSW = 0 // Gear switch OFF (Down)

    {

    &LandingGear = 16383 // Gear Down

    }

    ELSE

    {

    &LandingGear = 0 // Gear Up

    }

    }

    ELSE

    {

    &LandingGear = 16383 // Gear switch Disabled (Gear Down)

    }

    }



    Var 0062, name RedGearLED, Link IOCARD_OUT, Output 44 // red led GEAR in transit



    Var 0070, name NosegearPos, Link FSUIPC_IN, Offset $0BEC, Length 4 // gear nose 0=up 16383=down

    {

    CALL V0075

    }



    Var 0075, Link SUBRUTINE

    {

    IF &BatteryStatus = 0

    {

    &GreenLEDNose = 0

    }

    IF &BatteryStatus = 1

    {

    IF &NosegearPos = 16383

    {

    &GreenLEDNose = DELAY 1 ,200 // LED NOSE light approx 2s'

    &RedGearLED = 0

    }

    ELSE

    {

    IF &NosegearPos >= 1

    {

    &GreenLEDNose = 0

    &RedGearLED = 1

    }

    ELSE

    {

    IF &NosegearPos = 0

    {

    &GreenLEDNose = 0

    &RedGearLED = 0

    }

    }

    }

    }

    }



    Var 0080, name RightGearPos, Link FSUIPC_IN, Offset $0BF0, Length 4 // gear right 0=up 16383=down

    {

    CALL V0085

    }



    Var 0085, Link SUBRUTINE

    {

    IF &BatteryStatus = 0

    {

    &GreenLEDRight = 0

    }

    IF &BatteryStatus = 1

    {

    IF &RightGearPos = 16383

    {

    &GreenLEDRight = DELAY 1 ,140 // LED Right light approx 2s'

    &RedGearLED = 0

    }

    ELSE

    {

    IF &RightGearPos >= 1

    {

    &GreenLEDRight = 0

    &RedGearLED = 1

    }

    ELSE

    {

    IF &RightGearPos = 0

    {

    &GreenLEDRight = 0

    &RedGearLED = 0

    }

    }

    }

    }

    }



    Var 0090, name LeftGearPos, Link FSUIPC_IN, Offset $0BF4, Length 4 // gear left 0=up 16383=down

    {

    CALL V0095

    }



    Var 0095, Link SUBRUTINE

    {

    IF &BatteryStatus = 0

    {

    &GreenLEDLeft = 0

    }

    IF &BatteryStatus = 1

    {

    IF &LeftGearPos = 16383

    {

    &GreenLEDLeft = DELAY 1 ,120 // LED Left light approx 2s'

    &RedGearLED = 0

    }

    ELSE

    {

    IF &LeftGearPos >= 1

    {

    &GreenLEDLeft = 0

    &RedGearLED = 1

    }

    ELSE

    {

    IF &LeftGearPos = 0

    {

    &GreenLEDLeft = 0

    &RedGearLED = 0

    }

    }

    }

    }

    }


    //***************************** FGC/Autopilot Selector ***********************************
    // *******************************
    // INITIALIZATION
    // *******************************

    Var 2000, Value 0 // Initialization
    {
    &CONTADOR = 0
    &CHECK = TIMER 999,0,25
    &D_COURSE1 = 360
    &D_COURSE2 = 360
    &D_HDG = 360
    &D_ALT = 4000
    &D_VS = 0
    &T_IAS = 140
    &AP_IAS = 1
    &AP_IAS = DELAY 0,10
    &O_AP = 0
    &O_FD1 = 0
    &O_FD2 = 0
    &O_HDGSEL = 0
    &O_LNAV = 0
    &O_VNAV = 0
    &O_LVLCHG = 0
    &O_APP = 0
    &O_BNK = 0
    &O_XFR = 0
    &O_SPEED = 0
    &O_VS = 0
    &O_ALTHLD = 0
    &O_YD = 0

    }



    Var 2001, name AP_MASTER_SW Link FSUIPC_INOUT, Offset $07BC, Length 4
    {
    IF V2001 = 1
    {
    &O_AP = 1
    &APD_YD = 1
    }
    ELSE
    {
    &O_AP = 0
    &APD_YD = 0
    }
    }

    Var 2002, Link FSUIPC_INOUT, Offset $07C0, Length 4 // AP_LVL FLC
    {
    // &O_LVLCHG = TESTBIT V0002 ,0 // LED_LVL
    }

    Var 2003, Link FSUIPC_INOUT, Offset $07C4, Length 4 // AP_NAV1
    {
    IF V2003 = 1
    {
    &O_LNAV = 1
    }
    ELSE
    {
    &O_LNAV = 0
    }
    }

    Var 2004, Link FSUIPC_INOUT, Offset $07C8, Length 4 // AP_HDG_SEL
    {
    IF V2004 = 1
    {
    &O_HDGSEL = 1
    }
    ELSE
    {
    &O_HDGSEL = 0
    }
    }

    Var 2005, name APD_HDG, Link FSUIPC_INOUT, Offset $07CC, Length 2 // APD_HDG

    Var 2006, name AP_ALT, Link FSUIPC_INOUT, Offset $07D0, Length 4 // AP_ALT
    {
    IF &AP_ALT = 1
    {
    &O_VS = 1
    }
    ELSE
    {
    &O_VS = 0
    }
    }

    Var 2007, name AP_IAS, Link FSUIPC_INOUT, Offset $07DC, Length 4 // AP_IAS
    {
    IF &AP_IAS = 1
    {
    &SPEED = 1
    &O_SPEED = 1
    &F_IAS = &T_IAS
    }
    ELSE
    {
    IF &AP_MACH = 0
    {
    &O_SPEED = 0
    }
    }
    }

    Var 2008, name APD_IAS, Link FSUIPC_INOUT, Offset $07E2, Length 2 // D_IAS

    Var 2009, name APD_ALT, Link FSUIPC_INOUT, Offset $07D4, Length 4 // APD_ALT

    Var 2010, name APD_YD, Link FSUIPC_INOUT, Offset $0808, Length 4 // APD_YD
    {
    IF V2010 = 1
    {
    &O_YD = 1
    }
    ELSE
    {
    &O_YD = 0
    }
    }

    Var 2011, name AP_MACH, Link FSUIPC_INOUT, Offset $07E4, Length 4 // AP_MACH
    {
    IF &AP_MACH = 1
    {
    &SPEED = 2
    &O_SPEED = 1
    }
    ELSE
    {
    IF &AP_IAS = 0
    {
    &O_SPEED = 0
    }
    }
    }

    Var 2012, name APD_MACH, Link FSUIPC_INOUT, Offset $07E8, Length 4 // APD_MACH

    Var 2013, Link FSUIPC_INOUT, Offset $3210, Length 2 // LOCALV_IAS/M

    Var 2014, name APD_VS, Link FSUIPC_INOUT, Offset $07F2, Length 2, type 1 // D_V/S

    Var 2016, Link FSUIPC_INOUT, Offset $2EE0, Length 4 // AP_FD1
    {
    IF V2016 = 1
    {
    &O_FD1 = 1
    }
    ELSE
    {
    &O_FD1 = 0
    }
    }

    Var 2017, Link FSUIPC_INOUT, Offset $07C4, Length 4 // AP_NAV

    Var 2018, Link FSUIPC_INOUT, Offset $0800, Length 4 // AP_APP
    {
    IF V2018 = 1
    {
    &O_APP = 1
    }
    ELSE
    {
    &O_APP = 0
    }
    }

    Var 2019, Link FSUIPC_INOUT, Offset $0804, Length 4 // AP_BC

    Var 2020, Link FSUIPC_INOUT, Offset $0808, Length 4 // AP_YD

    Var 2021, name APD_COURSE1, Link FSUIPC_INOUT, Offset $0C4E, Length 2 // APD_COURSE1
    Var 2022, name APD_COURSE2, Link FSUIPC_INOUT, Offset $0C5E, Length 2 // APD_COURSE2

    Var 2023, name FS_IAS, Link FSUIPC_IN, Offset $02BC, Length 4 // IAS FS
    Var 2024, name FS_MACH, Link FSUIPC_IN, Offset $11C6, Length 2 // IAS FS
    Var 2025, Link FSUIPC_INOUT, Offset $07FC, Length 4 // AP_APP2



    // **********************
    // FUNCTIONS
    // **********************

    Var 2051, name SPEED
    {
    IF &SPEED <> 2
    {
    &F_IAS = &T_IAS
    }
    ELSE
    {
    &F_IAS = &T_MACH
    }
    }

    var 2052, name T_IAS
    var 2053, name T_MACH

    var 2054, name F_IAS
    {
    IF &SPEED <> 2
    {
    &D_IAS = &F_IAS
    &APD_IAS = DELAY &F_IAS,10
    }
    ELSE
    {
    &D_IAS = &F_IAS
    L0 = &F_IAS * 655.36
    &APD_MACH = DELAY L0, 10
    }
    }

    Var 2056, name CHECK, Link SUBRUTINE
    {
    &CONTADOR = &CONTADOR + 1
    IF &CONTADOR > 10000
    {
    &CONTADOR = 1000
    }
    ELSE
    {
    IF &CONTADOR > 4
    {
    IF &APD_VS <> &D_VS
    {
    &D_VS = &APD_VS
    }
    }
    }
    }

    Var 2057, name CONTADOR

    Var 2100, name D_COURSE1
    {
    &APD_COURSE1 = &D_COURSE1
    }
    Var 2102, name D_IAS
    Var 2104, name D_HDG
    {
    L1 = &D_HDG * 182.04444
    L0 = L1 + 1
    &APD_HDG = L0
    }
    Var 2106, name D_ALT
    {
    L0 = &D_ALT * 19975.37
    &APD_ALT = L0
    }
    Var 2108, name D_VS
    Var 2110, name D_COURSE2
    {
    &APD_COURSE2 = &D_COURSE2
    }

    // *******************
    // OUTPUTS
    // *******************
    Var 2204, name O_YD, Link IOCARD_OUT, DEVICE 0, Output 24
    Var 2206, name O_SPEED, Link IOCARD_OUT, DEVICE 0, Output 15
    Var 2208, name O_LVLCHG, Link IOCARD_OUT, DEVICE 0, Output 16
    Var 2210, name O_VNAV, Link IOCARD_OUT, DEVICE 0, Output 25
    Var 2212, name O_HDGSEL, Link IOCARD_OUT, DEVICE 0, Output 12
    Var 2214, name O_APP, Link IOCARD_OUT, DEVICE 0, Output 19
    Var 2216, name O_FD1, Link IOCARD_OUT, DEVICE 0, Output 11
    Var 2218, name O_LNAV, Link IOCARD_OUT, DEVICE 0, Output 13
    Var 2220, name O_ALTHLD, Link IOCARD_OUT, DEVICE 0, Output 17
    Var 2222, name O_VS, Link IOCARD_OUT, DEVICE 0, Output 22
    Var 2224, name O_AP, Link IOCARD_OUT, DEVICE 0, Output 14
    Var 2226, name O_FD2, Link IOCARD_OUT, DEVICE 0, Output 18
    Var 2228, name O_BNK, Link IOCARD_OUT, DEVICE 0, Output 23
    Var 2230, name O_XFR, Link IOCARD_OUT, DEVICE 0, Output 21

    // **********************************
    // ROTARY-ENCODERS
    // **********************************
    Var 2300, name E_IAS, Link IOCARD_ENCODER, DEVICE 0, Input 40, Aceleration 4, Type 2
    {
    IF &SPEED <> 2
    {
    L0 = &E_IAS * -1
    &T_IAS = LIMIT 0, 360, L0
    &F_IAS = &T_IAS
    }
    ELSE
    {
    L0 = &E_IAS * -1
    &T_MACH = LIMIT 0, 99, L0
    &F_IAS = &T_MACH
    }
    }

    Var 2302, name E_ALT, Link IOCARD_ENCODER, DEVICE 0, Input 42, Aceleration 4, Type 2
    {
    L0 = &E_ALT * -100
    &D_ALT = LIMIT 0, 50000, L0
    }
    Var 2304, name E_COURSE1, Link IOCARD_ENCODER, DEVICE 0, Input 36, Aceleration 4, Type 2
    {
    L0 = &E_COURSE1 * -1
    &D_COURSE1 = ROTATE 1, 360, L0
    }
    Var 2306, name E_HDG, Link IOCARD_ENCODER, DEVICE 0, Input 38, Aceleration 4, Type 2
    {
    L0 = &E_HDG * -1
    &D_HDG = ROTATE 1, 360, L0
    }
    Var 2308, name E_COURSE2, Link IOCARD_ENCODER, DEVICE 0, Input 52, Aceleration 4, Type 2
    {
    L0 = &E_COURSE2 * -1
    &D_COURSE2 = ROTATE 1, 360, L0
    }
    //Var 2310, name E_VS, Link IOCARD_ENCODER, DEVICE 0, Input 40, Aceleration 4, Type 2
    //{
    // L0 = &E_VS * -100
    // &D_VS = LIMIT -9000, 9000, L0
    // &CONTADOR = 0
    // &APD_VS = &D_VS
    //}

    // *********
    // SWITCHES
    // *********

    Var 2400, name I_CO, Link IOCARD_SW, DEVICE 0, Input 70, type P // PUSH IAS/M on SPD Rotary
    {
    IF &O_SPEED = 1
    {
    IF &SPEED <> 0
    {
    IF &SPEED = 1
    {
    L0 = &FS_MACH / 204.80
    &T_MACH = L0
    &AP_MACH = 1
    }
    ELSE
    {
    L0 = &FS_IAS / 128
    &T_IAS = L0
    &AP_IAS = 1
    }
    }
    }
    }
    Var 2402, name I_FD2, Link IOCARD_SW, DEVICE 0, Input 61, Type P // Dummy
    {
    IF V2402 = 1
    {
    &O_FD2 = 1
    }
    ELSE
    {
    &O_FD2 = 0
    }
    }
    Var 2406, name I_FD1, Link IOCARD_SW, DEVICE 0, Input 54, Type P
    {
    IF &I_FD1 = 1
    {
    V2016 = 1
    }
    ELSE
    {
    V2016 = 0
    }
    }

    Var 2416, name I_VS, Link IOCARD_SW, DEVICE 0, Input 64, Type P
    {
    IF &I_VS = 1
    {
    IF &AP_ALT <> 1
    {
    &AP_ALT = 1
    }
    ELSE
    {
    &AP_ALT = 0
    }
    }
    }
    Var 2418, name I_ALTHLD, Link IOCARD_SW, DEVICE 0, Input 60, Type P
    Var 2420, name I_APP, Link IOCARD_SW, DEVICE 0, Input 62, Type P
    {
    IF &I_APP = 1
    {
    IF V2018 <> 1
    {
    V2018 = 1
    V2025 = 1
    }
    ELSE
    {
    V2018 = 0
    V2025 = 0
    }
    }
    }

    Var 2424, name I_LNAV, Link IOCARD_SW, DEVICE 0, Input 56, Type P
    {
    IF &I_LNAV = 1
    {
    IF V2017 <> 1
    {
    V2017 = 1
    }
    ELSE
    {
    V2017 = 0
    }
    }
    }
    Var 2426, name I_HDGSEL, Link IOCARD_SW, DEVICE 0, Input 55, Type P
    {
    IF &I_HDGSEL = 1
    {
    IF V2004 <> 1
    {
    V2004 = 1
    }
    ELSE
    {
    V2004 = 0
    }
    }
    }
    Var 2428, name I_LVLCHG, Link IOCARD_SW, DEVICE 0, Input 59, Type P // FLC
    Var 2430, name I_VNAV, Link IOCARD_SW, DEVICE 0, Input 67, Type P
    Var 2432, name I_SPEED, Link IOCARD_SW, DEVICE 0, Input 58, Type P
    {
    IF &I_SPEED = 1
    {
    IF &SPEED = 0
    {
    &AP_IAS = 1
    }
    ELSE
    {
    &AP_IAS = 0
    &AP_MACH = 0
    &SPEED = 0
    }
    }
    }

    Var 2434, name I_YD, Link IOCARD_SW, DEVICE 0, Input 66, Type P
    {
    IF &I_YD = 1
    {
    V2010 = 1
    }
    ELSE
    {
    V2010 = 0
    }
    }

    Var 2436, name I_AP, Link IOCARD_SW, DEVICE 0, Input 57, Type P
    {
    IF &I_AP = 1
    {
    V2001 = 1
    }
    ELSE
    {
    V2001 = 0
    }
    }

  2. #2
    Boeing 777 Builder


    Kennair's Avatar
    Join Date
    Jan 2007
    Location
    Perth, Western Australia
    Posts
    795
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hi Scott, fun isn't it

    In answer to 1 & 2 I would try initialization everything into Value 0000. Remember this is a special value which gets run at startup and startup only, so put all the "cold & dark" parameters in here instead of at the head of each section. I suspect that your MCP is setting all the LED's ON at startup because it doesn't know the state of any of the switches yet, it's only when you press and release one it then knows its state.

    As for the Lights toggle switch I would think this should be easy enough. Define your two ON positions as separate variables connected to the relative OC switches then make a few statements to the effect of: If Var 102 = 1 (switch Down) then Taxi & Landing = 0, If Var 102 = 0 and Var 101 = 0 (switch middle) then Landing = 0 and Taxi = 1, If Var 101 = 1 (switch Up) then Taxi =0 and Landing =1.

    See how that goes.

    Ken.
    Opencockpits | Aerosim Solutions | Sim-Avionics | P3D | FDS | FTX | AS16 | PPL | Kennair


  3. #3
    300+ Forum Addict XOrionFE's Avatar
    Join Date
    Jan 2008
    Location
    Sugar Grove, IL
    Posts
    307
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    well, I tried moving the initialization variables but still didnt work. It is wierd because all outputs seem to be working exactly opposite of what they should be. anyone else have any ideas?

  4. #4
    Boeing 777 Builder


    Kennair's Avatar
    Join Date
    Jan 2007
    Location
    Perth, Western Australia
    Posts
    795
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Are you sure you have the LED's wired correctly onto your output card? It seems like you may have connected one leg to the 5volts instead of Ground. If ALL outputs work opposite then there must a (simple) common denominator. Try initializing all your outputs to "1" i.e. ON and see if they start OFF.

    Ken.
    Opencockpits | Aerosim Solutions | Sim-Avionics | P3D | FDS | FTX | AS16 | PPL | Kennair


  5. #5
    300+ Forum Addict XOrionFE's Avatar
    Join Date
    Jan 2008
    Location
    Sugar Grove, IL
    Posts
    307
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    i think the wiring is all good because I had it all (MCP and Landing gear indicators) working fine before when I had them on my Outputs card. What I did was move them onto the Master Card now (Outputs card is not in use). It is on the Master Card with this new sioc file that is giving me the issue. I thought I figured it out last night because there is a ground terminal on the output breakout board for the master card that I didnt have hooked up but alas, hooking this to ground didnt change anything.

    Everything is still running exactly opposite of how it should

    Nico?? Any ideas?

  6. #6
    500+ This must be a daytime job
    Join Date
    Jul 2013
    Posts
    948
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Forgive me if I am saying something obvious or already known. The OC Output card has a common positive output rail, switching individual outputs on through the negative side. Whereas the Master card has common negative rail, switching on individual outputs through the positive side.

    Whether this has any relevance will depend on how you transposed the wires from one card to another. Apologies again if you already know this

    David

  7. #7
    300+ Forum Addict XOrionFE's Avatar
    Join Date
    Jan 2008
    Location
    Sugar Grove, IL
    Posts
    307
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Quote Originally Posted by fordgt40 View Post
    Forgive me if I am saying something obvious or already known. The OC Output card has a common positive output rail, switching individual outputs on through the negative side. Whereas the Master card has common negative rail, switching on individual outputs through the positive side.

    Whether this has any relevance will depend on how you transposed the wires from one card to another. Apologies again if you already know this

    David
    No...I didnt know that. Well that makes sense now. I guess since I already have all these wired I will just have to move them all back to the Outputs card.

    That is very helpful David
    Thank you

  8. #8
    300+ Forum Addict XOrionFE's Avatar
    Join Date
    Jan 2008
    Location
    Sugar Grove, IL
    Posts
    307
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Thanks again David!

    You solved my problem. Everything is working fine now.

  9. #9
    500+ This must be a daytime job
    Join Date
    Jul 2013
    Posts
    948
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Xorionfe

    Great, glad I was able to help and repay some of the assistance I have already received from this forum.

    Regards

    David

Similar Threads

  1. sioc code a320 fcu need help
    By usssp in forum I/O Interfacing Hardware and Software
    Replies: 5
    Last Post: 03-12-2013, 12:02 PM
  2. SIOC Elevator Pot Code
    By tomenglish2000 in forum OpenCockpits General Discussion
    Replies: 0
    Last Post: 09-28-2009, 07:26 AM
  3. SIOC Code for MCP, MIP, and TQ updated
    By BoeingNG in forum OpenCockpits General Discussion
    Replies: 3
    Last Post: 08-10-2008, 06:53 PM
  4. Sixpack SIOC code
    By dcutugno in forum PMSystems
    Replies: 0
    Last Post: 12-16-2007, 04:55 PM
  5. SIOC Code
    By Polmer in forum I/O Interfacing Hardware and Software
    Replies: 6
    Last Post: 12-28-2006, 10:49 AM