Results 1 to 9 of 9
  1. #1
    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

    Old: Landing Gear

    I am currently trying to get my gear lever to work. It only has 2 toggle switches (micro switches), one for up and one for off. I was intending to determine off when neither switch was on.
    The following vars are from the Manual.

    Var 368 for DOWN
    Var 369 for OFF
    Var 370 for UP

    and they are all RL which I believe is Rotary Leading, meaning that they override whatever the panel is set to.
    When my toggle for up activates I set 370 = 1. When down I set 328 = 1. When neither I set 369 = 1.
    Code:
    Var 368 Static Name SDKGearDown 
    Var 369 Static Name SDKGearOff 
    Var 370 Static Name SDKGearUp 
    Var 9000 Name GearUp Link IOCARDS_SW 34 Type I 
    { 
      CALL &GearEvent 
    } 
    Var 9001 Name GearDown Link IOCARDS_SW 35 Type I 
    { 
      CALL &GearEvent 
    } 
    Var 9002 Name GearEvent Link SUBRUTINE 
    { 
      IF &GearUp = 1 
      { 
        &SDKGearUp = 1 
      } 
      IF &GearDown = 1 
      { 
        &SDKGearDown = 1 
      } 
      IF &SDKGearUp = 0 
      { 
        IF &SDKGearDown = 0 
        { 
          &SDKGearOff = 1 
        } 
      } 
    }
    This is not working. If I set a variable in an RL to 1 do I have to set the others to 0 too? I would have tried this but I am away from the simulator and trying to get this right.

  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: Old: Landing Gear

    Yes indeed, the interface (the three vars) is designed for a rotary switch, so you have to simulate that: if one of the terminals is 1 you should set the others to 0. Like this:

    Code:
    Var 368 Static Name SDKGearDown 
    Var 369 Static Name SDKGearOff 
    Var 370 Static Name SDKGearUp 
    
    Var 9000 Name GearUp Link IOCARD_SW Input 34 Type I 
    { 
      CALL &GearEvent 
    } 
    
    Var 9001 Name GearDown Link IOCARD_SW Input 35 Type I 
    { 
      CALL &GearEvent 
    } 
    
    Var 9002 Name GearEvent Link SUBRUTINE 
    { 
      IF &GearUp = 1 
      { 
        &SDKGearUp = 1 
        &SDKGearOff = 0 
        &SDKGearDown = 0 
      } 
      ELSE 
      { 
        IF &GearDown = 1 
        { 
          &SDKGearUp = 0 
          &SDKGearOff = 0 
          &SDKGearDown = 1 
        } 
        ELSE 
        { 
          &SDKGearUp = 0 
          &SDKGearOff = 1 
          &SDKGearDown = 0 
        } 
      } 
    }

  3. #3
    25+ Posting Member
    Join Date
    Apr 2008
    Location
    Waukesha, WI
    Posts
    49
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Old: Landing Gear

    I have a twist on this thread that I will share with everyone...

    I wanted to free up some OpenCockpits inputs, so I decided to move the Landing Gear switches from OC to my LeoBodnar 836X USB Joystick board. I am using just two switches for the Landing Gear Handle, but wish to simulate the Landing Gear OFF position (set to OFF whenever gear handle is not DOWN or UP).

    So, using FSUIPC button assignment dialog, I set my 836x button 30 to "Gear Down" and then set my 836x button 31 to "Gear Up".

    Long story short, I couldn't get the logic to work in SIOC w/ Lekseecon to properly model the OFF position. I believe this is because I have no indication when I leave UP or DOWN, that the landing gear handle is being moved (until it hits the other switch, that is). This is no good, since I can never then be in the OFF position.

    I came up with a solution that I will show here, but want to learn what other options I could have done instead (or, someone may point out a problem with my approach). Either way, hopefully someone can learn from this (hopefully me too!).

    I went back to the FSUIPC button assignment dialog and added an action on BUTTON RELEASE (for both buttons): "Offset Byte Set" with Offset "x66F0" and Parameter "x01". I chose "x66F0" as it was in the "free for general use range (x66C0 - x66FF)" per the FSUIPC4 Offsets Status.pdf document.

    Then, in SIOC, using Lekseecon, I have the following code:

    Var 2042, Link FSUIPC_INOUT, Offset $66F0, Length 1 // FSUIPC set when gear LEAVING UP or DOWN
    {
    C0 = v2042 = 1
    if C0
    {
    // C0 is true when FSUIPC offset $66F0 is set to 1 (I set this to happen on my button release)

    &GearOffCmd = 1
    &GearDwnSDK = 0
    &GearUpSDK = 0
    }
    else
    {
    // else here means that this changed back to 0
    // so don't do anything!
    }
    }

    Var 765 name GearPos Static
    {
    // 0 = UP, 49-51=OFF, 100 = DOWN per Lekseecon docs
    C0 = &GearPos = 0
    C1 = &GearPos = 100
    if C0 OR C1
    {
    if C0
    {
    &GearDwnSDK = 0
    &GearUpSDK = 1
    &GearOffCmd = 0
    // Clear this trigger
    v2042 = 0
    }
    else
    {
    &GearDwnSDK = 1
    &GearUpSDK = 0
    &GearOffCmd = 0
    // Clear this trigger
    v2042 = 0
    }
    }
    else
    {
    // else gear is neither UP or DOWN, therefore set it to OFF (saving a switch!)
    &GearOffCmd = 1
    &GearDwnSDK = 0
    &GearUpSDK = 0
    }
    }
    // end if reading Gear Status Variable

    Var 368 name GearDwnSDK Static
    Var 369 name GearOffCmd Static
    {
    // Gear Off Command Changed
    // No specific action required
    }
    Var 370 name GearUpSDK Static

    This seems to work, but having been out of FSUIPC/Lekseecon/SIOC for about a year now, I am wondering if I made this much harder on myself than necessary. Suggestions/Comments/Corrections are welcome.

    Thanks.

    Dave Snyder

  4. #4
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Nov 2014
    Location
    Yokosuka, Japan
    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: Old: Landing Gear

    I'm having this problem, but haven't arrived at the solution. Once the gear handle goes from up to off, its stuck in off. I've verified that my code (lekseecon_f and FSUIPC with arduino and Link2FS interface) sends the correct offsets and I've polled the offsets to see that the 1s and 0s are changing as expected. Is there something more to getting the gear to leave the off position than setting the offset x9170 to 1 or x9172 to 1 (and then setting the other gear offsets to 0 as indicated above)?

    To be clear, if the gear are down, I can successfully raise them, through OFF, to the UP position. No problems. I can then take the switch to Off, and everything works as expected. Once in Off, my code can't get the lever out of off. Again, the offset and value are being sent and I've verified that so I don't think its a problem with the code. I haven't read about a gear unlock offset but I remember I had to send an unlock control to get the gear to correctly move for the 737ngx. I haven't seen a similar offset for the LVLD 767.

    Any help would be greatly appreciated. Relevant code posted but I think my problem is in the approach or something I've missed thats required to move the lever out of off. Thanks in advance! I can post more about link2fs and what the string values mean if it would help, but those are just arbitrary strings sent to link2fs which invokes that program to sent offsets I've set associated with those strings.

    //Gear Up
    if (KpinNo == 53 && KpinStateSTR == "0" && KoldpinStateSTR == "1"){
    Serial.println ("#i1");
    Serial.println ("#j0");
    Serial.println ("#k0");}
    //Gear Up to Off
    if (KpinNo == 53 && KpinStateSTR == "1" && KoldpinStateSTR == "0"){
    Serial.println ("#j1");
    Serial.println ("#k0");
    Serial.println ("#i0");}
    //Gear Down
    if (KpinNo == 52 && KpinStateSTR == "0" && KoldpinStateSTR == "1"){
    Serial.println ("#k1");
    Serial.println ("#j0");
    Serial.println ("#i0");}
    //Gear Down to Off
    if (KpinNo == 52 && KpinStateSTR == "1" && KoldpinStateSTR == "0"){
    Serial.println ("#j1");
    Serial.println ("#k0");
    Serial.println ("#i0");}
    Last edited by av8orfliboy; 10-25-2015 at 11:12 AM. Reason: typos

  5. #5
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Nov 2014
    Location
    Yokosuka, Japan
    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: Old: Landing Gear

    I changed nothing, except restarted, and it works perfectly now.

  6. #6
    25+ Posting Member
    Join Date
    Apr 2008
    Location
    Waukesha, WI
    Posts
    49
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Old: Landing Gear

    Playing around with the Level D 767 in FSX some more I noticed my script has a problem with two similar scenarios:
    * Going from DOWN to OFF back to DOWN doesn't register the final transition to DOWN
    * Going from UP to OFF back to UP doesn't register the final transition to UP

    Played around with my script a bunch and couldn't get it to work.

    I then tried to rewrite using some Joystick button inputs as follows:

    Var 9111 name FOLG_JoyStick0 Link FSUIPC_IN Offset $03C0 Length 4
    {
    &GearDwnSDK = TESTBIT &FOLG_JoyStick0 30 // Button 30 joystick 0 (gear down input)
    &GearUpSDK = TESTBIT &FOLG_JoyStick0 31 // Button 31 joystick 0 (gear up input)
    C0 = &GearDwnSDK = 1
    C1 = &GearUpSDK = 1
    IF C0 OR C1
    {
    &GearOffCmd = 0
    }
    ELSE
    {
    &GearOffCmd = 1 // Now, if gear is NOT up or down, then it must be OFF
    }
    }
    Var 765 name GearPos Static
    {
    // 0 = UP, 49-51=OFF, 100 = DOWN per Lekseecon docs
    C0 = &GearPos = 0
    C1 = &GearPos = 100
    // This doesn't do anything other than allow me to watch in IOCPConsole logging
    }


    // Remember Var368-370 are in Lekseecon as (Leading) Rotaries for Landing Gear
    // this means always clear values that are not true manually when simulating a rotary
    Var 368 name GearDwnSDK Static
    Var 369 name GearOffCmd Static
    {
    // Getting here means Gear Off Command CHANGED (no action required)
    }
    Var 370 name GearUpSDK Static


    With this code, in IOCPConsole, I can see the logic works fine and my 3 gear variables are tracking properly in all cases, however, the 767 Panel will not show the landing gear in the proper position per my 2 cases above. Checking the r/o Lekseecon variable - 765 it is very interesting to note that Var765 does NOT notice a change when going back per 2 scenarios above. That is, it never gets triggered that the gear went back to UP or DOWN if that is where it came from originally.

    Can anyone tell me what is going on here? Is this a LDS 767 bug?

    Thoughts greatly appreciated.

    - Dave Snyder

  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: Old: Landing Gear

    Hello Dave
    Quote Originally Posted by dsnyder View Post
    Is this a LDS 767 bug?
    I would not think so while with 3 opencockpits inputs and this very simple SIOC script it always has worked:
    Code:
    // Gear Lever:
    Var 368 Static Link IOCARD_SW Input 104 Type I 
    Var 369 Static Link IOCARD_SW Input 103 Type I 
    Var 370 Static Link IOCARD_SW Input 105 Type I
    From this quote from of an earlier post of you, I have the impression that it has worked for you too:

    Quote Originally Posted by dsnyder View Post
    I wanted to free up some OpenCockpits inputs, so I decided to move the Landing Gear switches from OC to my LeoBodnar 836X USB Joystick board. I am using just two switches for the Landing Gear Handle, but wish to simulate the Landing Gear OFF position (set to OFF whenever gear handle is not DOWN or UP
    So I assume it has something to do with your new "solution" based on the LeoBodnar's card and FSUIPC buttons...

    Regards,
    Nico
    Last edited by kiek; 11-09-2015 at 04:10 AM.

  8. #8
    25+ Posting Member
    Join Date
    Apr 2008
    Location
    Waukesha, WI
    Posts
    49
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Old: Landing Gear

    Nico,

    Thanks for the prompt response on your retired project! I really appreciate your input and continue to be thankful for your contributions to the 767 over the years.

    This evening I did go back and sanity check using the standard 3 type I inputs exactly as you had shown and can confirm the same problem exists in that configuration.

    The two sequences that do not appear to work (confirmed with IOCPConsole Logging - watch Var765 as well):
    * Going from DOWN to OFF back to DOWN doesn't register the last transition to DOWN (it stays OFF - until going to UP)
    or
    * Going from UP to OFF back to UP doesn't register the last transition to UP (it stays OFF
    - until going to DOWN)

    It is quite easy to miss if you don't have a default 767 MIP panel up for display (My landing gear gauge is generally hidden as I have a hardware handle in use). However, if you show the landing gear gauge, you can see that the gear lever does NOT do the final transitions (in the situations described above).

    Please note, it does eventually get out of that situation as after your gear is UP and then OFF, you are usually going to transition to gear DOWN next - and that works fine.

    Interesting.

    - Dave Snyder

  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: Old: Landing Gear

    Dave,

    I see, you may be right, although I've never noted that behaviour. I cannot test it I'm afraid. I am running Windows 10 and Prepar3D v3 thesedays

    Hope you still can enjoy the 767.

    Kind regards,
    Nico

Similar Threads

  1. Landing Gear Indicators
    By gokhotit in forum FS2Phidget Users
    Replies: 13
    Last Post: 05-28-2010, 04:09 PM
  2. gear-up landing in Stuttgart
    By choffmann in forum Let's talk about what is in the NEWS
    Replies: 0
    Last Post: 09-14-2009, 04:43 PM
  3. Landing gear panel 737
    By Geremy Britton in forum My Cockpit Update
    Replies: 0
    Last Post: 02-28-2009, 11:11 AM
  4. Landing gear Bargain!
    By Jackpilot in forum General Builder Questions All Aircraft Types
    Replies: 3
    Last Post: 01-31-2009, 03:26 PM
  5. WTB: Landing gear handle
    By gokhotit in forum Phidgets & Cockpit Simulator Builder
    Replies: 0
    Last Post: 11-30-2004, 02:22 AM