Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    75+ Posting Member



    Join Date
    Mar 2009
    Location
    boston ma
    Posts
    109
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    multi radio attempt

    I originally posted this topic in the a different section of the forums but I believe I should have posted it here because the aircraft I am attempting to make this work with is the level d. so I apologize if you see this thread twice. This is my first attempt at really trying to complete my own script from thought to code so please be gentle. I have written the code and compiled it in sioc however when I run fs sioc and lekseecon and test it nothing happens could maybe one of you more experienced programmers please share some input as to where I have gone wrong. im trying to create control for left display of com1 and control of the ils freq. where the displays are shared due to restrictions in avail display ports on my displayII card.

    var 9002 name comorils value 0
    {
    Call &outcomorils
    }
    var 9003 name swcomorils link iocard_sw input 1 type p // this is the switch choosing what to display and control com or ils
    {
    &comorils = &swcomorils
    }

    var 852 name D_com static
    {
    Call &outcomorils
    }
    var 665 name D_ils static
    {
    Call &outcomorils
    }
    var 9004 name outcomorils Link SUBRUTINE
    {
    IF &comorils = 0
    {
    &D_comorils = &D_com
    }
    ELSE
    {
    &D_comorils = &D_ils
    }
    }
    var 9005 name D_comorils Link iocard_display digit 11 numbers 5
    var 515 name com_lefthigh static
    var 516 name com_leftlow static
    var 9006 name ilsfreqlow
    var 9007 name ilsfreqhigh

    var 520 name ils_fi
    {
    L0 = &ils_fi
    &ilsfreqhigh = DIV L0 10
    &ilsfreqlow = MOD L0 10
    }
    var 9008 name calcilsfreq Link SUBRUTINE
    {
    L0 = &ilsfreqhigh * 10
    &ils_fi = L0 + &ilsfreqlow
    }
    var 9009 name ro_comilslow link iocard_encoder input 2 aceleration 1 type 2
    {
    L0 = &ro_comilslow * -1
    IF &comorils = 0
    {
    &com_leftlow = ROTATE 0 127 L0
    }
    ELSE
    {
    L0 = &ro_comilslow // * -1
    &ilsfreqlow = ROTATE 0 9 L0
    CALL &calcilsfreq
    }
    }
    var 9010 name ro_comilshigh link iocard_encoder input 4 aceleration 1 type 2
    {
    L0 = &ro_comilshigh * -1
    IF &comorils = 0
    {
    &com_lefthigh = ROTATE 0 127 L0
    }
    ELSE
    {
    L0 = &ro_comilshigh * 1
    &ilsfreqhigh = LIMIT 0 4 L0
    CALL &calcilsfreq
    }
    }

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

    Re: multi radio attempt

    Hi,

    I see a few problems: keyword static is missing for var 520 and you cannot write a BCD5 (like from vars 665 and 852) directly to a display, you have to decode each digit. See my SIOC scripts for how to do that.

    Nico
    P.S put you SIOC code in CODE format in order to keep indentations, now its very difficult to read...
    Last edited by kiek; 02-27-2014 at 11:51 AM.

  3. #3
    75+ Posting Member



    Join Date
    Mar 2009
    Location
    boston ma
    Posts
    109
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: multi radio attempt

    Nico thank you for your input. I have since made some changes and have come to the following results. Unfortunatly I am not near my hardware at this time so I am using the iocp console for testing. Ok here goes.
    1. I added the static to var 520 as you suggested.
    2. I have gone and studied your sioc scripts and believe I have decoded the digits as you said
    3.what I am experiencing in the console at start up is the digits for both ils freq and com1 have values and when I test the encoder nothing changes I would expect to see a change in the com however nothing.
    4. however when I change the value of the comorils switch the ils freq digits are displaying properly and the com digits are all showing 0 values, I believe this is what should be happening and when I test the encoder I have full control of the ils freq high and low. so I think the ils part is working it is just the com that is acting up.

    I have attached my script so you can see my changes. Again thank you for your help.
    Attached Files Attached Files

  4. #4
    75+ Posting Member



    Join Date
    Mar 2009
    Location
    boston ma
    Posts
    109
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: multi radio attempt

    the comorils subroutine now looks like this and has solved my display issues at start up however I still cannont change the com freq?

    var 9004 name outcomorils Link SUBRUTINE
    {
    IF &comorils = 0
    {
    L0 = &D_com
    }
    ELSE
    {
    L0 = &D_ils
    }
    CALL &DecBCD5 L0
    &D_COM12L0 = &Digit0
    &D_COM12L1 = &Digit1
    &D_COM12L2 = &Digit2
    &D_COM12L3 = &Digit3
    &D_COM12L4 = &Digit4
    }

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

    Re: multi radio attempt

    The out subrutine and your Digit definitions are not correct, try this:
    Code:
    var 9002 name comorils value 0
    {
     Call &outcomorils
    }
    
    
    var 9003 name swcomorils link iocard_sw input 1 type p // this is the switch choosing what to display com or ils
    { 
     &comorils = &swcomorils
    }
    
    
    var 852 name D_com static
    {
     Call &outcomorils
    }
    
    
    var 665 name D_ils static
    {
    Call &outcomorils
    }
    
    
    var 9004 name outcomorils Link SUBRUTINE
    {
     IF &comorils = 0
     {
       L0 = &D_com
     }
     ELSE
     {
       L0 = &D_ils
     }
     CALL &DecBCD5 L0
     &D_0 = &Digit0
     &D_1 = &Digit1
     &D_2 = &Digit2
     &D_3 = &Digit3
     &D_4 = &Digit4
    }
    
    
    Var 9027 name D_0 Link IOCARD_DISPLAY Digit 0 Numbers 1 
    Var 9017 name D_1 Link IOCARD_DISPLAY Digit 1 Numbers 1 
    Var 9018 name D_2 Link IOCARD_DISPLAY Digit 2 Numbers 1 
    Var 9019 name D_3 Link IOCARD_DISPLAY Digit 3 Numbers 1 
    Var 9020 name D_4 Link IOCARD_DISPLAY Digit 4 Numbers 1
     
    
    
    var 515 name com_lefthigh static
    var 516 name com_leftlow static
    var 9006 name ilsfreqlow
    var 9007 name ilsfreqhigh
    
    
    var 520 name ils_fi static
    {
     L0 = &ils_fi
     &ilsfreqhigh = DIV L0 10
     &ilsfreqlow = MOD L0 10
    }
    
    
    var 9008 name calcilsfreq Link SUBRUTINE
    {
     L0 = &ilsfreqhigh * 10
     &ils_fi = L0 + &ilsfreqlow
    }
    
    
    var 9009 name ro_comilslow link iocard_encoder input 2 aceleration 1 type 2
    {
     L0 = &ro_comilslow * -1
     IF &comorils = 0
     {
      &com_leftlow = ROTATE 0 127 L0
     }
     ELSE
     {
      L0 = &ro_comilslow // * -1
      &ilsfreqlow = ROTATE 0 9 L0
      CALL &calcilsfreq
     }
    }
    
    
    var 9010 name ro_comilshigh link iocard_encoder input 4 aceleration 1 type 2
    {
     L0 = &ro_comilshigh * -1
     IF &comorils = 0
     {
     &com_lefthigh = ROTATE 0 127 L0
     }
     ELSE
     { 
      L0 = &ro_comilshigh * 1
      &ilsfreqhigh = LIMIT 0 4 L0
      CALL &calcilsfreq
     }
    }
    Nico

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

    Re: multi radio attempt

    Quote Originally Posted by djcevera20 View Post
    the comorils subroutine now looks like this and has solved my display issues at start up however I still cannont change the com freq?
    That's because you have not yet implemented the COMM1 Transfer Switch.
    With that switch you can make the Left Display active...
    Nico

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

    Re: multi radio attempt

    I think you can simulate that switch, fixed at Left position, by adding these lines

    Code:
    Var 510 Static Value 1
    Var 511 Static Value 0
    Nico

  8. #8
    75+ Posting Member



    Join Date
    Mar 2009
    Location
    boston ma
    Posts
    109
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: multi radio attempt

    Nico thank you. I was looking at the code and your sioc examples and I started to think I needed to implement that switch. You have now confirmed that. Could you please help me understand my error with the digit definitions by understanding this I feel it will help me understand how things work a little better. I have not yet tested these new settings but plan to as soon as I get back to a pc

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

    Re: multi radio attempt

    About the Digits, briefly:
    Numbers can be coded decimal or Binary Coded Decimal. In the latter case every 4 bits contain a digit, for example:

    Heading 359 decimal versus heading 359 in BCD(3)

    In the BCD case the decimal number is 3 * 256 + 5 * 16 + 9 = 857.

    A 3 digit Display can either be addressed totally by defining a Var with a start digit and the length in numbers (3) or you can address these digits individually by defining 3 Vars with 1 digit and 1 number. If you would write a BCD3 number to a 3 digit display (defined as one Var with 3 numbers) you would get a wrong result (857 in the example above).

    So for BCD values you have to decode each Digit and write these digits individually to each var.

    So what's the advantage of BCD, why not using decimal values?
    Well lekseecon puts lights test codes, blank codes and minus signs in a BCD value, depending on the situation. You in your SIOC script does not have to think about that and you does not have to write SIOC code for testing these exceptions, you will get that for free by using lekseecon and my DecBCDx routines!


    Nico

  10. #10
    75+ Posting Member



    Join Date
    Mar 2009
    Location
    boston ma
    Posts
    109
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: multi radio attempt

    Hello nico. Thank you for that explanation, with sioc being a new code to me I have been trying to read as much as possible about it and who else better to explain things better than the master himself. So I was finally able to test the changes you suggested and these were my results.
    1. The displays in the iocp console are working correctly.
    2. By defining the variables 510 and 511 I am able to see a change in the comm freq within the iocp console. You had originally suggested that I define the 510 value as 1 and the 511 value as 0. when I did this the comm freq did not respond so I reversed them. 510 is 0 and 511 is 1. by doing this I now see a change in the comm freq. not sure if this is correct? maybe your input on that. And now for one final question. When I change the ils freq in the iocp console I see the change in both the console and the level d panel however when I change the comm freq I see the change in the iocp console but the level d panel does not change the displayed freq. I took the following quote from your manual and if I understand it correctly this is normal and my actual hardware display is the true comm freq. which squakbox would be getting from my sim. please correct me If I am wrong.

    "The VFR radio provided by this software does not synchronize with changes you make with the mouse in the radio of 767 Pedestal panel. You will also notice that only the active frequency in the panel follows the active frequency of this radio. The standby frequency in the panel does not reflect the standby frequency of this radio (there’s no need to). You better forget about the radio in the panel of the 767, your hardware VHF radio is in control, giving you full functionality! "



    Once again thank you for all of your help.
    Tim

Page 1 of 2 12 LastLast