Results 1 to 8 of 8
Thread: SIOC coding help!!!
-
10-19-2015, 07:22 AM #1
- Join Date
- Mar 2014
- Location
- Berlin
- Posts
- 6
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
-
10-24-2015, 12:49 PM #2
- Join Date
- Mar 2014
- Location
- Berlin
- Posts
- 6
Re: SIOC coding help!!!
Does anyone know if this is possible, or is it just quiet in these forums?
-
10-25-2015, 01:54 AM #3
Re: SIOC coding help!!!
It is certainly possible. However, I have no time at the moment to help you out.
Nico
-
10-25-2015, 04:09 AM #4
- Join Date
- Mar 2014
- Location
- Berlin
- Posts
- 6
-
10-25-2015, 07:04 AM #5
- Join Date
- Jul 2013
- Posts
- 917
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
DavidLast edited by fordgt40; 10-25-2015 at 05:32 PM. Reason: added missing IF to code
-
10-25-2015, 07:05 AM #6
- Join Date
- Mar 2013
- Location
- Norway
- Posts
- 6
Re: SIOC coding help!!!
Maby some help here: http://www.lekseecon.nl/howto.html#led
Life was hard, but then came Windows 7.
Now we can fly! -------- --------
-
10-25-2015, 07:48 AM #7
- Join Date
- Mar 2014
- Location
- Berlin
- Posts
- 6
Re: SIOC coding help!!!
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
-
10-25-2015, 08:17 AM #8
- Join Date
- Jul 2013
- Posts
- 917
Re: SIOC coding help!!!
Jack
If you put the effort in and give it a good try, then I can offer suggestions etc.
David
Explore Exciting Connections for a Night of Fun in Your City
Ready for an Unforgettable Night?...