Results 1 to 6 of 6
  1. #1
    25+ Posting Member
    Join Date
    Apr 2009
    Location
    Canada
    Posts
    74
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    DIALING HI AND LO FOR VOR FREQUENCY WITH a single 12 POS ROTARY

    Hi Nico,

    I have read the other post on the COMM frequency change. It seems a bit different that what I am trying to acheive. I do not see any other posts from guys facing my situation.
    I forgot to make room for the 2nd rotary on my VOR/CRS panel and would like to know what line I can add to use a pushutton to change between the HI and Lo numbers.

    I am using your VOR1.txt script.

    ///////////////////////////////////////////////////////////////////////////
    //
    // Level-D 767 VOR1
    //
    // SIOC 3.7 code for LEKSEECON v4.2+
    //
    // Version 2.1
    // 17 November 2009
    //
    // Nico Kaan
    // The Netherlands
    // www.lekseecon.nl
    // email: leveld757@gmail.com
    //
    // IMPLEMENTS:
    // * a dual rotary for FREQ
    // * a single rotary for CRS
    // * a push button to switch between man/auto
    // * two leds to indicate man/auto
    // * a 5 digit freq display with decimal point control
    // * a 3 digit crs display
    //
    // With cold and dark cockpit and lights test support
    //
    // DISCLAIMER:
    // Your use of my program is at your own risk and your risk only.


    Var 740 Static
    {
    &O_VOR1Manual = TESTBIT v740 0
    &O_VOR1Auto = TESTBIT v740 1
    &O_VOR1FDP = TESTBIT v740 2
    }

    Var 267 Static
    {
    L0 = FROMBCD v267
    IF &VOR1Freq <> L0 // block values coming from rotary
    {
    // new value coming in from the panel
    &VOR1Freq = L0
    &VOR1FreqHigh = DIV L0 100
    &VOR1FreqLow = MOD L0 100

    CALL &OutVOR1Freq // display
    }
    }

    Var 268 Static
    {
    CALL &OutVOR1Crs
    }

    Var 9001 name VOR1FreqLow
    Var 9002 name VOR1FreqHigh
    Var 9003 name VOR1Freq

    Var 9004 name CalcVOR1Freq Link SUBRUTINE
    {
    L0 = &VOR1FreqHigh * 100 // high * 100
    &VOR1Freq = L0 + &VOR1FreqLow // + low
    v267 = TOBCD &VOR1Freq // BCD value to panel
    CALL &OutVOR1Freq // display new freq value
    }

    Var 9006 name OutVOR1Freq Link SUBRUTINE
    {
    IF &ColdAndDark = 1
    {
    &D_VOR1Freq = -999999
    }
    ELSE
    {
    IF &TestMIP = 1
    {
    &D_VOR1Freq = 88888
    }
    ELSE
    {
    &D_VOR1Freq = &VOR1Freq + 10000 // to display + fixed '1'
    }
    }
    }

    Var 9007 name OutVOR1Crs Link SUBRUTINE
    {
    IF &ColdAndDark = 1
    {
    &D_VOR1Crs = -999999
    }
    ELSE
    {
    IF &TestMIP = 1
    {
    &D_VOR1Crs = 888
    }
    ELSE
    {
    &D_VOR1Crs = v268 // to display
    }
    }
    }

    Var 9008 name D_VOR1Freq Link IOCARD_DISPLAY Digit 3 Numbers 5
    Var 9009 name D_VOR1Crs Link IOCARD_DISPLAY Digit 0 Numbers 3

    Var 9010 name O_VOR1Manual Link IOCARD_OUT Output 246
    Var 9011 name O_VOR1Auto Link IOCARD_OUT Output 91
    Var 9012 name O_VOR1FDP Link IOCARD_OUT Output 216


    // VOR1 man auto switch

    Var 270 Static Link IOCARD_SW Input 112 Type P


    Var 9013 name RO_VOR1CRS Link IOCARD_ENCODER Input 36 Aceleration 4 Type 2
    {
    L0 = &RO_VOR1CRS // * -1
    v268 = ROTATE 0 359 L0
    }

    Var 9014 name RO_VOR1FRQL Link IOCARD_ENCODER Input 40 Aceleration 1 Type 2
    {
    C0 = TESTBIT v740 0
    IF C0 // only active if MANUAL
    {
    L0 = &RO_VOR1FRQL * 5
    &VOR1FreqLow = ROTATE 0 99 L0
    CALL &CalcVOR1Freq
    }
    }

    Var 9015 name RO_VOR1FRQH Link IOCARD_ENCODER Input 38 Aceleration 1 Type 2{
    C0 = TESTBIT v740 0
    IF C0 // only active if MANUAL
    {
    L0 = &RO_VOR1FRQH
    &VOR1FreqHigh = ROTATE 8 35 L0
    CALL &CalcVOR1Freq
    }
    }

    Var 998 Static // Refresh
    {
    CALL &OutVOR1Freq
    CALL &OutVOR1Crs
    }

    //
    ///////////////////////////////////////////////////////////////////////////

    Thanks,

    Taufeeq

    P.S.

    Thanks for your help on the MCP, it works like a charm and your script has saved me months!!!

  2. #2
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,202
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: DIALING HI AND LO FOR VOR FREQUENCY WITH a single 12 POS ROTARY

    Hi Taufeeq,

    Here are the changes needed:

    Code:
    Var 9014 name RO_VOR1FRQ Link IOCARD_ENCODER Input 40 Aceleration 1 Type 2
    {
      C0 = TESTBIT v740 0
      IF C0 // only active if MANUAL
      {
        IF highlow = 1
        {
          L0 = &RO_VOR1FRQ
          &VOR1FreqHigh = ROTATE 8 35 L0
        }
        ELSE
        {
          L0 = &RO_VOR1FRQ * 5
          &VOR1FreqLow = ROTATE 0 99 L0
        }
        CALL &CalcVOR1Freq
      }
    }
    
    Var 9015 Static name highlow Link IOCARD_SW Input 113 Type P   // 1 = high, 0 = low part of freq
    regards,
    Nico

  3. #3
    25+ Posting Member
    Join Date
    Apr 2009
    Location
    Canada
    Posts
    74
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: DIALING HI AND LO FOR VOR FREQUENCY WITH a single 12 POS ROTARY

    Hi Nico,

    Bit of a problem.

    This is what comes up when compiling the code.

    Config_SIOC ver 3.7B1 - By Manolo Vélez - www.opencockpits.com
    Open file "config_sioc.tmp"
    7:34:39 PM
    Phase 1
    .OK.

    Phase 2
    ERROR! - Unknow operator
    Line: 638 IF highlow = 1
    ==> highlow


    I have tried making it

    { IF High = 1
    &
    IF Low = 0
    }

    But it is not working. Everything else is fine except

    1. VOR Frequency HIGH-LOW select button
    2. MAN/AUTO button (which is my input 1 and works okay on controlador.exe.

    Thanks,

    Taufeeq

  4. #4
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,202
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: DIALING HI AND LO FOR VOR FREQUENCY WITH a single 12 POS ROTARY

    Hi,
    I'm sorry, that is a typo in my script. An Ampersand is missing, it should read:
    Code:
    IF &highlow = 1
    Please try to learn a little bit of SIOC so you can solve these simple syntactical errors yourself too ...
    See for instance this how-to: http://www.lekseecon.nl/howto.html#names
    regards,
    nico

  5. #5
    25+ Posting Member
    Join Date
    Apr 2009
    Location
    Canada
    Posts
    74
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: DIALING HI AND LO FOR VOR FREQUENCY WITH a single 12 POS ROTARY

    Hi Nico,

    Actually, it was my mistake.
    I overlooked the fact that I did not instruct SIOC which device to look for, I had not written Device 2 in the commands.
    They all work fine now.

    However, I am using 12 position rotary switch as an encoder, is acceleration 2 okay?

    Thanks.

  6. #6
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,202
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: DIALING HI AND LO FOR VOR FREQUENCY WITH a single 12 POS ROTARY

    Quote Originally Posted by shoumi View Post
    However, I am using 12 position rotary switch as an encoder, is acceleration 2 okay?
    I think you mean Type 2? Aceleration is something different.
    If so, no I don't think so, Type 2 is for Grey Type Rotary encoders...
    For your 12 position Rotary Switch just leave Type 2 out.

    Code:
    Var 9014 name RO_VOR1FRQ Link IOCARD_ENCODER Device 2 Input 40 Aceleration 1
    nico
    Last edited by kiek; 11-03-2010 at 07:23 PM.

Similar Threads

  1. Cannot enter any NAV frequency!!!
    By ktroemer in forum PM General Q & A
    Replies: 1
    Last Post: 11-28-2010, 04:53 PM
  2. COM1 Frequency with 1 rotary encoder with pushbutton
    By caparo in forum lekseecon Q&A and Discussions
    Replies: 13
    Last Post: 10-31-2010, 06:35 PM
  3. BU0836X with a Rotary encoder. Slow/fast dialing problem solved.
    By Bjarne Horsbřl in forum I/O Interfacing Hardware and Software
    Replies: 8
    Last Post: 07-21-2010, 02:48 PM
  4. Goflight single rotary
    By Philb737 in forum I/O Interfacing Hardware and Software
    Replies: 4
    Last Post: 01-25-2009, 03:24 PM
  5. ILS frequency
    By Martin Cumming in forum General Builder Questions All Aircraft Types
    Replies: 9
    Last Post: 11-11-2007, 04:16 PM