Results 11 to 20 of 90
Thread: SIOC "IF" Question
-
08-11-2010, 11:57 AM #11
- Join Date
- Jul 2013
- Posts
- 917
Re: SIOC "IF" Question
Jack
Sorry for the delayed reply - the Mycockpit server fell out with me and I could not logon. Your code looks ok to me. Two suggestions - always use names not numbers when referencing variables and use lower numbers ie start from 10 - you will see why when using IOCPConsole ( when your mastercard comes)
David
-
08-12-2010, 10:59 AM #12
Re: SIOC "IF" Question
Hi David,
I have had to amend my script very slightly since the last post, just Offset changes, nothing major.
Anyway, I have a new question.
I want the LEDs to work like this:
If the precipitation is above a certain level, the LED lights up (it already does this). However, if the precipitation is above yet another level, I want it to blink/flash.
Nicos site does give advice on this but it is unfortunately timed. I want the LED to keep flashing until the precipitation has cleared (a "permenent" blink).
Any ideas?
-
08-12-2010, 12:07 PM #13
- Join Date
- Jul 2013
- Posts
- 917
Re: SIOC "IF" Question
Jack
Nico`s site does indeed have the answer! Look at the coding for "Stop a Blinking Led".
David
-
08-12-2010, 05:33 PM #14
Re: SIOC "IF" Question
Sorry David, I don't know how I could interpose that. (It's for stopping not setting a Blinking LED?)
I want it to light up if Turbulence is more than 3, but blink instead of staying continuously lit.
-
08-12-2010, 06:38 PM #15
- Join Date
- Jul 2013
- Posts
- 917
Re: SIOC "IF" Question
Jack
Perhaps I am being dim, or too much beer (quite likely), but what part of the below quote does not contribute or provide direction to what you want?
"In this example a led starts blinking at the start of the SIOC program, but you can ofcourse also take other events to start the blinking of a led. The blinking is done with a TIMER, just as in the previous example. The difference is that we now program the Timer for a very long period, it counts down from 500.000 to 0 in steps of .4 seconds, long enough for a long haul flight .
As soon as you push the button, the code attached to the button will force the Timer value to 1 step before the end value. In the next Timer operation the Timer will end and the blinking will stop"
David
-
08-12-2010, 07:28 PM #16
Re: SIOC "IF" Question
Hi David,
Really sorry, but I think I don't physically understand Nico's statement. How could I adapt his code for my needs? I am confused because his script is focused on stopping an LED rather than making it blink continously.
-
08-12-2010, 08:28 PM #17
- Join Date
- Jul 2013
- Posts
- 917
Re: SIOC "IF" Question
Jack
The first part of the code under Var0 shows how to start a led blinking almost indefinately. The remainder of the code shows how to stop it under the control of a switch. So for your needs you only need to determine the logic to start the led blinking, then use Nico`s example, followed by using the "stop code" to suit your "trigger"
Look at the code , not the "title"
David
-
08-13-2010, 03:06 PM #18
Re: SIOC "IF" Question
Hi David,
I've had a go and the script I've made looks & compiles okay. However, everything is far from complete. Basically, I do not know how to "join" the blink script and the standard LED light-up scripts together. This is because, whilst I probably could do the scripting, I just can't work it out in my head.
I'm wondering if you could have a little go for me? I would like the script to do the following:
- IF &Chain1 SW is ON, REF/OP SW is ON, and Turbulence is less than three, the LED illuminates. Otherwise, it is OFF if any one of those conditions are broken.
- Same as above, but if Turbulence is EQUAL OR MORE than three, then the LED Blinks instead of being lit. Otherwise, it is OFF/ON (but not blinking) if conditions are broken.
The current LED Lighting script:
Code:Var 7675, name REF, Link IOCARD_OUT, Output 4 // REF LED Var 7002, name OP, Link IOCARD_OUT, Output 5 // OP LED Var 9991, name OPSW, Link IOCARD_SW, Input 29, Type I // OP SW Var 8881, name REFSW, Link IOCARD_SW, Input 28, Type I // REF SW Var 9090, name Chain5, Link IOCARD_SW, Input 20 // Chain 5 Selector Var 7890, name Chain4, Link IOCARD_SW, Input 26 // Chain 4 Selector Var 7665, name Chain3, Link IOCARD_SW, Input 25 // Chain 3 Selector Var 7605, name Chain2, Link IOCARD_SW, Input 24 // Chain 2 Selector Var 7645, name Chain1, Link IOCARD_SW, Input 23 // Chain 1 Selector Var 9888, Link FSUIPC_IN, Offset $C28D, Length 1 // Cloud Precipitation Rate (1) { C0 = V9991 = 1 C1 = V8881 = 1 IF C0 OR C1 { L0 = V9888 // FSUIPC L0 = v9888 IF L0 <= 3 // First sector { IF &Chain1 = 1 // 1 selected { &REF = 1 } } ELSE // Otherwise { &REF = 0 // Off } } }
Code:Var 9888, Link FSUIPC_IN, Offset $C28D, Length 1 // Cloud Precipitation Rate (1) { C0 = V9991 = 1 C1 = V8881 = 1 IF C0 OR C1 { L0 = V9888 // FSUIPC L0 = v9888 IF L0 >= 3 // First sector { IF &Chain1 = 1 // 1 selected { &REF = 0 OR 1 &BlinkLed = 500000 // begin value of timer &BlinkLed = TIMER 0 -1 40 } } } } Var 9077, name BlinkLed { L0 = MOD &BlinkLed 2 IF L0 = 0 { &REF = 0 } ELSE { &REF = 1 } }
Thanks very much,
Jack
-
08-14-2010, 09:43 AM #19
- Join Date
- Jul 2013
- Posts
- 917
Re: SIOC "IF" Question
Jack
Sorry, but the best way is for you to persevere ( like many who have gone before you ), and when you get your Mastercard, to check what is happening (or not happening) - all as advised on previous threads. If you do not fully grasp this nettle, then you will not make progress and largely be reliant on others goodwill. I am happy to give advice on some specific issues, but do not have the time to provide a bespoke SIOC service
I do need to build my own cockpit!
David
-
08-14-2010, 05:43 PM #20
Re: SIOC "IF" Question
Hi David,
I'm now facing a new, unrelated problem.
Whenever I try and import a .txt file to SIOC using the "Config" interface, I get the following error message:
I'm using the following SIOC Script, just for testing purposes:
Code:// ***************************************************************************** // * Config_SIOC ver 3.7B1 - By Manolo Vélez - www.opencockpits.com // ***************************************************************************** // * FileName : Weather Radar System.txt // * Date : 14/08/2010 Var 7675, name REF, Link IOCARD_OUT, Output 4 // REF LED Var 7002, name OP, Link IOCARD_OUT, Output 5 // OP LED Var 9888, Link FSUIPC_IN, Offset $C28D, Length 1 // Cloud Precipitation Rate (1) { L0 = V9888 // FSUIPC L0 = v9888 IF L0 < 3 // First sector { &REF = 1 } } ELSE // Otherwise { &REF = 0 // Off } Var 9881, Link FSUIPC_IN, Offset $C28D, Length 1 // Cloud Precipitation Rate (1) { L0 = V9888 // FSUIPC L0 = v9888 IF L0 >= 3 // First sector { &REF = 0 OR 1 &BlinkLed = 500000 // begin value of timer &BlinkLed = TIMER 0 -1 40 } } } } Var 9077, name BlinkLed { L0 = MOD &BlinkLed 2 IF L0 = 0 { &REF = 0 } ELSE { &REF = 0 OR 1 } }
Similar Threads
-
"Inner Circle" HSI - SIOC DC Motors Card Script
By Boeing 747 Flyer in forum OpenCockpits General DiscussionReplies: 64Last Post: 04-21-2011, 10:59 AM -
Looking for "Below GS" and "Spoilers armed" annunciator light offset
By PeterH in forum PM General Q & AReplies: 17Last Post: 03-05-2008, 12:39 PM -
A question for "Bus Drivers"
By mpl330 in forum General Builder Questions All Aircraft TypesReplies: 2Last Post: 01-31-2008, 06:56 PM -
PM updates and a question for "proof of concept"
By pap in forum PM General Q & AReplies: 4Last Post: 01-27-2008, 06:22 AM
Embrace the freedom of casual encounters on the best dating app in town! One night stands, no...
Night games. No obligations. One...