Page 6 of 6 FirstFirst ... 23456
Results 51 to 55 of 55
  1. #51
    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: Scaling Localiser and Glideslope Needles for HSI

    Hi Jack,
    I have good and bad news...

    The bad news first:
    It looks like Config_SIOC 'gets confused' while combining the two Var 0 codes. Normaly one only writes simple assignments in var 0 , not the IF statements you wrote. So maybe the Config_SIOC compiler is not capable of doing that (a bug I gues).

    The good news:
    When I had a look at your Var 0 code, I was wondering why you first give the motor a value and then test whether the motor has that value... Is not that always the case? I have simplified the glideslope part into:

    Code:
    Var 0, Value 0
    {
      &Motor_1 = 250
    }
    and the localiser part into:
    Code:
    Var 0, Value 0
    {
      &Motor_5 = 250
    }
    and then it compiles OK!

    regards,
    Nico

  2. #52
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Scaling Localiser and Glideslope Needles for HSI

    Hi Nico,

    I appreciate the Var 0 logic is confusing, allow me to explain.

    At startup, SIOC does not know the value of the potentiometers (because they have not changed).

    So, the Var 0 logic moves the motors one way, and then moves them the other way.

    This changes the Potentiometer vars, allowing SIOC to get their values. Otherwise, SIOC does not know the Potentiometer values and the motors just stay still, as no further logic is executed.

    Unfortunately, I cannot use your style of logic (ie JUST "motor = 250" or "motor = 120"). This is because, for example, if the Localiser motor was all the way to the left, and we tell it to move 120 (ie to the left some more), it will obvious not be able to move any more.

    If you can think of a better way to read the Potentiometer values at startup that would be great.

    Cheers,

    Jack

  3. #53
    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: Scaling Localiser and Glideslope Needles for HSI

    Jak,
    I do not understand, sorry (I have no experience with reading pot meters).
    I recommend to combine these two files manually into one localiser_glideslope file, in order to program around the Config_SIOC bug.
    And please report this bug to Opencockpits.

    Regards,
    Nico

  4. #54
    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: Scaling Localiser and Glideslope Needles for HSI

    Hi Jack,
    Here a better idea. I have put the init code in a separate routine called from Var 0. Now the compiler does not get confused...

    Code:
    Var 0, Value 0
    {
      CALL &Init1
    }
    
    Var 52 name Init1 Link SUBRUTINE
    {
     &Motor_1 = 120
     IF &Motor_1 = 120
     {
      &Motor_1 = 250
     }
    }
    and

    Code:
    Var 0, Value 0
    {
      CALL &Init2
    }
    
    Var 7500 name Init2 Link SUBRUTINE
    {
     &Motor_5 = 120
     IF &Motor_5 = 120
     {
      &Motor_5 = 250
     }
    }
    Nico

  5. #55
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Scaling Localiser and Glideslope Needles for HSI

    Hi Nico,

    So sorry that I did not see your new post until now.

    The Subroutine is a great idea; I shall implement it ASAP.

    Regards,

    Jack

Page 6 of 6 FirstFirst ... 23456