PDA

View Full Version : SIOC Delay 'Command'



marcus_422
07-07-2010, 02:21 PM
Hi all,

Have been battling through learning SIOC today and have learnt almost everything from Nico's site so far which has been brilliant!

On the site there is the example of the delay being used to light a led:


Var 1
{
&Led = DELAY 1 400
}

Var 2 name Led Link IOCARD_OUT Output 92


I am trying to find the correct way to use this in conjunction with the CHANGEBIT. What I would like to do is something like this:


&FO_JoyStick64 = CHANGEBIT 0 1

''AFTER A DELAY OF 1 SECOND THEN..."

&FO_JoyStick64 = CHANGEBIT 0 0


Any ideas on how to go about this? My attempts so far have all resulted in errors and have included:


CHANGEBIT 0 DELAY 0 100
DELAY CHANGEBIT 0 0 100


Many thanks in advance,
Marcus

marcus_422
07-07-2010, 02:38 PM
SOLVED!

In case anyone else is reading and looking for the answer, the solution in my case was to reset the offset variable itself.



Var 1 name FO_JoyStick64 Link FSUIPC_OUT Offset $3340 Length 4

Var 2 name pb_test Link IOCARD_SW Input 3 Type I
If pb_test = 1
{
&FO_JoyStick64 = CHANGEBIT 0 1
v1 = DELAY 0 10
}

dc8flightdeck
02-26-2013, 01:09 PM
This delay timer is exactly what I needed and works like a charm! Thanks!! :)

Justin

dc8flightdeck
02-26-2013, 05:42 PM
In case they help someone, here are some timer scripts that I use.

**************************************ADI flag delay when battery turned on********************************
Var 0154, name FOflags, Link FSUIPC_INOUT, Offset $281C, Length 4 // Battery STATUS
{
IF &FOflags = 0 // Battery OFF
{
&2Flags = 0

&2Flags = DELAY 1 1200 // 12 second delay befor flag pulls
}
}
Var 0155, name 2Flags, Link IOCARD_OUT, Output 38 // F/O Gyro and Steer flags On/OFF

***********************************TIMER, INTANTLY RUN OUTPUT FOR X SECONDS****************************
Var 0097, name ground, Link FSUIPC_INOUT, Offset $0366, Length 2 // aircraft is on ground
{
IF &ground = 1 // Generator one ON
{
&Bump = CHANGEBIT 0 1
v0098 = DELAY 0 140 // run for 1.4 seconds
}
ELSE
{
&Bump = 0
}
}
Var 0098, name Bump, Link IOCARD_OUT, Output 8 // Bump relay







// ----------------------------------AP Master ON/OFF timed AP light flash------------------------------

Var 0142, name Engaged, Link FSUIPC_INOUT, Offset $07BC, Length 4 // Autopilot Master switch
{
IF &Engaged = 0
{
IF &M_AP_LGT = 0 // only start if led does not blink
{
&BlinkAP = 100 // begin value of timer
&BlinkAP = TIMER 0 -1 40
}
}
}
Var 2 name BlinkAP
{
L0 = MOD &BlinkAP 2
IF L0 = 1
{
&M_AP_LGT = 1
}
ELSE
{
&M_AP_LGT = 0
}
}

Var 0143, name M_AP_LGT, Link IOCARD_OUT, Output 32 // AP Master disengaged light flash