Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    10+ Posting Member MicroHellas's Avatar
    Join Date
    Aug 2008
    Location
    Greece
    Posts
    18
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    What's going wrong in my SIOC code?

    Hello,

    Could you please someone point to my error on the following code? Gears Up/Down work fine, but I'm not able to make the led to light

    Code:
    // *****************************************************************************
    // * Config_SIOC ver 3.5   -     By Manolo Velez    -    www.opencockpits.com
    // *****************************************************************************
    // * FileName : pilot_console.txt
    // * Date : 21/8/2008
    
    
    
    Var 0300, Value 0     // Gear Initialization
    {
      &GEAR = 16383    
    }
    
    Var 0301, name GEAR, Link FSUIPC_INOUT, Offset $0BE8, Length 4, Value 16383
    
    Var 0305, name GEAR_LIGHT, Link IOCARD_OUT, Output 27
    
    Var 0306, name GEARS_SWITCH, Link IOCARD_SW, Input 34
    {
      IF &GEARS_SWITCH = 1
      {
        &GEAR = 16383    
        &GEAR_LIGHT = 1    
      }
      ELSE
      {
        &GEAR = 0    
        &GEAR_LIGHT = 0    
      }
    }
    Thank you
    Maria

  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

    Hello Maria,

    There is nothing wrong with your program. It works over here... Are you sure that you are using a valid output? Have you checked the led with Controlador?

    Of course you could improve your code a little bit by:
    * using FSUIPC_OUT instead of FSUIPC_INOUT (since you are not using the value coming from FSUIPC);
    * making the type of switch used more explicit by adding Type I (default);
    * by initialising variable &GEAR only once, now you as well initialise in Value 0 and by adding initial value to the GEAR variable. You can leave out one of the two.

    But like I said before, even without these improvements it should work...

    Here is an even better program, that will also lit the led when you move the Gear in your panel:

    Var 301 name GEAR Link FSUIPC_INOUT Offset $0BE8 Length 4 Value 16383
    {
    IF &GEAR = 16383
    {
    &GEAR_LIGHT = 1
    }
    ELSE
    {
    &GEAR_LIGHT = 0
    }
    }

    Var 305 name GEAR_LIGHT Link IOCARD_OUT Output 27

    Var 306 name GEARS_SWITCH Link IOCARD_SW Input 34 Type I
    {
    IF &GEARS_SWITCH = 1
    {
    &GEAR = 16383
    }
    ELSE
    {
    &GEAR = 0
    }
    }


    regards,
    Nico Kaan
    http://www.lekseecon.nl

  3. Thanks MicroHellas thanked for this post
  4. #3
    10+ Posting Member MicroHellas's Avatar
    Join Date
    Aug 2008
    Location
    Greece
    Posts
    18
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hello Nico,

    Thank you so much. By the chance my congratulations for the contents of your site. I've been there many times reading your SIOC articles. Could you please allow me a childish question (don't forget that I'm blond too ). Is this lekseecon only about B767? If not could you please point me to an article where I can get a global idea about it?

    Quote Originally Posted by kiek View Post
    Have you checked the led with Controlador?
    That's another pitty story. I don't know how to check it. I found a good tutorial for it, but it covers only instructions for inputs, so I was able to check only them. Don't know how to check outputs, displays etc.

    Opencockpits sure they've great products but, sorry to say, from my experiance they've zero support. Even if I placed already 3 orders, spending around 1,000 Euros, they're replying only to my pre-sales questions and never to my support questions. Also their forums look like died. Only few posts have been replied there among dozens of others waiting a reply. Finally, for some cards (eg encoders cards) there is no manual, so I don't know (for example) where I must connect the 3pins of an encoder while their input is for 4 pins.

    Thank you again
    Maria

  5. #4
    10+ Posting Member MicroHellas's Avatar
    Join Date
    Aug 2008
    Location
    Greece
    Posts
    18
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Quote Originally Posted by kiek View Post
    Var 306 name GEARS_SWITCH Link IOCARD_SW Input 34 Type I
    Where I can find a refference for the available types? I needed them when firstly I used the graphics interface for coding.

    Maria

  6. #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

    Quote Originally Posted by MicroHellas View Post
    Where I can find a refference for the available types? I needed them when firstly I used the graphics interface for coding.

    Maria
    You can find (all) that information in the Help menu of the Config_Sioc.exe tool.

    Nico

  7. #6
    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

    Quote Originally Posted by MicroHellas View Post
    Is this lekseecon only about B767?
    Yes, because the Level-D 767 is shipped with a Sofware Development Kit (SDK). It's the only Flight Sim addon that offers this facility.

    Quote Originally Posted by MicroHellas View Post
    Don't know how to check outputs, displays etc.
    Just fill in an output number and 'tick' it ON...

    Quote Originally Posted by MicroHellas View Post
    Finally, for some cards (eg encoders cards) there is no manual, so I don't know (for example) where I must connect the 3pins of an encoder while their input is for 4 pins.
    Maria
    I would not use encoder cards. Use grey type encoders, you can connect these encoders directly to two consecutive logical inputs of the Master card.

    Nico

  8. #7
    500+ This must be a daytime job
    Join Date
    Nov 2005
    Location
    rotterdam, the Netherlands, Europe
    Posts
    898
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Quote Originally Posted by MicroHellas View Post
    Finally, for some cards (eg encoders cards) there is no manual, so I don't know (for example) where I must connect the 3pins of an encoder while their input is for 4 pins.




    if you use single encoders i suggest you use the ones they sell. dead cheap and can be directly connected to the mastercard (without the encoder card).

    If you use dual concentrics (so far i havent found dual concentrics that work directly on the master card) then use this schematic for the encoder card.
    Pin 4 (+5v) is only needed for optical encoders.

    Stef
    www.boeing737ng.com
    ___________________________
    The Dutch 737 Simulator Project

  9. Thanks MicroHellas thanked for this post
  10. #8
    10+ Posting Member MicroHellas's Avatar
    Join Date
    Aug 2008
    Location
    Greece
    Posts
    18
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Quote Originally Posted by dnoize View Post
    if you use single encoders i suggest you use the ones they sell. dead cheap and can be directly connected to the mastercard (without the encoder card).

    Thank you Stefane

    Yes, I'm using using their encoders and rotary switches that I bought from them. But as I've seen they've 3 pins while the mastercard has 2 pins. Same applies for potentiometers? How I can connect them to mastercard?

    Maria

  11. #9
    150+ Forum Groupie pdpo's Avatar
    Join Date
    Nov 2005
    Location
    belgium
    Posts
    280
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Maria,

    the optical encoders (CTS288 type, like OC sell) have three pins and you should look on them like follows :
    pin 1 : (right pin) switch 1
    pin 2 : (middle pin) ground
    pin 3 : (left pin) switch 2

    now you connect the ground pin to a ground of an input group on the mastercard
    and you connect the two other pins to two consecutive inputs of that input group
    depending from which side you look at the rotary you will swap the two outer pins
    but this doesnt make much difference. The only thing you will notice is that the
    turn direction will change in the software. I mean ... when turning right the value
    you receive in the SIOC will be positive or negative. Swapping the 2 inputs will change
    this.

    Thats it....

    Greetz Peter

  12. #10
    500+ This must be a daytime job
    Join Date
    Nov 2005
    Location
    rotterdam, the Netherlands, Europe
    Posts
    898
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    its been ages since ive used opencockpit cards so i hope i stll remember correctly (if not, nico please jump in )

    the rotary encoders they sell are grey type. you can connect them directly to the master card and should use consecutive inputs.
    In each input group there is 1 commone ground.

    from their manual:
    ANNEX II. Programming and Configuration
    Page 20 of 56
    Manual Version 1.1
    Software Version 1.7
    03/10/03
    In TIPO (type) we will write the following values depending
    on the type of rotary switch that we are using:
    - Blank if we are using a rotary switch.
    - 1 if we are using 2 phased out digital encoders. They need
    an additional circuit (available at Annex III) and use two
    inputs instead three.
    - 2 if we are using 2 bits Gray type encoders. They don't
    need additional circuits.

    If i remember well you cant connect potentiometers to the mastercard.
    They have the usbaxes card for that. Also some of their other cards like the usb servos card have some analog inputs for potentiometers.

    Stef
    www.boeing737ng.com
    ___________________________
    The Dutch 737 Simulator Project

Page 1 of 2 12 LastLast

Similar Threads

  1. SIOC Elevator Pot Code
    By tomenglish2000 in forum OpenCockpits General Discussion
    Replies: 0
    Last Post: 09-28-2009, 07:26 AM
  2. SIOC Code for MCP, MIP, and TQ updated
    By BoeingNG in forum OpenCockpits General Discussion
    Replies: 3
    Last Post: 08-10-2008, 06:53 PM
  3. Sixpack SIOC code
    By dcutugno in forum PMSystems
    Replies: 0
    Last Post: 12-16-2007, 04:55 PM
  4. ALT , FLT LDG, Displays and ENC SIOC code
    By dcutugno in forum PMSystems
    Replies: 0
    Last Post: 12-10-2007, 07:10 PM
  5. SIOC Code
    By Polmer in forum I/O Interfacing Hardware and Software
    Replies: 6
    Last Post: 12-28-2006, 10:49 AM