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

    COM1 Frequency with 1 rotary encoder with pushbutton

    Hi,
    I'm building my level D767 with FSCONV. I'd like to work for tuning Comm1 with 1 encoder Type 2 with 1 button on the axis. The same for the VOR1 and VOR2.
    But I don't found an a SIOC code for this operations.
    I have tried some codes but not work.
    When I don't push the axis of the encoder, rotating should changes high frequency, when I push the axis, rotating at same time, should changes decimal frequency.

    May you helpme?

    Thank a lot in advance.

    Regards

    Rossano

  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: COM1 Frequency with 1 rotary encoder with pushbutton

    Hi Rossano,
    Why are you using FSCONV with SIOC? You better use lekseecon .. is a lot easier.

    But anyway, your problem very much looks like this example: http://www.lekseecon.nl/howto.html#ROTPush

    In the rotary encoder code you either update the high frequency part or the low freqeuncy part of COMM1 depending on the variable that is set by the push button.

    regards,
    Nico

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

    Re: COM1 Frequency with 1 rotary encoder with pushbutton

    Hi Nico,
    I have tried this code before write, but doesn't work.
    I'll send my SIOC code.
    Thank a lot for now.
    Regards,
    Rossano

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

    Re: COM1 Frequency with 1 rotary encoder with pushbutton

    Hi Nico,
    this is my SIOC code that don't works:

    //-----------------------------------------------------------------------------
    // COMM1 e 2 Frequency
    //-----------------------------------------------------------------------------

    Var 4000, name VHF1bp, Link IOCARD_SW, input 67
    Var 4002, value 118
    Var 4003, value 0
    Var 4005, name VHF1H, Link FSUIPC_OUT, Offset $8B2E, Length 2
    Var 4006, name VHF1H, Link FSUIPC_OUT, Offset $8B30, Length 2
    Var 4001, name VHF1rot, LINk IOCARD_ENCODER, Input 68, Aceleration 1, Type 2

    {L0 = &VHF1rot * -1

    IF &VHF1bp = 0

    {V4002 = ROTATE 118 136 L0
    V4005 = V4002
    }

    ELSE

    {V4003 = ROTATE 0 100 L0
    V4006 = V4002
    }

    }

    Thank a lot for your help.

    Regards.
    Rossano

  5. #5
    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: COM1 Frequency with 1 rotary encoder with pushbutton

    Hi,
    Please study the FSCONV Manual carefully, these two offset have a range between 0 and 359 ... FSCONV will generate valid COMM frequencies.

    And
    V4006 = V4002
    is wrong, should be:
    V4006 = V4003

    Try this code instead:
    Code:
    Var 4000 name VHF1bp Link IOCARD_SW input 67
    
    Var 4002 name VHF1High Value 180
    Var 4003 name VHF1Low Value 180
    
    Var 4005 name VHF1H Link FSUIPC_OUT Offset $8B2E Length 2
    Var 4006 name VHF1L Link FSUIPC_OUT Offset $8B30 Length 2
    
    Var 4001 name VHF1rot LINk IOCARD_ENCODER Input 68 Aceleration 1 Type 2
    {
      L0 = &VHF1rot * -1
    
      IF &VHF1bp = 0
      {
        &VHF1High = ROTATE 0 359 L0
        &VHF1H = &VHF1High
      }
      ELSE
      {
        &VHF1Low = ROTATE 0 359 L0
        &VHF1L = &VHF1Low
      }
    }
    Nico
    Last edited by kiek; 10-17-2010 at 05:52 PM.

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

    Re: COM1 Frequency with 1 rotary encoder with pushbutton

    Hi Nico,
    I have tried your SIOC code, but when I rotate without push or with push the encoder, I don't see any changes in VHF frequency COMM1 in the pedestal. I setup the FSCONV one time with single rotary encoder and one time with dual rotary encoder, cursor at 6 both.
    The SIOC for MCP works fine, but for VHF1 COMM1 don't work......
    I also verifyed the electrical connections to the mastercard with a tester. All ok.
    But don't work....
    I don't know what I have to do.......
    Thanks Nico for your kind help.
    Regards.
    Rossano

  7. #7
    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: COM1 Frequency with 1 rotary encoder with pushbutton

    Hi,
    My code is not complete, you also have to implement the TFR switch... so the frequency you have dialled is set into the Pedestal. (when FSCONV is setup for a single rotary encoder).
    And what about the Displays? Have you built and programmed these too, otherwise you do not know what you are dialling ...

    regards,
    Nico

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

    Re: COM1 Frequency with 1 rotary encoder with pushbutton

    Hi Nico,
    I write this follow code to try tomorrow to change frequency of comm 1 with a rotary encode with push button on the axis.
    When Iíll see works fine the rotary encoder (in the pedestal Iíll see frequency comm1 change) Iíll build the displays set to read in the cockpit the frequency setted.
    This is the SIOC code:

    Var 4100 name TFRCOMM1 Link FSUIPC_OUT Offset $8B32 Length 1

    Var 4101 name TRFsw Link IOCARD_SW input 66
    {
    IF &TRFsw = 1

    {&TFRCOMM1 = SETBIT 0
    &TFRCOMM1 = CLEARBIT 1
    }
    ELSE
    {&TFRCOMM1 = CLEARBIT 0
    &TFRCOMM1 = SETBIT 1
    }
    }

    Var 4000 name VHF1bp Link IOCARD_SW input 67

    Var 4002 name VHF1High Value 180
    Var 4003 name VHF1Low Value 180

    Var 4005 name VHF1H Link FSUIPC_OUT Offset $8B2E Length 2
    Var 4006 name VHF1L Link FSUIPC_OUT Offset $8B30 Length 2

    Var 4001 name VHF1rot LINk IOCARD_ENCODER Input 68 Aceleration 1 Type 2
    {
    L0 = &VHF1rot * -1

    IF &VHF1bp = 0
    {
    &VHF1High = ROTATE 0 359 L0
    &VHF1H = &VHF1High
    }
    ELSE
    {
    &VHF1Low = ROTATE 0 359 L0
    &VHF1L = &VHF1Low
    }
    }


    Please Nico, what do you think about it?
    Thanks a lot.

    Regards.

    Rossano

  9. #9
    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: COM1 Frequency with 1 rotary encoder with pushbutton

    Hi,
    Looks fine to me, although this piece of code for the TFR switch is a little bit shorter:
    Code:
    Var 4101 name TRFsw Link IOCARD_SW input 66
    {
      IF &TRFsw = 1
      {
        &TFRCOMM1 = 1
      }
      ELSE
      {
        &TFRCOMM1 = 2
      } 
    }
    Nico

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

    Re: COM1 Frequency with 1 rotary encoder with pushbutton

    Hi,
    now works fine. Thanks a lot Nico for kind help!!!
    To work fine I have to changed the SIOC code:

    Var 4101 name TRFsw Link IOCARD_SW input 66
    {
    IF &TRFsw = 1
    {
    &TFRCOMM1 = 1
    }
    ELSE
    {
    &TFRCOMM1 = 2
    }
    }

    as follow:

    Var 4101 name TRFsw Link IOCARD_SW input 66
    {
    IF &TRFsw = 1
    {
    L0 = 2
    &TFRCOMM1 = L0
    }
    ELSE
    {
    L0 = 1
    &TFRCOMM1 = L0
    }
    }

    Because SIOC compiler do not accept the direct assignemet: &TFRCOMM1 = 2

    Now I'll write a SIOC code to drive displays to show frequency tuned on COMM1.
    Thank, thank a lot Nico.

    Regards.

    Rossano

Page 1 of 2 12 LastLast

Similar Threads

  1. DIALING HI AND LO FOR VOR FREQUENCY WITH a single 12 POS ROTARY
    By shoumi in forum lekseecon Q&A and Discussions
    Replies: 5
    Last Post: 11-03-2010, 07:17 PM
  2. Rotary encoder-where and what to buy?
    By shoumi in forum General Builder Questions All Aircraft Types
    Replies: 5
    Last Post: 12-22-2009, 09:48 PM
  3. Turning a Rotary encoder with a pushbutton into a dual rotary encoder
    By snizbatch in forum I/O Interfacing Hardware and Software
    Replies: 2
    Last Post: 05-11-2009, 03:57 AM
  4. Encoder> Frequency button won't work
    By DanFontan in forum FS2Phidget Users
    Replies: 1
    Last Post: 01-23-2007, 04:08 PM