Var 0001, name e1bleed, Link FSUIPC_INOUT, Offset $206C, Length 8, Numbers 0 //this is bleed air pressure for ENG1 from FSUIPC I did not use this in m'y logic, it may be used if this is above some psi value the main relay for bleed available can be activated
Var 0002, name e2bleed, Link FSUIPC_INOUT, Offset $216C, Length 8, Numbers 0 //this is bleed air pressure for ENG2 from FSUIPC I did not use this in m'y logic, it may be used if this is above some psi value the main relay for bleed available can be activated
Var 0003, name 739C, Link FSUIPC_INOUT, Offset $739C, Length 1 // JH Led Offsets
{
CALL &APUBLEEDON
}
Var 0004, name 739A, Link FSUIPC_INOUT, Offset $739A, Length 1 // JH Led Offsets
{
CALL &APUBLEEDON
}
Var 0005, name AproblèmeLEEDON, Link SUBRUTINE
{
L0 = TESTBIT &739C ,2 // to find out if APU START AVAIL Led is ON
L1 = TESTBIT &739A ,3 // to find out if APU BLEED ON Led is ON
IF L1 = 1
{
IF L0 = 1
{
&APUBLEEDON = 1 // if both APU START AVAIL led and APU BLEED ON leds are turned on then set APUBLEEDON variable to 1
}
ELSE
{
&APUBLEEDON = 0 //otherwise set APUBLEEDON variable to 0
}
}
ELSE
{
&APUBLEEDON = 0 //otherwise set APUBLEEDON variable to o
}
}
Var 0006, name 7399, Link FSUIPC_INOUT, Offset $7399, Length 1 // JH led offsets
{
CALL &PACK1OFFFLAG
CALL &PACK2OFFFLAG
}
Var 0007, name PACK1OFFFLAG, Link SUBRUTINE
{
L0 = TESTBIT &7399 ,1 //check if PACK1 led is OFF
IF L0 = 1
{
&PACK1OFFFLAG = 1 //if PACK1 led is OFF sets PACK1OFFFLAG to 1
}
ELSE
{
&PACK1OFFFLAG = 0 //otherwise PACK1OFFFLAG is 0
}
}
Var 0008, name PACK2OFFFLAG, Link SUBRUTINE
{
L0 = TESTBIT &7399 ,3 //check is PACK2 led is OFF
IF L0 = 1
{
&PACK2OFFFLAG = 1 //if PACK2 led is OFF sets PACK2OFFFLAG to 1
}
ELSE
{
&PACK2OFFFLAG = 0 //otherwise PACK2OFFFLAG is 0
}
}
Var 0009, name ENG1COMB, Link FSUIPC_INOUT, Offset $0894, Length 2 //FSUIPC offset for ENG1 running, TRUE if running
Var 0010, name ENG2COMB, Link FSUIPC_INOUT, Offset $092C, Length 2 //FSUIPC offset for ENG2 running, TRUE if running
Var 0011, name TIME4, Link FSUIPC_INOUT, Offset $023A, Length 1 // this is seconds from FSUIPC which changes all the time, In order for a command to function the variable must always change, so this is a silly solution to run the LOGICPACK LOGICENG and MAINLOGIC loops all the time ?
{
CALL &LOGICPACK
CALL &LOGICENG
CALL &MAINLOGIC
}
Var 0012, name LOGICPACK, Link SUBRUTINE
{
IF &PACK1OFFFLAG = 1
{
IF &PACK2OFFFLAG = 1
{
&ONEPACKAVAIL = 0 //at least one PACK is not available
}
ELSE
{
&ONEPACKAVAIL = 1 //at least one PACK is available
}
}
ELSE
{
&ONEPACKAVAIL = 1
}
}
Var 0013, name ONEPACKAVAIL
Var 0014, name ONEGINEAVAIL
Var 0015, name LOGICENG, Link SUBRUTINE
{
IF &ENG1COMB = 0
{
IF &ENG2COMB = 0
{
&ONEGINEAVAIL = 0 //at least one engine is not running
}
ELSE
{
&ONEGINEAVAIL = 1 //at least one engine is running
}
}
ELSE
{
&ONEGINEAVAIL = 1
}
}
Var 0016, name MAINLOGIC, Link SUBRUTINE
{
IF &ENG1COMB <> 1 //engine1 is not running
{
IF &ENG2COMB <> 1 //engine 2 is not running
{
IF &APUBLEEDON = 1 //APUBLEEDON is 1
{
IF &ONEPACKAVAIL = 1 // and at least one PACK is available
{
&RBLEEDAVAIL = 1 //SETS RBLEEDAVAIL to 1
}
ELSE
{
&RBLEEDAVAIL = 0
}
}
ELSE
{
&RBLEEDAVAIL = 0
}
}
ELSE
{
CALL &MAINLOGICENGON
}
}
ELSE
{
CALL &MAINLOGICENGON
}
}
Var 0017, name MASTERRELAY
Var 0018, name MAINLOGICENGON, Link SUBRUTINE
{
IF &ONEGINEAVAIL = 1 //at least one engine is running
{
IF &ONEPACKAVAIL = 1 //at least one pack is available
{
&RBLEEDAVAIL = 1 //sets RBLEEDAVAIL to 1 (which is the master relay)
}
ELSE
{
&RBLEEDAVAIL = 0
}
}
ELSE
{
&RBLEEDAVAIL = 0
}
}
SIOC CODE PACKFLOW SELECTORS
Var 0001, name PACKFLOWLOW, Link IOCARD_SW, Device 87, Input 26, Type I
{
IF &PACKFLOWLOW = 1
{
&78EE = 44
&RPACKLOW = 1
}
ELSE
{
&RPACKLOW = 0
}
}
Var 0002, name PACKFLOWNORM, Link IOCARD_SW, Device 87, Input 23, Type I
{
IF &PACKFLOWNORM = 1
{
&78EE = 45
&RPACKNORM = 1
}
ELSE
{
&RPACKNORM = 0
}
}
Var 0003, name PACKFLOWHI, Link IOCARD_SW, Device 87, Input 25, Type I
{
IF &PACKFLOWHI = 1
{
&78EE = 46
&RPACKHI = 1
}
ELSE
{
&RPACKHI = 0
}
}