Results 1 to 8 of 8
  1. #1
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Mar 2014
    Location
    Berlin
    Posts
    6
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    SIOC coding help!!!

    Hey all,
    I'm working on the coding for my APU panel which has 5 Korry switches. In SIOC, each LED/Switch works separate. I'm having a problem thinking up how to code it though. Can anyone help? I'm trying, as a test, to set it up so that when button 4 is pressed, no LED will turn on unless Button 3 is pressed, which also will not have an LED light up unless Button 1 is pressed. Button 1's LED will only stay on after Button 2 is pressed after Button 1, and Button 2's LED will only turn on if Button 1 is pressed, and only for 10 seconds.
    Does that make any sense?
    Here's a picture of the panel I'm working with, to hopefully understand why there's a flow to the LEDs depending on each switch state (on or off, or pressed).
    Button 1 - Power
    Button 2 - Start
    Button 3 - Generator
    Button 4 - Bleed Air

    The APU start procedure actually goes like this:
    POWER button is turned on. The LEDs in all 5 will blink in sequence to run a test. (I'm still trying to figure that out too) After the LED test, no lights will turn on. Pressing START will activate the STARTER LED in the start button for 10 seconds, at which time the LED will go out, the RUN LED in the POWER button and WARN LED in the GEN button will light up. Pressing the GEN button will change from WARN to RUN. Now the BL AIR button will light up when pressed.

    I would be happy if someone could help me write this code... at least the beginning part after the LED test. My problem is having 1 LED light up only when 2 buttons are pressed like in the case of the START led after the POWER is turned on...

    Regards,
    Jack
    Attached Images Attached Images

  2. #2
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Mar 2014
    Location
    Berlin
    Posts
    6
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: SIOC coding help!!!

    Does anyone know if this is possible, or is it just quiet in these forums?

  3. #3
    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: SIOC coding help!!!

    It is certainly possible. However, I have no time at the moment to help you out.
    Nico

  4. #4
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Mar 2014
    Location
    Berlin
    Posts
    6
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: SIOC coding help!!!

    Quote Originally Posted by kiek View Post
    It is certainly possible. However, I have no time at the moment to help you out.
    Nico
    That's sort of the problem I am running into all over. Either nobody has the time to help explain it, or they don't know how to do it. I've been trying to figure out this SIOC annoyance for the last 4 or 5 weeks.

  5. #5
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: SIOC coding help!!!

    Jack

    As you suggest, that the reason you have had little response is to develop sioc coding is quite time consuming. The coding you need as outlined above does not flow off the pen! Also, it rarely works as intended first time and often the original logic is either flawed or does not cover all eventualities. So, the only real answer is to do it yourself. This is not as daunting as you think it might be. We all started somewhere and the secret is to build up your coding in small sections, learning and understanding as to go - there is no quick answer.

    So, I suggest that you start with the simple logic steps, getting one or two leds to turn on or off depending on switch combinations. Using the IOCPConsole log function is very useful as you can see what is happening within your code and amend accordingly.

    Nico`s site has a wealth of examples you will need such as logic flow and keeping a led lit for 10 seconds etc.
    The other bit of missing information which will help is the use of Boolean logic. For example, to turn on a led only when two switches are both set can easily be coded as

    C0 = &switch1 = 1 // Co is an internal logic variable that will be set to logic 1 if &switch = 1
    C1 =&switch2 = 1 // ditto for &switch 2
    IF C0 AND C1 // so only if both switches are set will both C0 and C1 have the value of 1 and then turn on the Led
    {
    &led1 = 1
    }
    I have not bothered with variable definitions above, but the code and some reading should help. You can also achieve the same by using lots of IF statements but the logic flow can get difficult to follow.

    So, Jack, just dive in and try the coding - you may be surprised

    David
    Last edited by fordgt40; 10-25-2015 at 05:32 PM. Reason: added missing IF to code

  6. #6
    Our new friend needs to reach 10 posts to get to the next flight level BuzziBi's Avatar
    Join Date
    Mar 2013
    Location
    Norway
    Posts
    6
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: SIOC coding help!!!

    Life was hard, but then came Windows 7.
    Now we can fly! --------
    --------

  7. #7
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Mar 2014
    Location
    Berlin
    Posts
    6
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: SIOC coding help!!!

    Quote Originally Posted by fordgt40 View Post
    So, Jack, just dive in and try the coding - you may be surprised

    David
    Thank you David,
    that's actually an answer that points me in a better direction. I've seen all of Nico's examples, and while I can do the very basics, this panel has had me stuck. Like, dead in the water with no paddle type of stuck. I'll try and see what I can come up with, again. If the boolean works, great! The problem that I have had lately isn't with the examples, but trying to get them to work together. I can get 1 Korry to light 2 LEDs when needed, but not multiples. I'll post the coding if I have issues... maybe you can check it and help me correct it.

    Thanks,
    Jack

  8. #8
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: SIOC coding help!!!

    Jack

    If you put the effort in and give it a good try, then I can offer suggestions etc.

    David