Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21
  1. #11
    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: Can SOIC handle switch bounce?

    John,
    Peter is right,

    Code:
     
    &canopysw = 1
    should be

    Code:
     
     v8000 = 1
    like in my example code.


    I am a bit surprised about the FSUIPC offset popping up... I thought you hade a problem with a bouncing switch? I don't think you should
    mix up these two. Get a 'clean' value for your switch first and then continue with the FSUIPC offset.

    What do you want to do with that FSUIPC offset in relation to your switch?

    regards,
    Nico

  2. #12
    300+ Forum Addict jmig's Avatar
    Join Date
    Apr 2007
    Location
    Lafayette, LA USA
    Posts
    422
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can SOIC handle switch bounce?

    Hi Nico & Peter,

    Thanks for your expert eyes and SOIC minds helping. The reason I changed the V=8000 to &canopysw was, SOIC's complier kept giving me an error with v=8000. (Command out of place) I checked and I had typed it as Nico suggested, with the changing of Var #s to their named counterparts.

    I didn't know if I could mix Var 8000 with names and, I thought maybe that was the problem? When I changed it to &canopysw it worked????

    As to what I want to accomplish:
    This is a fighter cockpit. Fighters (at least when I flew them) start with the canopy open. I want to be able to load a FSX fighter and have the canopy open during start up and checks.

    I then want to move the lever and connect the switch. The canopy should then close. I want the code to detect if the lever is forward (canopy closed) or backward (canopy open) and have SOIC set the FSX canopy to be in sync with my lever.

    What I am experiencing is that the FSX airplanes always start with the canopy closed. I guess I could save a flight back in the chocks cold & dark with the canopy open? However, unlike you guys I will fly a dozen different airplanes from the T-6II or T-45 trainers to the F-16 or F18.

    I thought the manual cockpit switch and SOIC could handle the syncing of the virtual and real cockpits?

    Does this make sense to you?
    John

    System:
    ASUS P5Q SE/R
    Intel Q9550 O/C to 3.4 GHz
    4 GB 1066 DDR2 RAM
    300 GB WD 10,000 RPM Raptor SATA Drive
    GeForce 8800 GT 512 KB RAM
    Matrox TH2Go with three 19" Sumsung 940 BX
    IR Track 4

  3. #13
    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: Can SOIC handle switch bounce?

    Aha, now I understand!
    I thought you had a typo in the name cancopy... being a 767 pilot I did not know what a canopy is, had to look that up in the english dictionary

    It should be possible to synchronise, you could try this code:

    Code:
     
    Var 8000 name semaphore Value 0
    Var 8001 name canopyswitch Link IOCARD_SW Input 7 Type I
    {
      IF &semaphore = 0
      {
        &semaphore = 1
        v8002 = DELAY &canopyswitch 50 // assign after .5 delay
      }
    }
    Var 8002
    { 
      &semaphore = 0
      &canopy = &canopyswich
    } 
    Var 8003 name canopy Link FSUIPC_OUT Offset $3367 Length 1
    Nico
    BTW it is SIOC not SOIC ...

  4. #14
    300+ Forum Addict jmig's Avatar
    Join Date
    Apr 2007
    Location
    Lafayette, LA USA
    Posts
    422
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can SOIC handle switch bounce?

    Quote Originally Posted by kiek View Post
    Aha, now I understand!
    I thought you had a typo in the name cancopy... being a 767 pilot I did not know what a canopy is, had to look that up in the english dictionary


    BTW it is SIOC not SOIC ...
    Okay class, today's lesson will be a Topsy turby class on "Yanking and Banking" followed tomorrow by a hi-pressure and fiery class on G-forces and Afterburners.

    I gotta teach you guys what "real" flying is like,

    Thanks for the code, Nico. I will try it and let you know.

    P.S. didn't I tell you I am dyslexic? Really am!
    John

    System:
    ASUS P5Q SE/R
    Intel Q9550 O/C to 3.4 GHz
    4 GB 1066 DDR2 RAM
    300 GB WD 10,000 RPM Raptor SATA Drive
    GeForce 8800 GT 512 KB RAM
    Matrox TH2Go with three 19" Sumsung 940 BX
    IR Track 4

  5. #15
    300+ Forum Addict jmig's Avatar
    Join Date
    Apr 2007
    Location
    Lafayette, LA USA
    Posts
    422
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can SOIC handle switch bounce?

    Well Nico & Peter, thanks to you two I have the canopy switch working. Thanks.

    FSX is still being FSX, however. When the airplane is loaded into FSX the canopy is closed. I have to use the shift-e to open it, then my switch will work correctly.

    I tried saving a flight with the canopy open. When you load the flight, the canopy is closed. Grurrrrrr!

    I don't know how to get the flight to load with an open canopy?
    John

    System:
    ASUS P5Q SE/R
    Intel Q9550 O/C to 3.4 GHz
    4 GB 1066 DDR2 RAM
    300 GB WD 10,000 RPM Raptor SATA Drive
    GeForce 8800 GT 512 KB RAM
    Matrox TH2Go with three 19" Sumsung 940 BX
    IR Track 4

  6. #16
    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: Can SOIC handle switch bounce?

    This might be related to the fact that if you start SIOC before you load a fighter flight, the SIOC code has been executed (according to the position of your switch) before the Flight is loaded.

    You could try to start SIOC after you have loaded your (saved with open canopy) fighter flight...

    Nico

  7. #17
    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: Can SOIC handle switch bounce?

    Hi there,

    some time ago had made a script which did something regarding the fuel status of a plane.
    Some problem that occurred with this is that when I loaded a new plane the fuel tank size
    changes and my script needed to get a trigger to recalculate some things. I had this solved
    by also reading the planes id on some offset, dont know exatly anymore which offset. But if you like I could find it back. The thing is that in the case the name, or tail number changes that offset changed and without caring of whats the value in it, you can let the script then update the canopy fsuipc offset to align with the state of the canopy switch.
    This could also solve the fact if sioc is running before fs is running.
    Try and error...thats the way to learn in this case...sioc is powerfull enough to accomodate
    clever things ...

    Also, in my setup, wideFS starts when the computer starts but wideFS starts SIOC only when
    widefs connected to FS. This is a feature of widefs. I think it is something called RunDelay or Run ...
    If FS starts, with a fighter with closed canopy, a little later the SIOC is started and the canopy
    should take the state of the canopyswitch.

    Greetz Peter
    FS9+PM+AST+opencockpits

  8. #18
    300+ Forum Addict jmig's Avatar
    Join Date
    Apr 2007
    Location
    Lafayette, LA USA
    Posts
    422
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can SOIC handle switch bounce?

    Those are good idea Peter & Nico. I could set FSUIPC to start SIOC. However, if I change aircraft without closing and restarting FSX, I would be back where we started.

    The offset used for the canopy is a toggle offset. Is there a way to send a one time toggle to the offset right after the aircraft loads and, then run the switch position routine?

    Could I just start the canopy routine with a toggle command and then initialize it to the switch position?

    Just thinking out loud here. Thanks again for all of your suggestions.
    John

    System:
    ASUS P5Q SE/R
    Intel Q9550 O/C to 3.4 GHz
    4 GB 1066 DDR2 RAM
    300 GB WD 10,000 RPM Raptor SATA Drive
    GeForce 8800 GT 512 KB RAM
    Matrox TH2Go with three 19" Sumsung 940 BX
    IR Track 4

  9. #19
    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: Can SOIC handle switch bounce?

    Hi Jmig,

    that is exactly what I was trying to explain. Give your different fighters in FS a different plane tail ids
    Example
    Var 0007, name Lv_PlaneId, Link FSUIPC_IN, Offset $313C, Length 4
    {
    // assuming one of the airbus setups
    &Lv_Plane = 0
    // check for twin otter C-GND
    if &Lv_PlaneId = 1313287491
    {
    &Lv_Plane = 1
    }
    // check for learjet N456
    if &Lv_PlaneId = 909456462
    {
    &Lv_Plane = 2
    }
    // check for beechcraft baron 58 with N058SN or N058BE
    // for the moment we will treat beech baron 58 as the twin otter
    if &Lv_PlaneId = 943009870
    {
    &Lv_Plane = 1
    }
    }

    Var 0008, name Lv_Plane
    {
    send here the canopy trigger to FS
    }

    In above script only the four first letters of the plane id are taken into account
    and if your plane changes then the Lv_Plane variable will change and here you can trigger
    the a change of the canopy

    PS : this is a piece of my SIOC script and depending on which plane is loaded the script will
    behave different upon the same hardware inputs
    Greetz Peter
    FS9+PM+AST+opencockpits

  10. #20
    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: Can SOIC handle switch bounce?

    Hi, I was just looking at the FSUIPC offset table in the project magenta site and noticed
    the following offset :
    3364 1 FS2004 “Ready to Fly” indicator. This is non-zero when FS is loading, or reloading a
    flight or aircraft or scenery, and becomes zero when flight mode is enabled (even
    if the simulator is paused or in Slew mode).

    Possibly interesting to solve some problems as in the previous post

    greetz Peter
    FS9+PM+AST+opencockpits

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. HELP, i am totally lost with SOIC
    By Jasmckee in forum OpenCockpits General Discussion
    Replies: 1
    Last Post: 07-06-2010, 03:21 AM
  2. 737 reverser handle
    By ivar hestnes in forum General Builder Questions All Aircraft Types
    Replies: 0
    Last Post: 04-11-2009, 06:18 PM
  3. Sound for Flaps Handle
    By flightdeck in forum PM General Q & A
    Replies: 2
    Last Post: 02-17-2008, 04:24 PM