Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    25+ Posting Member


    wody's Avatar
    Join Date
    Oct 2008
    Location
    near MUNICH
    Posts
    51
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    rotary to key input

    Hi Nico,

    you remember the problem in the SDK where the orange bug in the altimeter is responding very, very slowly to encoder inputs. Now I have finished my MIP and unfortunetely I used a CTS encoder for the orange bug. It is not possible anymore to change the encoder to an other rotary-like switch (no Gray code) - I do not know how this is called, but is used very often to generate pulses for left or right when turning.

    Such a "rotary pulse generator" could deliver the inputs necessary for a FSUIPC mouse macro. Such a mouse macro is much better and more responsive. Unfortunately I have a gray encoder.

    Now my question:
    How can I generate in SIOC such variables for the "plus" and "minus" with the normal CTS Gray encoder? The logic for getting the turn direction is in the MasterCard, isn't it?. Can you help?

    Thanks a lot
    Peter

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

    Re: rotary to key input

    Hi Peter,
    The name of such an 'encoder' generating pulses is a Knitter switch.

    But seems a good idea to use mouse macro's. If it works i'll copy it..

    I have changed my code for the orange bug such that it toggles two virtual buttons in FSUIPC. Bit 0 at $3340 if turning left and bit 1 if turning right. In FSUIPC you can call your mouse macro's.

    Code:
    Var 0 Value 0
    {
      &COC = 0
    }
    
    
    Var 9003 name COC
    
    Var 9004 name RO_COrange Link IOCARD_ENCODER Input 79 Aceleration 1 Type 2 
    {
      L0 = &RO_COrange // * -1
      IF L0 > 0
      {
        &FO_JoyStick64 = CHANGEBIT 1 v1 // toggle bit 1 of joystick 64 
      }
      ELSE
      {
        IF L0 < 0
        {
          &FO_JoyStick64 = CHANGEBIT 0 v1 // toggle bit 0 of joystick 64 
        }
      }
      &COC = CHANGEBITN 0 &COC
    }
    
    Var 9005 name FO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4
    Let me know if it works, then I would like to copy your mouse macro's

    Regards,
    Nico
    Last edited by kiek; 12-09-2011 at 10:08 AM.

  3. #3
    25+ Posting Member


    wody's Avatar
    Join Date
    Oct 2008
    Location
    near MUNICH
    Posts
    51
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: rotary to key input

    Hi Nico,

    just finished the adaption to use the mouse macros. I had no problem with defining the macro, it is available and I tested it with a temporary code with 2 pushbuttons. It workes as expected.

    Unfortunately it does not work with the encoder. It started already when I defined in FSUIPC the virtual joystik. After several trials the respective "buttons" showed up for defining the macro as a control. But finaly I got the 2 buttons defined in FSUIPC.

    When turning the encoder the first time, the bug is going to the respective direction, but keeps on going and is not to stop. I did not tick the "Control to repeat while held", Only the parameter "1" when button pressed, no action for release.

    I Think the encoder logic does not correspond with this code, thats why the result is erratic.

    This is my SIOC implementation:
    Code:
    // My Mouse Macros
    // 24.12.2010
    
    
    // ======================================================
    // Var 1000 name FO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4 
    // >>>>>   Ist schon im TQ.txt definiert              <<<<<<<<<<
    // >>>>>   bit 0 bis bit 3 sind schon verwendet       <<<<<<<<<< 
    // >>>>>   Im FSUIPC dann das MouseMacro aktivieren   <<<<<<<<<<
    // ======================================================
    
    // ==================  FIRE PANEL MouseMacros  =================
    
    Var 5000 name FwdCargoArmed Link IOCARD_SW Input 81 Type I
     {
       &FO_JoyStick64 = CHANGEBIT 4 v5000 // toggle bit 4 of joystick 64
     }
    
    Var 5010 name AftCargoArmed Link IOCARD_SW Input 82 Type I
     {
       &FO_JoyStick64 = CHANGEBIT 5 v5010 // toggle bit 5 of joystick 64
     }
    
    Var 5020 name CargoBtlDisc Link IOCARD_SW Input 83 Type I
     {
       &FO_JoyStick64 = CHANGEBIT 6 v5020 // toggle bit 6 of joystick 64
     }
    
    // ================== Altimeter OrangeBug MouseMacro  ============
    // Orange Bug with MouseMacro
    // from Nico
    // 8.12.2011
    
    
    // Var 0 Value 0
    // {
    //   &COC = 0
    // }
    
    
    Var 9003 name COC
    
    Var 9004 name RO_COrange Link IOCARD_ENCODER Input 52 Aceleration 1 Type 2 
    {
      L0 = &RO_COrange // * -1
      IF L0 > 0
      {
        &FO_JoyStick64 = CHANGEBIT 7 v9004 // toggle bit 7 of joystick 64 
      }
      ELSE
      {
        IF L0 < 0
        {
          &FO_JoyStick64 = CHANGEBIT 8 v9004 // toggle bit 8 of joystick 64 
        }
      }
      &COC = CHANGEBITN 0 &COC
    }
    
    // Var 9005 name FO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4  // already defined in TQ.txt
    What do you think?

    Thanks,
    Peter

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

    Re: rotary to key input

    Hi Peter,

    Sorry, my (copy/paste) mistake, I took an example from a switch. So change the two Joystick lines in your code into:

    Code:
         &FO_JoyStick64 = TOGGLE 7   // toggle bit 7 of joystick 64

    Code:
         &FO_JoyStick64 = TOGGLE 8   // toggle bit 8 of joystick 64
    and remove the COC variable, not needed.


    regards,
    Nico

  5. #5
    25+ Posting Member


    wody's Avatar
    Join Date
    Oct 2008
    Location
    near MUNICH
    Posts
    51
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: rotary to key input

    Hi Nico,

    it works, but if you turn the encoder there are little increments - 6 to 7 times for 100 feet. I also changed the acceleration, but more than 1 makes it even worse. So it works, but probably another modification of the code has to be done.

    Something else to take care of when defining the buttons in FSUIPC:
    The encoder has to be in such a detent position, where no contact is closed. I used the SIOC monitor (good to have it now with v4) to get the encoder in this position. Then, and only then you can define the virtual buttons in FSUIPC.

    Thanks for your help. If you need any information from my setup, just tell me.

    Greets
    Peter

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

    Re: rotary to key input

    Hi Peter,
    Okay, but is it faster then the old solution without mouse macro's?

    Tip: The TOGGLE function in SIOC generates a pulse (0->1->0) so try to trigger the mouse macro as well upon push as on release of the virtual button (in FSUIPC).

    regards,
    Nico

  7. #7
    25+ Posting Member


    wody's Avatar
    Join Date
    Oct 2008
    Location
    near MUNICH
    Posts
    51
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: rotary to key input

    Hi Nico,

    yes it is little faster. I will also try your tip and change the macro. That means the parameter for pressing will be "1" and for releasing it will be "0".

    Will report back this evening,
    Peter

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

    Re: rotary to key input

    Hi Peter,

    I don't know the width (in time) of the TOGGLE function pulse, maybe it lasts too long.
    As alternative you could try this SIOC code:

    Code:
    &FO_JoyStick64 = CHANGEBITN 7 &FO_JoyStick64  // change bit 7 of joystick 64
    and
    Code:
    &FO_JoyStick64 = CHANGEBITN 8 &FO_JoyStick64  // change bit 8 of joystick 64
    In FSUIPC you should trigger the mouse macro as well on the push as the release of the virtual button.

    Greets,
    Nico

  9. #9
    25+ Posting Member


    wody's Avatar
    Join Date
    Oct 2008
    Location
    near MUNICH
    Posts
    51
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: rotary to key input

    Hi Nico,

    the last change did not work at all. I reverted to the TOGGLE version. It works, but as mentioned already it is not possible to have a speedy turning. The FSUIPC mouse macro is triggert for push and also for release.
    If I turn to fast the bug does not move fast, sometimes even slower. So a steady and moderate turning is best. I need for 500 feet approximately 12 sec. Changing of acceleration does not help at all.

    For me it is now ok. If you have another idea or another code it would be nice. Just prepare for christmas and relax. I wish you all the best and thanks again for all your work!

    Peter

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

    Re: rotary to key input

    Hi Peter,

    Changing the aceleration value has no effect indeed, that will only change the delta value (in L0) and not how many times the code in Var9004 is executed.

    I think i will not change my implementation, I'm not using the orange bug anyway, but always the Decision Height. Is not that the right procedure for a 767 in Cat II or Cat III? I'll look that up in the documentation during the Christmas Holidays

    Frohliche Weihnachten!

    regrds,
    Nico
    Last edited by kiek; 12-11-2011 at 07:05 AM.

Page 1 of 2 12 LastLast