SIOC – MIP Indicators

8/29/13 NOTE:  I’ve noticed sometimes even with this code the indicators still light up so I need to back through it and test some more.

Below is the code I use for my MIP Indicators to correct an issue where the 737NGX sends “on” values for indicators that should be off while in a ‘Cold and Dark’ state.

It’s setup so if the battery switch on the overhead is off all the Leds are off. If it’s on it will then check the indicator state and set the indicator accordingly.

Feel to use but you will need to update Device/Output numbers for your hardware.

var 1 name battery_state LINK FSUIPC_IN Offset $6475 Length 1 // state
{

	IF &battery_state = 1
	{

		CALL &mastersub
		CALL &firesub
		CALL &apsub
		CALL &atsub
		CALL &fmcsub
		CALL &fltsub
		CALL &irssub
		CALL &fuelsub
		CALL &elecsub
		CALL &apusub
		CALL &ovhtsub
		CALL &antisub
		CALL &hydsub
		CALL &doorsub
		CALL &engsub
		CALL &ovhdsub
		CALL &airsub
		CALL &nosegsub
		CALL &leftgsub
		CALL &rightgsub
		CALL &nosersub
		CALL &leftrsub
		CALL &rightrsub
		CALL &antibsub
		CALL &autobsub
		CALL &sbnoarmsub

	}
	ELSE
	{

		&master_led = 0
		&fire_led = 0
		&ap_led = 0
		&at_led = 0
		&fmc_led = 0
		&FLT_LED = 0
		&IRS_LED = 0
		&FUEL_LED = 0
		&ELEC_LED = 0
		&APU_LED = 0
		&OVHT_LED = 0
		&ANTI_LED = 0
		&HYD_LED = 0
		&DOOR_LED = 0
		&ENG_LED = 0
		&OVH_LED = 0
		&AIR_LED = 0
		&nose_g_led = 0
		&left_g_led = 0
		&right_g_led = 0
		&nose_r_led = 0
		&left_r_led = 0
		&right_r_led = 0
		&antib_led = 0
		&autobrake_led = 0
		&spoilnoarm_led = 0
	}
}

//********************************************* 
//********** ALARM INDICATORS  
//********************************************* 

var 2 name master_led Link IOCARD_OUT Device 0 Output 39  //  Master Caution LED
var 3 name master_state LINK FSUIPC_IN Offset $6506 Length 1 // Master Caustion state
	{
	CALL &mastersub
	}
VAR 4 name mastersub Link SUBRUTINE
{ 
	IF &master_state = 0
	{
		&master_led = 0
	}
	ELSE
	{
		&master_led = 1
	}
}

var 5 name fire_led Link IOCARD_OUT Device 0 Output 40  //  Fire warn LED
var 6 name fire_state LINK FSUIPC_IN Offset $6504 Length 1 // Fire Warn state
	{
	CALL &firesub
	}
VAR 7 name firesub Link SUBRUTINE
{ 
	IF &fire_state = 0
	{
		&fire_led = 0
	}
	ELSE
	{
		&fire_led = 1
	}
}

var 8 name ap_led Link IOCARD_OUT Device 0 Output 20  //  AP LED
var 9 name ap_state LINK FSUIPC_IN Offset $6550 Length 1 // AP state
	{
	CALL &apsub
	}
VAR 10 name apsub Link SUBRUTINE
{ 
	IF &ap_state = 0
	{
		&ap_led = 0
	}
	ELSE
	{
		&ap_led = 1
	}
}

var 11 name at_led Link IOCARD_OUT Device 0 Output 21  //  Autothrottle LED
var 12 name at_state LINK FSUIPC_IN Offset $6552 Length 1 // Autothrottle state
	{
	CALL &atsub
	}
VAR 13 name atsub Link SUBRUTINE
{ 
	IF &at_state = 0
	{
		&at_led = 0
	}
	ELSE
	{
		&at_led = 1
	}
}

var 14 name fmc_led Link IOCARD_OUT Device 0 Output 35  //  FMC LED
var 15 name fmc_state LINK FSUIPC_IN Offset $6554 Length 1 // FMC state
	{
	CALL &fmcsub
	}
VAR 16 name fmcsub Link SUBRUTINE
{ 
	IF &fmc_state = 0
	{
		&fmc_led = 0
	}
	ELSE
	{
		&fmc_led = 1
	}
}

//********************************************* 
//********** SIXPACK INDICATORS  
//********************************************* 

var 17 name FLT_LED Link IOCARD_OUT Device 0 Output 34
var 18 name FLT_CONT LINK FSUIPC_IN Offset $6508 Length 1
	{
	CALL &fltsub
	}
VAR 19 name fltsub Link SUBRUTINE
{ 
    IF &FLT_CONT = 0
    {
        &FLT_LED = 0
    }
    ELSE
    {
        &FLT_LED = 1
    }
}

var 20 name IRS_LED Link IOCARD_OUT Device 0 Output 33
var 21 name IRS LINK FSUIPC_IN Offset $6509 Length 1
	{
	CALL &irssub
	}
VAR 22 name irssub Link SUBRUTINE
{ 
    IF &IRS = 0
    {
        &IRS_LED = 0
    }
    ELSE
    {
        &IRS_LED = 1
    }
}

var 23 name FUEL_LED Link IOCARD_OUT Device 0 Output 32
var 24 name FUEL LINK FSUIPC_IN Offset $650A Length 1
	{
	CALL &fuelsub
	}
VAR 25 name fuelsub Link SUBRUTINE
{ 
    IF &FUEL = 0
    {
        &FUEL_LED = 0
    }
    ELSE
    {
        &FUEL_LED = 1
    }
}

var 26 name ELEC_LED Link IOCARD_OUT Device 0 Output 29
var 27 name ELECS LINK FSUIPC_IN Offset $650B Length 1
	{
	CALL &elecsub
	}
VAR 28 name elecsub Link SUBRUTINE
{ 
    IF &ELECS = 0
    {
        &ELEC_LED = 0
    }
    ELSE
    {
        &ELEC_LED = 1
    }
}

var 29 name APU_LED Link IOCARD_OUT Device 0 Output 30
var 30 name APU LINK FSUIPC_IN Offset $650C Length 1
	{
	CALL &apusub
	}
VAR 31 name apusub Link SUBRUTINE
{ 
    IF &APU = 0
    {
        &APU_LED = 0
    }
    ELSE
    {
        &APU_LED = 1
    }
}

var 32 name OVHT_LED Link IOCARD_OUT Device 0 Output 31
var 33 name OVHT_DET LINK FSUIPC_IN Offset $650D Length 1
	{
	CALL &ovhtsub
	}
VAR 34 name ovhtsub Link SUBRUTINE
{ 
    IF &OVHT_DET = 0
    {
        &OVHT_LED = 0
    }
    ELSE
    {
        &OVHT_LED = 1
    }
}

var 35 name ANTI_LED Link IOCARD_OUT Device 0 Output 23
var 36 name ANTI_ICE LINK FSUIPC_IN Offset $650E Length 1
	{
	CALL &antisub
	}
VAR 37 name antisub Link SUBRUTINE
{ 
    IF &ANTI_ICE = 0
    {
        &ANTI_LED = 0
    }
    ELSE
    {
        &ANTI_LED = 1
    }
}

var 38 name HYD_LED Link IOCARD_OUT Device 0 Output 24
var 39 name HYD LINK FSUIPC_IN Offset $650F Length 1
	{
	CALL &hydsub
	}
VAR 40 name hydsub Link SUBRUTINE
{ 
    IF &HYD = 0
    {
        &HYD_LED = 0
    }
    ELSE
    {
        &HYD_LED = 1
    }
}

var 41 name DOOR_LED Link IOCARD_OUT Device 0 Output 25
var 42 name DOOR LINK FSUIPC_IN Offset $6510 Length 1
	{
	CALL &doorsub
	}
VAR 43 name doorsub Link SUBRUTINE
{ 
    IF &DOOR = 0
    {
        &DOOR_LED = 0
    }
    ELSE
    {
        &DOOR_LED = 1
    }
}

var 44 name ENG_LED Link IOCARD_OUT Device 0 Output 28
var 45 name ENG LINK FSUIPC_IN Offset $6511 Length 1
	{
	CALL &engsub
	}
VAR 46 name engsub Link SUBRUTINE
{ 
    IF &ENG = 0
    {
        &ENG_LED = 0
    }
    ELSE
    {
        &ENG_LED = 1
    }
}

var 47 name OVH_LED Link IOCARD_OUT Device 0 Output 27
var 48 name OVERHEAD LINK FSUIPC_IN Offset $6512 Length 1
	{
	CALL &ovhdsub
	}
VAR 49 name ovhdsub Link SUBRUTINE
{ 
    IF &OVERHEAD = 0
    {
        &OVH_LED = 0
    }
    ELSE
    {
        &OVH_LED = 1
    }
}

var 50 name AIR_LED Link IOCARD_OUT Device 0 Output 26
var 51 name AIRCOND LINK FSUIPC_IN Offset $6513 Length 1
	{
	CALL &airsub
	}
VAR 52 name airsub Link SUBRUTINE
{ 
    IF &AIRCOND = 0
    {
        &AIR_LED = 0
    }
    ELSE
    {
        &AIR_LED = 1
    }
}

//********************************************* 
//********** LANDING GEAR INDICATORS  - GREEN
//********************************************* 

var 53 name nose_g_led Link IOCARD_OUT Device 0 Output 16  // Nose Gear Green LED
var 54 name nose_g LINK FSUIPC_IN Offset $6573 Length 1 // Nose Gear Green state
	{
	CALL &nosegsub
	}
VAR 55 name nosegsub Link SUBRUTINE
{
	IF &nose_g = 0
	{
		&nose_g_led = 0
	}
	ELSE
	{
		&nose_g_led = 1
	}
}

var 56 name left_g_led Link IOCARD_OUT Device 0 Output 14  // Left Gear Green LED
var 57 name left_g LINK FSUIPC_IN Offset $6574 Length 1 // Left Gear Green state
	{
	CALL &leftgsub
	}
VAR 58 name leftgsub Link SUBRUTINE
{ 

		IF &left_g = 0
		{
			&left_g_led = 0
		}
		ELSE
		{
			&left_g_led = 1
		}
}

var 59 name right_g_led Link IOCARD_OUT Device 0 Output 12  // Right Gear Green LED
var 60 name right_g LINK FSUIPC_IN Offset $6575 Length 1 // Right Gear Green state
	{
	CALL &rightgsub
	}
VAR 61 name rightgsub Link SUBRUTINE
{ 

		IF &right_g = 0
		{
			&right_g_led = 0
		}
		ELSE
		{
			&right_g_led = 1
		}
}

//********************************************* 
//********** LANDING GEAR INDICATORS  - RED
//********************************************* 

var 62 name nose_r_led Link IOCARD_OUT Device 0 Output 13  // Nose Gear Red LED
var 63 name nose_r LINK FSUIPC_IN Offset $6570 Length 1 // Nose Gear Red state
	{
	CALL &nosersub
	}
VAR 64 name nosersub Link SUBRUTINE
{
	IF &nose_r = 0
	{
		&nose_r_led = 0
	}
	ELSE
	{
		&nose_r_led = 1
	}
}

var 65 name left_r_led Link IOCARD_OUT Device 0 Output 11  // Left Gear Green LED
var 66 name left_r LINK FSUIPC_IN Offset $6571 Length 1 // Left Gear Red state
	{
	CALL &leftrsub
	}
VAR 67 name leftrsub Link SUBRUTINE
{ 

		IF &left_r = 0
		{
			&left_r_led = 0
		}
		ELSE
		{
			&left_r_led = 1
		}
}

var 68 name right_r_led Link IOCARD_OUT Device 0 Output 15 // Right Gear Red LED
var 69 name right_r LINK FSUIPC_IN Offset $6572 Length 1 // Right Gear Red state
	{
	CALL &rightrsub
	}
VAR 70 name rightrsub Link SUBRUTINE
{ 

		IF &right_r = 0
		{
			&right_r_led = 0
		}
		ELSE
		{
			&right_r_led = 1
		}
}

//********************************************* 
//********** ADDITIONAL INDICATORS
//********************************************* 

var 71 name antib_led Link IOCARD_OUT Device 0 Output 17  //  ANTISKID LED
var 72 name antib_state LINK FSUIPC_IN Offset $6563 Length 1 // ANTISKID STATE
	{
	CALL &antibsub
	}
VAR 73 name antibsub Link SUBRUTINE
{ 
	IF &antib_state = 0
	{
		&antib_led = 0
	}
	ELSE
	{
		&antib_led = 1
	}
}

var 74 name autobrake_led Link IOCARD_OUT Device 0 Output 36  //  AUTO BRAKE DISARM LED
var 75 name autob_state LINK FSUIPC_IN Offset $6564 Length 1 // AUTO BRAKE DISARM LED STATE
	{
	CALL &autobsub
	}
VAR 76 name autobsub Link SUBRUTINE
{ 
	IF &autob_state = 0
	{
		&autobrake_led = 0
	}
	ELSE
	{
		&autobrake_led = 1

	}
}

var 77 name spoilnoarm_led Link IOCARD_OUT Device 0 Output 19  //  Speed Brake Do Not Arm LED
var 78 name spoilnoarm LINK FSUIPC_IN Offset $6559 Length 1 // Speed Brake Do Not Arm state
	{
	CALL &sbnoarmsub
	}
VAR 79 name sbnoarmsub Link SUBRUTINE
{ 
	IF &spoilnoarm = 0
	{
		&spoilnoarm_led = 0
	}
	ELSE
	{
		&spoilnoarm_led = 1
	}
}

var 80 name spoilerarm_led Link IOCARD_OUT Device 0 Output 18  //  Speed Brake Arm LED
var 81 name spoiler_state LINK FSUIPC_IN Offset $6558 Length 1 // Speed Brake Arm state
{ 
	IF &spoiler_state = 0
	{
		&spoilerarm_led = 0
	}
	ELSE
	{
		&spoilerarm_led = 1
	}
}

var 82 name spoilup_led Link IOCARD_OUT Device 0 Output 22  //  Speed Brake Extend LED
var 83 name spoilup_state LINK FSUIPC_IN Offset $655A Length 1 // Speed Brake Extend state
{ 
	IF &spoilup_state = 0
	{
		&spoilup_led = 0
	}
	ELSE
	{
		&spoilup_led = 1
	}
}

//********************************************* 
//********** IRS INDICATORS ON READ OVERHEAD
//********************************************* 

var 84 name Lalign_led Link IOCARD_OUT Device 0 Output 47  //  Left Align LED
var 85 name Lalign_state LINK FSUIPC_IN Offset $6423 Length 1 // Left Align state
{ 
	IF &Lalign_state = 0
	{
		&Lalign_led = 0
	}
	ELSE
	{
		&Lalign_led = 1
	}
}
var 86 name Ralign_led Link IOCARD_OUT Device 0 Output 43  //  Right Align LED
var 87 name Ralign_state LINK FSUIPC_IN Offset $6424 Length 1 // Right Align state
{ 
	IF &Ralign_state = 0
	{
		&Ralign_led = 0
	}
	ELSE
	{
		&Ralign_led = 1
	}
}
var 88 name Londc_led Link IOCARD_OUT Device 0 Output 48  //  Left ON DC LED
var 89 name Londc_state LINK FSUIPC_IN Offset $6425 Length 1 // Left ON DC state
{ 
	IF &Londc_state = 0
	{
		&Londc_led = 0
	}
	ELSE
	{
		&Londc_led = 1
	}
}
var 90 name Rondc_led Link IOCARD_OUT Device 0 Output 41  //  Right ON DC LED
var 91 name Rondc_state LINK FSUIPC_IN Offset $6426 Length 1 // Right On DC state
{ 
	IF &Rondc_state = 0
	{
		&Rondc_led = 0
	}
	ELSE
	{
		&Rondc_led = 1
	}
}
var 92 name Lfault_led Link IOCARD_OUT Device 0 Output 46  //  Lef Fault LED
var 93 name Lfault_state LINK FSUIPC_IN Offset $6427 Length 1 // Left Fault state
{ 
	IF &Lfault_state = 0
	{
		&Lfault_led = 0
	}
	ELSE
	{
		&Lfault_led = 1
	}
}
var 94 name Rfault_led Link IOCARD_OUT Device 0 Output 44  //  Right Fault LED
var 95 name Rfault_state LINK FSUIPC_IN Offset $6428 Length 1 // Right Fault state
{ 
	IF &Rfault_state = 0
	{
		&Rfault_led = 0
	}
	ELSE
	{
		&Rfault_led = 1
	}
}
var 96 name Ldcfail_led Link IOCARD_OUT Device 0 Output 45  //  Left DC Fail LED
var 97 name Ldcfail_state LINK FSUIPC_IN Offset $6429 Length 1 // Left DC Fail state
{ 
	IF &Ldcfail_state = 0
	{
		&Ldcfail_led = 0
	}
	ELSE
	{
		&Ldcfail_led = 1
	}
}
var 98 name Rdcfail_led Link IOCARD_OUT Device 0 Output 42  //  Right DC Fail LED
var 99 name Rdcfail_state LINK FSUIPC_IN Offset $642A Length 1 // Right DC Fail state
{ 
	IF &Rdcfail_state = 0
	{
		&Rdcfail_led = 0
	}
	ELSE
	{
		&Rdcfail_led = 1
	}
}
One Comment
LIVE NOW! CLICK TO VIEW.
CURRENTLY OFFLINE