Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Aug 2010
    Location
    Greece
    Posts
    5
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Nico's Kaan NAV1 & Course example

    Hi to every one,

    In the attached Nico’s Kaan NAV1 Radio example you can chance the frequencies in NAV1 Radio and in the NAV1 Course using 2 rotary switches ( one for Radio and one for Course)
    Can same one give a help to modify the script such as to use only one rotary encoder for both function? A selector push button must be in use for the designed mode ( course or radio).
    I want to use the example to modify the script for CRJ 700 radio panel which use only one Rotary Encoder and Push buttons for selecting the frequencies ( you can see the RadioPanel In the Default FSX CRJ 700 airplane).
    Thanks in advance,
    Cheers,
    Attached Files Attached Files

  2. #2
    150+ Forum Groupie pdpo's Avatar
    Join Date
    Nov 2005
    Location
    belgium
    Posts
    260
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Nico's Kaan NAV1 & Course example

    Hi there,

    this is very simple,
    what you need to do is set a variable depending on the pushbutton or even multiple pushbuttons to a value which indicates what
    you are changing. Then in the body of the encoder you use the IF {} ELSE {} construction to check this value and to do the needed
    rotary action on different targets

    Greetz Peter
    FS9+PM+AST+opencockpits

  3. #3
    500+ This must be a daytime job kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    698
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Nico's Kaan NAV1 & Course example

    Code:
    ////////////////////////////////////////////////////////////////////
    //
    //                Generic FS9/X NAV1 (VOR1) Radio 
    //                   SIOC 3.5+ code for FSUIPC  
    //               using FSUIPC offsets 0x0350 and 0x0C4E
    //
    //                       Version 1.0
    //                       Jan 19, 2011
    //
    //                         Nico Kaan
    //                     The Netherlands
    //                    www.lekseecon.nl
    //
    // INCLUDES:
    //
    //      Implementation of a NAV1 radio, consisting of 
    //
    //      1 single rotary encoder controlling the frequency and course
    //         with a push button to switch between frequency and course
    //         and a push button to switch between high and low part of the frequency
    //      five 7-segment displays for the frequency  
    //          - software controlled Decimal Point via an Output
    //      three 7-segment displays for the course  
    //
    // CHANGE LOG:
    //
    //  1.0 First Release
    
    Var 8600 name FI_NAV1Freq Link FSUIPC_IN Offset $0350 Length 2    
    {
      L0 = FROMBCD &FI_NAV1Freq
      &NAV1Freq = L0
      &NAV1FreqHigh = DIV L0 100
      &NAV1FreqLow = MOD L0 100
      CALL &OutNAV1Freq               // display new freq value 
    }
    
    Var 8601 name FI_NAV1Crs Link FSUIPC_IN Offset $0C4E Length 2    
    {
      &NAV1Crs = &FI_NAV1Crs    
    }
    
    Var 8610 name NAV1FreqLow
    Var 8611 name NAV1FreqHigh
    Var 8612 name NAV1Freq
    
    Var 8613 name CalcNAV1Freq Link SUBRUTINE
    {
      L0 = &NAV1FreqHigh * 100        // high * 100 
      &NAV1Freq = L0 + &NAV1FreqLow    // + low 
      &FO_NAV1Freq = TOBCD &NAV1Freq   // BCD value to panel 
      CALL &OutNAV1Freq               // display new freq value 
    }
    
    Var 8614 name NAV1Crs
    {
      CALL &OutNAV1Crs
    }
    
    Var 8620 name OutNAV1Freq Link SUBRUTINE  
    {
       &D_NAV1Freq = &NAV1Freq + 10000    // to display + '1'
       &O_NAV1DP = 1  
    }
    
    Var 8621 name OutNAV1Crs Link SUBRUTINE    
    {
       &D_NAV1Crs = &NAV1Crs     
    }
    
    Var 8638 name Mode Link IOCARD_SW Input 35 Type P // push button
    // 0 = FREQ, 1 = CRS
    
    Var 8639 name FreqPart Link IOCARD_SW Input 34 Type P // push button
    // 0 = LOW, 1 = HIGH
    
    Var 8640 name RO_NAV1FC Link IOCARD_ENCODER Input 59 Aceleration 1 Type 2     
    {
      L0 = &RO_NAV1FC   
      IF &Mode = 0 
      {
        IF &FreqPart = 1
        { 
          &NAV1FreqHigh = ROTATE 8 35 L0
        }
        ELSE
        {
          L0 = L0 * 5     
          &NAV1FreqLow = ROTATE 0 99 L0
        }  
        CALL &CalcNAV1Freq 
      }
      ELSE
      {
        &NAV1Crs = ROTATE 0 359 L0
        &FO_NAV1Crs = &NAV1Crs       
      }    
    }
    
    Var 8670 name D_NAV1Freq Link IOCARD_DISPLAY Digit 20 Numbers 5  
    Var 8671 name D_NAV1Crs Link IOCARD_DISPLAY Digit 25 Numbers 3
    
    Var 8680 name O_NAV1DP Link IOCARD_OUT Output 96    
    
    Var 8698 name FO_NAV1Crs Link FSUIPC_OUT Offset $0C4E Length 2
    Var 8699 name FO_NAV1Freq Link FSUIPC_OUT Offset $0350 Length 2
    With compliments ...
    Nico
    Last edited by kiek; 01-19-2011 at 05:11 AM.

  4. #4
    75+ Posting Member nricky's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    87
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Nico's Kaan NAV1 & Course example

    Hi Nico

    I took your sioc code and changed it a bid. Your idea with a single encoder is to cool.

    What I have done: took your code and changed it so in 1 Sioc file is the code for all the radios.

    Now the transfer from freq. also works

    COM1 Active VAR. 8800, COM1 Standby VAR. 8801, COM2 Active VAR. 8802, COM2 Standby VAR. 8803, NAV1 Active VAR. 8804, NAV1 Standby VAR. 8805, NAV2 Active VAR. 8806, NAV2 Standby VAR. 8807

    The file can be downloaded from my page http://www.flight.nrick.net/SiocSoftware.html

    Hope that someone can use the sioc file. The only thing that is missing is the transponder and the ADF.

    Cheers Norbert

  5. #5
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Aug 2010
    Location
    Greece
    Posts
    5
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Nico's Kaan NAV1 & Course example

    I thank you all for the response, special Nico Kaan for the excellent example ( One rotary controlling two freguencies)
    But now is the real challenge.
    How can control the radio frequencies for a CRJ700 radio panel that it use, for all standby frequencies only one encoder with push button (Low-Hi freg. selection) four push buttons to swap and for buttons to select mode ( Com1-Com2-Nav1-Nav2)?
    The attached example controls radio frequencies as above but you need to use four rotary encoders
    Regards,
    Attached Files Attached Files

  6. #6
    500+ This must be a daytime job kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    698
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Nico's Kaan NAV1 & Course example

    Hi,

    With so many good examples already available, I'll leave that as an exercise to the reader

    Tip: start with making your script more readable by introducing names instead of numbers

    regards,
    Nico

  7. #7
    75+ Posting Member nricky's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    87
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Nico's Kaan NAV1 & Course example

    Hi Nico

    I find it easier to use numbers than names. As you saw it is part of your code. If it was not for your code it would have been not able for me to so my script.

    Thanks for that.

    Cheers Norbert

    PS keep your examples coming. Maybe you can help me on my ADF

  8. #8
    500+ This must be a daytime job kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    698
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Nico's Kaan NAV1 & Course example

    Quote Originally Posted by nricky View Post
    I find it easier to use numbers than names.
    Strange?! You are not a computer are you?

    Using numbers is more prone to errors... and more difficult to comprehend....

    Of course you always need a number for a variable in SIOC, but then attach a name to it, so you can refer to your variable by its name. That's what I've done in my code.

    You are Norbert ... not social security number 12345678 in Germany ...
    Last edited by kiek; 01-21-2011 at 09:51 AM.

  9. #9
    75+ Posting Member nricky's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    87
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Nico's Kaan NAV1 & Course example

    Quote Originally Posted by kiek View Post

    You are Norbert ... not social security number 12345678 in Germany ...
    You are to funny have tried it few times to work with names but no chance. But you are right, for other it is easier to figure out to understand the code.

    Have you done a sioc for the adf with a single encoder and a transponder. I have spend a bit time on the code but with no sucess.

    Cheers Norbert

  10. #10
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Aug 2010
    Location
    Greece
    Posts
    5
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Nico's Kaan NAV1 & Course example

    Hi Kiek and Norbert

    Numbers or names doesn’t make any different to me because I’ m not able to write even one single line in sioc code.

    What is the story then?

    A few months ago I decided to make alive my youth dream to build my own cockpit.
    I decided to build a CRJ700 cockpit because I believed that it will be easier instead of a B737/800. This was my big mistake.
    Because there are not pre-made modules for CRJ700 I have to build everything by my own and the worst, I have to learn to write in sioc code.
    I thing that I will never be able to do it, even if I’ll try very very hard, because I think, my mind has not this ability ( Can a doctor understand an car engineer?).

    What I have done so far?

    I have search all the available sioc examples and I have cut parts from them making things to work for the parts of my cockpit.
    My big trouble is to modify your example Kiek, in order to control the Radio frequencies with one rotary encoder (as per the layout of a CRJ radio panel)
    If in your example there was a control of NAV2 radio freg (FSUIPC Offset 3120) instead of NAV1Course, ( FSUIPC 0C4E) then maybe I will be able to copy and paste (Like a parrot) some lines in order to control even the COM1 and COM2 Freg

    Kiek your knowledge and your help are very precious so I hope you will never deprive these to us.

    For the friend Norbert I have in the attached an example for the ADF but it use two encoders. When Norbert you will modify it to work with one encoder with push button please send back a copy.

    Regards
    Samsail
    Attached Files Attached Files

Page 1 of 2 12 LastLast

Similar Threads

  1. One OC NAV to "copy" it's information NAV1 > NAV2
    By jespergb in forum General Builder Questions All Aircraft Types
    Replies: 1
    Last Post: 03-10-2011, 09:46 AM
  2. Gps/nav1 toggle switch
    By renegade in forum General Microsoft Flight Simulator 10 (FSX)
    Replies: 3
    Last Post: 07-05-2010, 11:51 AM
  3. com1 and nav1 from opencockpit, what does it look like?
    By jespergb in forum OpenCockpits General Discussion
    Replies: 0
    Last Post: 06-01-2010, 04:49 PM
  4. MyCockpit.org Welcome's to Nico Kaan
    By vybhav in forum MyCockpit News and Announcements
    Replies: 3
    Last Post: 04-18-2010, 07:56 PM
  5. Encoders and NAV1 frequency
    By RobertoR in forum FS2Phidget Users
    Replies: 2
    Last Post: 03-03-2005, 07:59 AM