PDA

View Full Version : Sioc Question



Olympic260
12-25-2009, 07:10 AM
I am also puting the question here besides OC forum.

For the MIP I have used this code as reference

http://www.opencockpits.com/modules.php?op=modload&name=Forums&file=viewtopic&topic=4843&forum=8

On this the gear Indication LED are defined as, mine is the same minus the Device X and different outputs

Var 4003, Link FSUIPC_IN, Offset $0BEC, Length 4 // Nose Gear Green Offset, 0=up, 16383=dwn
{
IF V4003 = 16383
{
V4004 = 1
V4005 = 0
}
IF V4003 < 16383
{
V4004 = 0
V4005 = 1
}
IF V4003 = 0
{
V4004 = 0
V4005 = 0
}
}

Var 4004, Link IOCARD_OUT, Device 3, Output 42 // Nose Gear Green Led, 0=off, 1=on

Var 4005, Link IOCARD_OUT, Device 3, Output 41 // Nose Gear Red Led, 0=off, 1=on

Var 4006, Link FSUIPC_IN, Offset $0BF4, Length 4 // Left Gear Position Offset, 0=up, 16383=d
{
IF V4006 = 16383
{
V4007 = 1
V4008 = 0
}
IF V4006 < 16383
{
V4007 = 0
V4008 = 1
}
IF V4006 = 0
{
V4007 = 0
V4008 = 0
}
}

Var 4007, Link IOCARD_OUT, Device 3, Output 44 // Left Gear Green Led, 0=off, 1=on

Var 4008, Link IOCARD_OUT, Device 3, Output 43 // Left Gear Red Led, 0=off, 1=on

Var 4009, Link FSUIPC_IN, Offset $0BF0, Length 4 // Right Gear Position Offset, 0=up, 16383=
{
IF V4009 = 16383
{
V4010 = 1
V4011 = 0
}
IF V4009 < 16383
{
V4010 = 0
V4011 = 1
}
IF V4009 = 0
{
V4010 = 0
V4011 = 0
}
}

Var 4010, Link IOCARD_OUT, Device 3, Output 46 // Right Gear Green Led, 0=off, 1=on

Var 4011, Link IOCARD_OUT, Device 3, Output 45 // Right Gear Red Led, 0=off, 1=on

I have aslo use the following for the Light test

Var 2000, Link FSUIPC_OUT, Offset $560D, Length 1 // Light test

Var 2001, Link IOCARD_SW, Input 183
{
V2000 = CHANGEBIT 0 ,V2001
}


The problem is that when I use the light test, all LED that are defined in teh SIOC are turning ON except the 6 Gear LED. The gear LED are working fine, Green when gear down, red in trans.

Any ideas why they don't turn on with the light test?

BR

deering
12-25-2009, 12:24 PM
I don't know PM; but, from the symptoms it appears that all the other LEDs react to the status of lamp indicators in PM which, I assume, are turned on by the lamp test. Your gear indicators, follow gear positions - which are not changed by lamp test.

You could have the gear indicators follow the lamp test button directly.

Jim.

Jylhami
12-25-2009, 12:45 PM
Hi Chris,

you don't have anything else than the gear status to control the leds.

I use SUBROUTINE to get control of things, this is a copy paste from my SIOC code:

Var 0018, name FS_gearsw, Link FSUIPC_OUT, Offset $0BE8, Length 4 // Lg position, 0=up, 16383=dwn
Var 0014, name FS_nosegear, Link FSUIPC_IN, Offset $0BEC, Length 4
{
CALL &Gear
}
Var 0015, name FS_leftgear, Link FSUIPC_IN, Offset $0BF4, Length 4
{
CALL &Gear
}
Var 0016, name FS_rightgear, Link FSUIPC_IN, Offset $0BF0, Length 4
{
CALL &Gear
}

Var 0215, name Gear_SW, Link IOCARD_SW, Input 15 // Gear_sw
{
&FS_gear = &Gear_SW
CALL &Gear
}

Var 0611, name Nose_green, Link IOCARD_OUT, Device 3, Output 42 // Nose Gear Green Led, 0=off, 1=on
Var 0612, name Left_green, Link IOCARD_OUT, Device 3, Output 44 // Left Gear Green Led, 0=off, 1=on
Var 0613, name Right_green, Link IOCARD_OUT, Device 3, Output 46 // Right Gear Green Led, 0=off, 1=on
// Var 0614, name Gear_transit, Link IOCARD_OUT, Output 14

Var 0806, name Gear, Link SUBRUTINE
{
IF &TestSW = 1
{
&Gear_transit = 1
&Nose_green = 1
&FS_rightgear = 1
&Left_green = 1
}
ELSE
{
IF &FS_nosegear < 16383
{
&Gear_transit = 1
&Nose_green = 0
}
IF &FS_nosegear = 0
{
&Gear_transit = 0
}
IF &FS_nosegear = 16383
{
&Nose_green = 1
&Gear_transit = 0
}
IF &FS_leftgear = 16383
{
&Left_green = 1
}
ELSE
{
&Left_green = 0
}
IF &FS_rightgear = 16383
{
&Right_green = 1
}
ELSE
{
&Right_green = 0
}
}
}

Var 2001, name TestSW, Link IOCARD_SW, Input 183
{
CALL &Gear
}

At the end i added your link for your test switch, and added it in the Gear subroutine.

All variables you can easily change in one place, because all is working with names

I have changed these exept the gear switch input.

Hope this helps,

BW:Mika

Olympic260
12-26-2009, 06:02 AM
Thank you for your answers guys,

Mika I will try this on my SIOC on the first chance.

BR

Olympic260
12-26-2009, 02:48 PM
Mika,

it woked just fine, I made some slight changes to better suit my needs but thank you very much for the help


. Finaly the MIP is 99% ready from swtches LED and SIOC, only copilot six packs master caution and Fire Warning missing :)


http://www.youtube.com/watch?v=ITVhdpDcobo

Jylhami
12-26-2009, 03:24 PM
Glad it helped you out !

It was just copy-paste code snippled, not tested.

Nice Work you got :)

conicio
02-01-2010, 08:50 PM
Perhaps you should call the light test routine from every VAR of the gear leds, i.e. If VarXXX = 1 then VarYYYY=1 or maybe a call subroutine Var (call varXXXX)
Regards