PDA

View Full Version : using multiple offsets with the USBOutputs card for a takeoff effect.



dc8flightdeck
02-18-2011, 05:32 PM
I want to use three offest to trigger an output with the USBOutputs card. Is this possible?

When engine one and and engine two are at full throttle and if the landing gear is down I want it to trigger an output. If either engine is not in full power or if the landing gear is up I want the output to turn off.

I can currently control the output with one of the three offsets(always the last one that is listed), but not with all three at the same time.

Here is my code where Im only using one of the three offsets since that is the only way I can currently trigger an output. How can I use all three offsets at once to control the output?

Var 0005 name lowspeed2, Link FSUIPC_INOUT, Offset $092E, Length 2 // (eng2 offset) lowspeed Afterburner Effect
Var 0006 name lowspeed3, Link FSUIPC_INOUT, Offset $0BEC, Length 4 // (nose gear offset) lowspeed Afterburner Effect
Var 0007, name Lowspeed1, Link FSUIPC_INOUT, Offset $0896, Length 2 // (eng1 offset) lowspeed Afterburner Effect
{
IF &Lowspeed1 >= 1
{
IF &Lowspeed1 <= 15000
{
&burner_on = 0
}
IF &Lowspeed1 >= 15001
{
IF &Lowspeed1 <= 16484
{
&burner_on = 1
}
}
}
}
Var 0008, name burner_on, Link IOCARD_OUT, Output 10 // Low speed afterburner effect - motor 22

Regards,
Justin

edo17982
02-18-2011, 05:54 PM
Var 0005 name Eng2, Link FSUIPC_IN, Offset $092E, Length 2 // (eng2 offset) lowspeed Afterburner Effect
{
CALL &Control
}
Var 0006 name ldgGear, Link FSUIPC_IN, Offset $0BEC, Length 4 // (nose gear offset) lowspeed Afterburner Effect
{
CALL &Control
}
Var 0007, name Eng1, Link FSUIPC_IN, Offset $0896, Length 2 // (eng1 offset) lowspeed Afterburner Effect
{
CALL &Control
}

Var 0008, name Control, Link SUBRUTINE
{
C0 = &Eng1 >= 15001
C1 = &Eng2 >= 15001
IF C0 AND C1
{
IF &LdgGear = 16383
{
&burner_on = 1
}
ELSE
{
&burner_on = 0
}
}
}
Var 0009, name burner_on, Link IOCARD_OUT, Output 10 // Low speed afterburner effect - motor 22

dc8flightdeck
02-18-2011, 08:41 PM
Thank you edo17982.

Ive been using SIOC for one week and am now learning subrutines :) This will also enable me to make some changes to other parts of the script I wrote.

One more question, Would it be possible to replace the landing gear offset with the true airspeed offset? It would be nice to have my var 0006 controlled by an airspeed of 0 to 300 knots rather than by the landing gear position. If this is possible with the USBOutputs card I need help to write this script as well, i dont understand how to use the airspeed offsets.

Regards,
Justin




Var 0005 name Eng2, Link FSUIPC_IN, Offset $092E, Length 2 // (eng2 offset) lowspeed Afterburner Effect
{
CALL &Control
}
Var 0006 name ldgGear, Link FSUIPC_IN, Offset $0BEC, Length 4 // (nose gear offset) lowspeed Afterburner Effect
{
CALL &Control
}
Var 0007, name Eng1, Link FSUIPC_IN, Offset $0896, Length 2 // (eng1 offset) lowspeed Afterburner Effect
{
CALL &Control
}

Var 0008, name Control, Link SUBRUTINE
{
C0 = &Eng1 >= 15001
C1 = &Eng2 >= 15001
IF C0 AND C1
{
IF &LdgGear = 16383
{
&burner_on = 1
}
ELSE
{
&burner_on = 0
}
}
}
Var 0009, name burner_on, Link IOCARD_OUT, Output 10 // Low speed afterburner effect - motor 22

edo17982
02-18-2011, 09:18 PM
You can do whatever you want just need to tell exactly what behavior you want to be triggered...