Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12
  1. #11
    75+ Posting Member
    Join Date
    Apr 2009
    Location
    Toronto
    Posts
    125
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Initializing LED to be Turned Off

    Dave,

    I had an error in my last post..should have read:

    Code:
    Var 0138, Link IOCARD_SW, Input 13, Type P // Push Button for Transponder Mode
    {
         V0135 = CHANGEBITN 0 V0138
    }
    Jim

  2. #12
    75+ Posting Member
    Join Date
    Oct 2008
    Location
    ontario
    Posts
    95
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Initializing LED to be Turned Off

    Jim,

    Thanks for hanging in there with me. To the best of my knowledge the SB Offset isn't broke down further into bits. It is a value only (ie. 0 or 1)

    However I am happy to report success. I went back to my original idea of using a rotary switch after finding a script at the OC forum. The script was much more complicated than I needed for a wide range of radio functions. Buried within it was the transponder and I was able to scrounge some code from the overall script. Modified it slightly and it worked. Rotary switch starts in off position and led is unlit ; switch to Standby position and led remains unlit ; switch to active (Mode C) and led lights up. Switching back to standby or off and led turns off.

    FYI here is the piece of code that did the trick:

    Code:
    Var 0304, Link IOCARD_SW, Input 13 // XPNDR Mode STBY 
    { 
    IF V0304 = 1 
    { 
    V0399 = 1 
    } 
    } 
    
    Var 0305, Link IOCARD_SW, Input 14 // XPNDR Mode Normal 
    { 
    IF V0305 = 1 
    { 
    V0399 = 0 
    } 
    } 
    
    Var 0399, Link FSUIPC_OUT, Offset $7B91, Length 1 // Squawkbox XPNDR Mode 
    { 
    CALL V0139
    } 
    
    Var 0139, Link SUBRUTINE // state of transponder to set led
    {
    IF v0399 = 0
    {
    &XPONDER_LED = 1
    }
    ELSE
    {
    &XPONDER_LED = 0
    }
    }
    
    Var 0140, name XPONDER_LED, Link IOCARD_OUT Output 23 // led to indicate standby or Mode C
    Cheers, Dave
    Dave Kemp
    FS9-BU0836X-GoFlight 166-TH2GO-WideFS-FSUIPC-Opencockpits

Page 2 of 2 FirstFirst 12