PDA

View Full Version : OC Plug n Play MCP and home built COMM radio w/ Master card.. Help



n19htmare
09-03-2012, 10:14 PM
I'm trying to get everything working together with the PMDG 737 and I'm having some tough time with things working together.

I have a OpenCockPit MCP which works flawless with Roarks' OCPNGX driver and script.

I also made a COMM 1 radio panel with OC Master Card and Display Card. I found a script written by NIKO and it also works flawlessly. However, I CANNOT get them to work together. THey work fine on their own.

I run the following script from Roark "OCP4NGX_MCP-EFIS_PP v1.05" and then run the OCP4NGX and MCP works fine.



I tried to combine my COMM 1 script with the "OCP4NGX_MCP-EFIS_PP v1.05.ssi" file by first exporting the OCP4NGX_MCP-EFIS_PP v1.05.ssi file to text and then copy pasting my COMM1 script at the end. I got NO COMPILATION errors. However when I run the script and open OCP4NGX, OCP4NGX Crashes or my MCP does not work?

Below is the compiled code for both... why is it not working with OCP4NGX?

Also, Do I have to use the OCP4NGX? I've tried other scripts for the MCP and NOTHING works, only the OCP4NGX method works :(


// *****************************************************************************// * Config_SIOC ver 3.5 - By Manolo Vélez - OpenCockpits (http://www.opencockpits.com)
// *****************************************************************************
// * FileName : OCP4NGX_MCP-EFIS_PP v1.05.txt
// * Date : 8/31/2012






Var 0000, Value 0
{
&LT_TIMER = 0
&TRANSBUSOFF = 0 // 0 = both busses is OFF
&SD_DELAY = 0
&BlankOrLit = -999999
&OnOrOff = 0
&Blank = 1
&Lit = 0
V2601 = 1 // 1 = Bus0 OFF
V2602 = 1 // 1 = Bus1 OFF
V2603 = 0
V2596 = 1 // 1 = Default no test
&ZERO_MCP = 0 // GET RID OF DIRT!
}


Var 0001, name ZERO_MCP
{
IF &TRANSBUSOFF = 0
{
&BlankOrLit = -999999
&OnOrOff = 0
CALL &MCP_LIGHTS
}
}


Var 0002, name LT_TIMER
{
IF &LT_TIMER = 1
{
&CONTROL = 0
&CONTROL = TIMER 1 ,0 ,200
}
ELSE
{
}
}


Var 0003, name SD_DELAY
{
IF &SD_DELAY = 1
{
&OnOrOff = 0
&BlankOrLit = -999999
CALL &MCP_LIGHTS
&SD_DELAY = 0
}
}


Var 0004, name BlankOrLit


Var 0005, name OnOrOff


Var 0006, name Blank


Var 0007, name Lit


Var 2603, name BATTERY


Var 2601, name TransBusOff0
{
&TRANSBUSOFF = CHANGEBITN 0 ,V2601
}


Var 2602, name TransBusOff1
{
&TRANSBUSOFF = CHANGEBITN 1 ,V2602
}


Var 0008, name TRANSBUSOFF
{
IF &TRANSBUSOFF = 0
{
&SD_DELAY = DELAY 1 ,690 // Delay 6 9 sec before shutdown
}
ELSE // Return to default powered MCP windows an
{
CALL &MCP_REFRESH
}
}


Var 2596, name LightsSelector
{
IF V2596 = 0
{
IF V2603 > 0 // Check if Battery is ON
{
&LT_TIMER = 1 // Timer for blanking and liting is initiat
&MIP_LT = 0
}
}
ELSE
{
&OnOrOff = 0
CALL &MCP_REFRESH // When LightsSelector is set back to defau
}
}


Var 0009, name CONTROL, Link SUBRUTINE
{
&Blank = CHANGEBITN 0 ,&Blank
&Lit = CHANGEBITN 0 ,&Lit
CALL &MIP_LT
}


Var 0010, name MIP_LT, Link SUBRUTINE
{
IF &MIP_LT = 0
{
IF &TRANSBUSOFF = 0 // Both TransBus is OFF then blank segments
{
&OnOrOff = 1
&BlankOrLit = -999999
CALL &MCP_LIGHTS
}
ELSE
{
&OnOrOff = 1
IF &Blank = 1 // blank all windows segments
{
&BlankOrLit = -999999
}
IF &Lit = 1 // lit all windows segments
{
&BlankOrLit = 888
}
CALL &MCP_LIGHTS
}
}
}


Var 0011, name MCP_REFRESH, Link SUBRUTINE
{
&MIP_LT = 1 // Default setting
&CONTROL = 1 // Kill timer
&LT_TIMER = 0 // Kill timer
CALL &CRSLtMCPw
CALL &IASMACHtMCPw
CALL &HDGtMCPw
CALL &ALTtMCPw
CALL &VStMCPw
CALL &CRSRtMCPw
&OannunATArm = V2577
&OannunN1 = V2563
&OannunSPEED = V2564
&OannunVNAV = V2565
&OannunLVL_CHG = V2566
&OannunHDG_SEL = V2567
&OannunLNAV = V2568
&OannunVOR_LOC = V2569
&OannunAPP = V2570
&OannunALT_HLD = V2571
&OannunVS = V2572
&OannunCMD_A = V2573
&OannunCWS_A = V2574
&OannunCMD_B = V2575
&OannunCWS_B = V2576
}


Var 0012, name MCP_LIGHTS, Link SUBRUTINE
{
&D_CrsL = &BlankOrLit
&D_IAS = &BlankOrLit
&D_IAS3 = &BlankOrLit
&D_Hdg = &BlankOrLit
&D_ALT = &BlankOrLit
&D_ALTL0 = &BlankOrLit
&D_ALTL00 = &BlankOrLit
&D_VSS = &BlankOrLit
&D_VS3 = &BlankOrLit
&D_VS4 = &BlankOrLit
&D_VS = &BlankOrLit
&D_CrsR = &BlankOrLit
&OannunATArm = &OnOrOff
&OannunN1 = &OnOrOff
&OannunSPEED = &OnOrOff
&OannunVNAV = &OnOrOff
&OannunLVL_CHG = &OnOrOff
&OannunHDG_SEL = &OnOrOff
&OannunLNAV = &OnOrOff
&OannunVOR_LOC = &OnOrOff
&OannunAPP = &OnOrOff
&OannunALT_HLD = &OnOrOff
&OannunVS = &OnOrOff
&OannunCMD_A = &OnOrOff
&OannunCWS_A = &OnOrOff
&OannunCMD_B = &OnOrOff
&OannunCWS_B = &OnOrOff
}


Var 0013, name D_CrsL, Link IOCARD_DISPLAY, Digit 0, Numbers 3


Var 0014, name toCRSL_window


Var 0015, name ROTACTIVE_CRSL


Var 2534, name CRSLtoNGX // CrsL to NGX panel
{
&toCRSL_window = V2534
CALL &CRSLtMCPw
&ROTACTIVE_CRSL = DELAY 0 ,100
}


Var 1106, name CRSLfromNGX // CrsL from NGX panel
{
IF &ROTACTIVE_CRSL = 0
{
V2534 = V1106
&toCRSL_window = V1106
CALL &CRSLtMCPw
}
ELSE
{
}
}


Var 0016, name ROTARY_CrsL, Link IOCARD_ENCODER, Input 4, Aceleration 2, Type 2
{
&ROTACTIVE_CRSL = 1
L0 = &ROTARY_CrsL * -1
V2534 = ROTATE 0 ,359 ,L0
}


Var 0017, name CRSLtMCPw, Link SUBRUTINE
{
IF &TRANSBUSOFF > 0
{
&D_CrsL = &toCRSL_window
}
}


Var 0018, name D_IAS, Link IOCARD_DISPLAY, Digit 3, Numbers 2


Var 0019, name D_IAS3, Link IOCARD_DISPLAY, Digit 5, Numbers 1


Var 0020, name toIASMACH_win


Var 0021, name ROTACTIVE_IAS


Var 2544, name IASset // IAS to NGX panel
{
&toIASMACH_win = V2544
CALL &IASMACHtMCPw // Subroutine to set IASMACH to MCP window
&ROTACTIVE_IAS = DELAY 0 ,100
}


Var 2547, name MACHset // MACH to NGX panel
{
&toIASMACH_win = V2547
CALL &IASMACHtMCPw // Subroutine to set IASMACH to MCP window
&ROTACTIVE_IAS = DELAY 0 ,100
}


Var 1119, name IASMACH // IAS from NGX panel
{
IF &ROTACTIVE_IAS = 0
{
IF V1119 > 99
{
V2544 = V1119
&toIASMACH_win = V1119
CALL &IASMACHtMCPw // Subroutine to set IASMACH to MCP window
}
ELSE
{
}
V2547 = V1119
&toIASMACH_win = V1119
CALL &IASMACHtMCPw // Subroutine to set IASMACH to MCP window
}
}


Var 0022, name ROTARY_IAS, Link IOCARD_ENCODER, Input 0, Aceleration 2, Type 2
{
IF V1115 = 0 // Respond only when Ias/Mach display on ..
{
IF V1119 > 99
{
&ROTACTIVE_IAS = 1
V1119 = V1119 // Block for updating of IAS during rotary
L0 = &ROTARY_IAS * -1
V1119 = LIMIT 100 ,350 ,L0
V2544 = V1119 // Rotary value to offset linked to EVT_MCP
}
ELSE
{
&ROTACTIVE_IAS = 1
V1119 = V1119
L0 = &ROTARY_IAS * -1 // Block for updating of MACH during rotary
V1119 = LIMIT 40 ,95 ,L0
V2547 = V1119 // Rotary value to offset linked to EVT_MCP
}
}
}


Var 0023, name IASMACHtMCPw, Link SUBRUTINE
{
IF &TRANSBUSOFF > 0
{
IF V1115 = 1
{
&D_IAS = -999999 // blank all segments
&D_IAS3 = -999999 // blank all segments
}
ELSE
{
IF &toIASMACH_win < 100
{
&D_IAS = &toIASMACH_win
&D_IAS3 = -999999 // blank all segments
}
ELSE
{
L0 = &toIASMACH_win
L1 = DIV L0 ,100
L2 = MOD L0 ,100
&D_IAS = L2
&D_IAS3 = L1
}
}
}
}


Var 1115, name IASBlank // var for indicating blanking or not blank
{
CALL &IASMACHtMCPw
}


Var 1117, name IASOverSpeed


Var 1118, name IASUnderSpeed


Var 0024, name D_Hdg, Link IOCARD_DISPLAY, Digit 6, Numbers 3


Var 0025, name toHDG_window


Var 0026, name ROTACTIVE_HDG


Var 2542, name HDGtoNGX // Hdg to NGX panel
{
&toHDG_window = V2542
CALL &HDGtMCPw
&ROTACTIVE_HDG = DELAY 0 ,100
}


Var 1126, name HDGfromNGX // HDG from NGX panel
{
IF &ROTACTIVE_HDG = 0
{
V2542 = V1126
&toHDG_window = V1126
CALL &HDGtMCPw
}
ELSE
{
}
}


Var 0027, name ROTARY_Hdg, Link IOCARD_ENCODER, Input 6, Aceleration 2, Type 2
{
IF &BANKHDG = 0 // Turning Heading
{
&ROTACTIVE_HDG = 1
L0 = &ROTARY_Hdg * -1 // turning right should be plus
V2542 = ROTATE 0 ,359 ,L0
}
ELSE // Turning Banking
{
L0 = &ROTARY_Hdg * -1 // turning right should be plus
V2528 = LIMIT 0 ,4 ,L0
}
}


Var 0028, name HDGtMCPw, Link SUBRUTINE
{
IF &TRANSBUSOFF > 0
{
&D_Hdg = &toHDG_window
}
}


Var 0029, name D_ALT, Link IOCARD_DISPLAY, Digit 9, Numbers 3


Var 0030, name D_ALTL00, Link IOCARD_DISPLAY, Digit 12, Numbers 1


Var 0031, name D_ALTL0, Link IOCARD_DISPLAY, Digit 13, Numbers 1


Var 0032, name ROTACTIVE_ALT


Var 0033, name toALT_window


Var 2524, name ALTtoNGX // ALT to NGX panel
{
&toALT_window = V2524
CALL &ALTtMCPw
&ROTACTIVE_ALT = DELAY 0 ,100
}


Var 2520, name tempalt


Var 1136, name ALTfromNGX // ALT from NGX panel
{
IF &ROTACTIVE_ALT = 0
{
L0 = V1136
V2520 = DIV L0 ,100
&toALT_window = V1136
CALL &ALTtMCPw
}
ELSE
{
}
}


Var 0034, name ROTARY_ALT, Link IOCARD_ENCODER, Input 2, Aceleration 2, Type 2
{
&ROTACTIVE_ALT = 1
L0 = &ROTARY_ALT * -1 // turning right should be plus
V2520 = LIMIT 0 ,640 ,L0
L2 = V2520 * 100
V2524 = L2
}


Var 0035, name ALTtMCPw, Link SUBRUTINE
{
IF &TRANSBUSOFF > 0
{
L0 = &toALT_window
IF L0 >= 10000
{
&D_ALTL0 = DIV L0 ,10000
L1 = MOD L0 ,10000
&D_ALTL00 = DIV L1 ,1000
&D_ALT = MOD L0 ,1000
}
ELSE
{
&D_ALTL0 = -999999
IF L0 >= 1000
{
&D_ALTL00 = DIV L0 ,1000
&D_ALT = MOD L0 ,1000
}
ELSE
{
&D_ALTL00 = -999999
&D_ALT = L0
}
}
}
}


Var 0036, name D_VS, Link IOCARD_DISPLAY, Digit 14, Numbers 2


Var 0037, name D_VS3, Link IOCARD_DISPLAY, Digit 16, Numbers 1


Var 0038, name D_VS4, Link IOCARD_DISPLAY, Digit 17, Numbers 1


Var 0039, name D_VSS, Link IOCARD_DISPLAY, Digit 18, Numbers 1


Var 0040, name ROTACTIVE_VS


Var 1140, name VSfromNGX
{
IF &ROTACTIVE_VS = 0
{
L0 = 48576
IF V1140 > L0
{
L1 = 65536
V2555 = V1140 - L1
}
ELSE
{
V2555 = V1140
}
}
ELSE
{
}
}


Var 0041, name tempvs


Var 0042, name tempvs0


Var 2555, name VS
{
&tempvs = V2555
&tempvs0 = 0
CALL &VStMCPw
&ROTACTIVE_VS = DELAY 0 ,100
}


Var 1143, name VertSpeedBlank


Var 0043, name ROTATOR_VS, Link IOCARD_ENCODER, Input 11, Aceleration 2, Type 2
{
IF V2555 <> -16960 // Respond only when in VS mode ...
{
&ROTACTIVE_VS = 1
L0 = &ROTATOR_VS * -1
&tempvs0 = LIMIT -99 ,99 ,L0
L2 = &tempvs0 * 50
V2555 = &tempvs + L2
}
}


Var 0044, name VStMCPw, Link SUBRUTINE
{
IF &TRANSBUSOFF > 0
{
IF V2555 = -16960
{
&D_VSS = -999999 // blank all segments
&D_VS3 = -999999
&D_VS4 = -999999
&D_VS = -999999
}
ELSE
{
L0 = V2555
IF L0 < 0
{
&D_VSS = -999998 // minus sign
L2 = L0 * -1
&D_VS4 = DIV L2 ,1000
L1 = MOD L2 ,1000
&D_VS3 = DIV L1 ,100
&D_VS = MOD L1 ,100
}
IF L0 >= 0
{
&D_VSS = -999999 // blank// blank all segments
&D_VS4 = DIV L0 ,1000
L1 = MOD L0 ,1000
&D_VS3 = DIV L1 ,100
&D_VS = MOD L1 ,100
}
}
}
}


Var 0045, name D_CrsR, Link IOCARD_DISPLAY, Digit 19, Numbers 3


Var 0046, name toCRSR_window


Var 0047, name ROTACTIVE_CRSR


Var 2535, name CRSRtoNGX // CrsR to NGX panel
{
&toCRSR_window = V2535
CALL &CRSRtMCPw
&ROTACTIVE_CRSR = DELAY 0 ,100
}


Var 1156, name CRSRfromNGX // CrsR from NGX panel
{
IF &ROTACTIVE_CRSR = 0
{
V2535 = V1156
&toCRSR_window = V1156
CALL &CRSRtMCPw
}
ELSE
{
}
}


Var 0048, name ROTARY_CrsR, Link IOCARD_ENCODER, Input 9, Aceleration 2, Type 2
{
&ROTACTIVE_CRSR = 1
L0 = &ROTARY_CrsR * -1
V2535 = ROTATE 0 ,359 ,L0
}


Var 0049, name CRSRtMCPw, Link SUBRUTINE
{
IF &TRANSBUSOFF > 0
{
&D_CrsR = &toCRSR_window
}
}


Var 0050, name FD_SW_L, Link IOCARD_SW, Input 16, Type I
{
V2539 = CHANGEBITN 0 ,V2539
}


Var 2539, name FD_L, Value 1


Var 0051, name AT_ARM_SW, Link IOCARD_SW, Input 33, Type I
{
V2527 = CHANGEBITN 0 ,V2527
IF &AT_ARM_SW = 1 // Temporary fix
{
V2577 = 1 // Temporary fix
}
ELSE
{
V2577 = 0
}
}


Var 2527, name AT_ARM, Value 1
{
IF 2527 = 0 // Temporary fix
{
V2577 = 1 // Temporary fix
}
ELSE
{
}
}


Var 2538, name DISENGAGE_BAR, Link IOCARD_SW, Input 15, Type I


Var 0052, name FD_SW_R, Link IOCARD_SW, Input 14, Type I
{
V2540 = CHANGEBITN 0 ,V2540
}


Var 2540, name FD_R, Value 1


Var 2548, name N1_SW, Link IOCARD_SW, Input 32, Type P


Var 2551, name SPEED_SW


Var 2549, name SPD_INTV_SW


Var 0053, name t_SPEED_SW, Link IOCARD_SW, Input 31, Type I
{
IF &t_SPEED_SW = 1
{
&s_delay = DELAY 1 ,100
}
ELSE
{
}
}


Var 0054, name s_delay // value 0
{
IF &s_delay = 1
{
IF &t_SPEED_SW = 1
{
V2549 = CHANGEBITN 0 ,V2549
}
ELSE
{
V2551 = CHANGEBITN 0 ,V2551
}
ELSE
{
}
&s_delay = 0
}
}


Var 2531, name CO_SW, Link IOCARD_SW, Input 13, Type P


Var 2552, name VNAV_SW, Link IOCARD_SW, Input 30, Type P


Var 2546, name LVL_CHG_SW, Link IOCARD_SW, Input 29, Type P


Var 0055, name BANKHDG, Value 0 // BANK = 0 then HDG active


Var 0056, name t_delay // value 0
{
IF &t_delay = 1
{
IF &t_HDG_SEL_SW = 1
{
&BANKHDG = CHANGEBITN 0 ,&BANKHDG
}
ELSE
{
V2541 = CHANGEBITN 0 ,V2541
}
ELSE
{
}
&t_delay = 0
}
}


Var 2541, name HDG_SEL_SW


Var 2528, name BANKING_SEL_SW


Var 0057, name t_HDG_SEL_SW, Link IOCARD_SW, Input 28, Type I
{
IF &t_HDG_SEL_SW = 1
{
&t_delay = DELAY 1 ,100
}
ELSE
{
}
}


Var 2545, name LNAV_SW, Link IOCARD_SW, Input 27, Type P


Var 2553, name VOR_LOC_SW, Link IOCARD_SW, Input 25, Type P


Var 2526, name APP_SW, Link IOCARD_SW, Input 24, Type P


Var 2522, name ALT_HLD_SW


Var 2523, name ALT_INTV_SW, Value 0


Var 0058, name t_ALT_HLD_SW, Link IOCARD_SW, Input 23, Type I
{
IF &t_ALT_HLD_SW = 1
{
&a_delay = DELAY 1 ,100
}
ELSE
{
}
}


Var 0059, name a_delay // value 0
{
IF &a_delay = 1
{
IF &t_ALT_HLD_SW = 1
{
V2523 = 1
V2523 = DELAY 0 ,100
}
ELSE
{
V2522 = CHANGEBITN 0 ,V2522
}
ELSE
{
}
&a_delay = 0
}
}


Var 2556, name VS_SW, Link IOCARD_SW, Input 22, Type P


Var 2529, name CMD_A_SW, Link IOCARD_SW, Input 21, Type P


Var 2536, name CSW_A_SW, Link IOCARD_SW, Input 20, Type P


Var 2530, name CMD_B_SW, Link IOCARD_SW, Input 19, Type P


Var 2537, name CWS_B_SW, Link IOCARD_SW, Input 18, Type P


Var 2577, name annunATArm, Link IOCARD_OUT, Output 22 // Temporary fix see above
{
IF V2596 = 0
{
}
ELSE
{
&OannunATArm = V2577
}
}


Var 2563, name annunN1
{
IF V2596 = 0
{
}
ELSE
{
&OannunN1 = V2563
}
}


Var 2564, name annunSPEED
{
IF V2596 = 0
{
}
ELSE
{
&OannunSPEED = V2564
}
}


Var 2565, name annunVNAV
{
IF V2596 = 0
{
}
ELSE
{
&OannunVNAV = V2565
}
}


Var 2566, name annunLVL_CHG
{
IF V2596 = 0
{
}
ELSE
{
&OannunLVL_CHG = V2566
}
}


Var 2567, name annunHDG_SEL
{
IF V2596 = 0
{
}
ELSE
{
&OannunHDG_SEL = V2567
}
}


Var 2568, name annunLNAV
{
IF V2596 = 0
{
}
ELSE
{
&OannunLNAV = V2568
}
}


Var 2569, name annunVOR_LOC
{
IF V2596 = 0
{
}
ELSE
{
&OannunVOR_LOC = V2569
}
}


Var 2570, name annunAPP
{
IF V2596 = 0
{
}
ELSE
{
&OannunAPP = V2570
}
}


Var 2571, name annunALT_HLD
{
IF V2596 = 0
{
}
ELSE
{
&OannunALT_HLD = V2571
}
}


Var 2572, name annunVS
{
IF V2596 = 0
{
}
ELSE
{
&OannunVS = V2572
}
}


Var 2573, name annunCMD_A
{
IF V2596 = 0
{
}
ELSE
{
&OannunCMD_A = V2573
}
}


Var 2574, name annubCWS_A
{
IF V2596 = 0
{
}
ELSE
{
&OannunCWS_A = V2574
}
}


Var 2575, name annunCMD_B
{
IF V2596 = 0
{
}
ELSE
{
&OannunCMD_B = V2575
}
}


Var 2576, name annunCWS_B
{
IF V2596 = 0
{
}
ELSE
{
&OannunCWS_B = V2576
}
}


Var 0060, name OannunATArm, Link IOCARD_OUT, Output 22 // Temporary fix see above


Var 0061, name OannunN1, Link IOCARD_OUT, Output 21


Var 0062, name OannunSPEED, Link IOCARD_OUT, Output 23


Var 0063, name OannunVNAV, Link IOCARD_OUT, Output 25


Var 0064, name OannunLVL_CHG, Link IOCARD_OUT, Output 24


Var 0065, name OannunHDG_SEL, Link IOCARD_OUT, Output 26


Var 0066, name OannunLNAV, Link IOCARD_OUT, Output 29


Var 0067, name OannunVOR_LOC, Link IOCARD_OUT, Output 28


Var 0068, name OannunAPP, Link IOCARD_OUT, Output 27


Var 0069, name OannunALT_HLD, Link IOCARD_OUT, Output 30


Var 0070, name OannunVS, Link IOCARD_OUT, Output 31


Var 0071, name OannunCMD_A, Link IOCARD_OUT, Output 33


Var 0072, name OannunCWS_A, Link IOCARD_OUT, Output 32


Var 0073, name OannunCMD_B, Link IOCARD_OUT, Output 35


Var 0074, name OannunCWS_B, Link IOCARD_OUT, Output 34


Var 2400, name STA, Link IOCARD_SW, Device 1, Input 27, Type P


Var 2404, name WPT, Link IOCARD_SW, Device 1, Input 28, Type P


Var 2382, name ARPT, Link IOCARD_SW, Device 1, Input 30, Type P


Var 2386, name DATA, Link IOCARD_SW, Device 1, Input 32, Type P


Var 2397, name POS, Link IOCARD_SW, Device 1, Input 33, Type P


Var 2387, name FPV, Link IOCARD_SW, Device 1, Input 34, Type P


Var 2396, name MTRS, Link IOCARD_SW, Device 1, Input 38, Type P


Var 2399, name TFC, Link IOCARD_SW, Device 1, Input 31, Type P


Var 2395, name CTR, Link IOCARD_SW, Device 1, Input 29, Type P


Var 2402, name VOR1ADF1, Value 0


Var 0075, name VOR1, Link IOCARD_SW, Device 1, Input 36, Type I
{
IF &VOR1 = 1
{
V2402 = 0
}
ELSE
{
V2402 = 1
}
}


Var 0076, name ADF1, Link IOCARD_SW, Device 1, Input 37, Type I
{
IF &ADF1 = 1
{
V2402 = 2
}
ELSE
{
V2402 = 1
}
}


Var 2403, name VOR2ADF2, Value 1


Var 0077, name VOR2, Link IOCARD_SW, Device 1, Input 18, Type I
{
IF &VOR2 = 1
{
V2403 = 0
}
ELSE
{
V2403 = 1
}
}


Var 0078, name ADF2, Link IOCARD_SW, Device 1, Input 19, Type I
{
IF &ADF2 = 1
{
V2403 = 2
}
ELSE
{
V2403 = 1
}
}


Var 2394, name MODE


Var 0079, name APP_E, Link IOCARD_SW, Device 1, Input 9, Type P
{
V2394 = 0
}


Var 0080, name VOR_E, Link IOCARD_SW, Device 1, Input 10, Type P
{
V2394 = 1
}


Var 0081, name MAP, Link IOCARD_SW, Device 1, Input 11, Type P
{
V2394 = 2
}


Var 0082, name PLN, Link IOCARD_SW, Device 1, Input 12, Type P
{
V2394 = 3
}


Var 2398, name RANGE


Var 0083, name ND_5, Link IOCARD_SW, Device 1, Input 0, Type P
{
V2398 = 0
}


Var 0084, name ND_10, Link IOCARD_SW, Device 1, Input 1, Type P
{
V2398 = 1
}


Var 0085, name ND_20, Link IOCARD_SW, Device 1, Input 2, Type P
{
V2398 = 2
}


Var 0086, name ND_40, Link IOCARD_SW, Device 1, Input 3, Type P
{
V2398 = 3
}


Var 0087, name ND_80, Link IOCARD_SW, Device 1, Input 4, Type P
{
V2398 = 4
}


Var 0088, name ND_160, Link IOCARD_SW, Device 1, Input 5, Type P
{
V2398 = 5
}


Var 0089, name ND_320, Link IOCARD_SW, Device 1, Input 6, Type P
{
V2398 = 6
}


Var 0090, name ND_640, Link IOCARD_SW, Device 1, Input 7, Type P
{
V2398 = 7
}


Var 2392, name MINIMUMS


Var 0091, name m_RADIO_BARO, Value 0 // When 0 then BARO is active
{
IF &m_RADIO_BARO = 0
{
V2392 = 1
}
ELSE
{
V2392 = 0
}
}


Var 0092, name m_delay // value 0
{
IF &m_delay = 1
{
IF &t_MINS = 1
{
&m_RADIO_BARO = CHANGEBITN 0 ,&m_RADIO_BARO
}
ELSE
{
V2393 = CHANGEBITN 0 ,V2393
}
ELSE
{
}
&m_delay = 0
}
}


Var 2393, name RST


Var 0093, name t_MINS, Link IOCARD_SW, Device 1, Input 25, Type I
{
IF &t_MINS = 1
{
&m_delay = DELAY 1 ,100
}
ELSE
{
}
}


Var 2384, name BARO


Var 0094, name m_IN_HPA, Value 0 // When 0 then HPA is active
{
IF &m_IN_HPA = 0
{
V2384 = 0
}
ELSE
{
V2384 = 1
}
}


Var 0095, name b_delay // value 0
{
IF &b_delay = 1
{
IF &t_BARO = 1
{
&m_IN_HPA = CHANGEBITN 0 ,&m_IN_HPA
}
ELSE
{
V2385 = CHANGEBITN 0 ,V2385
}
ELSE
{
}
&b_delay = 0
}
}


Var 2385, name STD


Var 0096, name t_BARO, Link IOCARD_SW, Device 1, Input 22, Type I
{
IF &t_BARO = 1
{
&b_delay = DELAY 1 ,100
}
ELSE
{
}
}


Var 0097, name e_delay


Var 0098, name t_rot_RB, Value 500


Var 0099, name tempRB, Value 0


Var 2390, name RADIO_BARO


Var 0100, name MINS_ROT, Link IOCARD_ENCODER, Device 1, Input 23, Aceleration 2, Type 2 // MINS


turning
{
&tempRB = &t_rot_RB
L0 = &MINS_ROT * -1 // delete "* -1" before // if turning direc
&t_rot_RB = ROTATE 0 ,1000 ,L0
IF &tempRB > &t_rot_RB
{
V2390 = 8192
&e_delay = DELAY 1 ,1
V2390 = 2000
}
ELSE
{
V2390 = 16384
&e_delay = DELAY 1 ,1
V2390 = 2000
}
}


Var 0101, name t_rot_IH, Value 500


Var 0102, name tempIH, Value 0


Var 2383, name IN_HPA


Var 0103, name BARO_ROT, Link IOCARD_ENCODER, Device 1, Input 20, Aceleration 2, Type 2 // BARO


turning
{
&tempIH = &t_rot_IH
L0 = &BARO_ROT * -1 // delete "* -1" before // if turning direc
&t_rot_IH = ROTATE 0 ,1000 ,L0
IF &tempIH > &t_rot_IH
{
V2383 = 8192
&e_delay = DELAY 1 ,1
V2383 = 2000
}
ELSE
{
V2383 = 16384
&e_delay = DELAY 1 ,1
V2383 = 2000
}
}


//*******************************
//***************************************




var 9010 name pb_state LINK FSUIPC_IN Offset $65A7 Length 1
{
IF &pb_state = 0
{
&pb_led = 0
}
ELSE
{
&pb_led = 1
}
}


var 9011 name pb_led Link IOCARD_OUT Device 1 Output 14 // LED


//**************************************************************




// *****************************************************************************
// * Config_SIOC ver 1.98 - By Manolo Vélez - OpenCockpits (http://www.opencockpits.com)
// *****************************************************************************
// * FileName : Comm1_2.txt
// * Author Nico Kaan
// * Date : 10/11/2007
// * modified by Nico Kaan, April 18th, 2008
// * also incorporates a display test function - KB
//


Var 1000 name Com1_act
Var 1002 name FS_C1_SB_BCD Link FSUIPC_INOUT Offset $311A Length 2 // FS COM1 standby frequency in BCD


format
Var 1003 name FS_C1_ACT_BCD Link FSUIPC_INOUT Offset $034E Length 2 // FS COM1 active frequency in BCD


format
{
&Com1_act = FROMBCD &FS_C1_ACT_BCD
CALL &OutCom1_Act
CALL &C1_LH_ROT_VAL // Align rotary with new C1 SB integer val
CALL &C1_RH_ROT_VAL // Align rotary with new C1 SB decimal val
CALL &C1_UPDATE_LHS
CALL &C1_UPDATE_RHS
CALL &OutCom1_SB
}


Var 1004 name FS_C1_SWAP Link FSUIPC_OUT Offset $3123 Length 1 // FS COM1 active standby swap


Var 1005 name C1_SB_AS_DEC // COM1 standby frequency in decimal format
Var 1006 name C1_SB_LHS // COM1 standby frequency integers
Var 1007 name C1_SB_RHS // COM1 standby frequency decimals
Var 1008 name C1_RHS_ROT_VAL // COM1 right hand rotary encoder ref value
Var 1009 name C1_LHS_ROT_VAL // COM1 left hand rotary encoder ref value






Var 1010 name ROT_C1_LHS Link IOCARD_ENCODER Device 1 Input 34 Aceleration 1 Type 2
{
L0 = &ROT_C1_LHS * -1
&C1_LHS_ROT_VAL = ROTATE 18 36 L0
CALL &C1_UPDATE_LHS
CALL &SET_FS_C1_SB
CALL &OutCom1_SB
}


Var 1011 name ROT_C1_RHS Link IOCARD_ENCODER Device 1 Input 32 Aceleration 1 Type 2
{
L0 = &ROT_C1_RHS * -1
&C1_RHS_ROT_VAL = ROTATE 0 39 L0
CALL &C1_UPDATE_RHS
CALL &SET_FS_C1_SB
CALL &OutCom1_SB
}


Var 1012 name SW_C1_SWAP Link IOCARD_SW Device 1 Input 27 Type 1 // Active/Standby swap button
{
&FS_C1_SWAP = TOGGLE 3
}


Var 1015 name SW_C1_TEST Link IOCARD_SW Device 1 Input 26 // COMM TEST button sends 8's to Displays
{
IF &SW_C1_TEST = 1
{
&DISP_C1_ACT = 88888
&DISP_C1_SB = 88888
}
ELSE
{
CALL &OutCom1_Act
CALL &OutCom1_SB
}
}


Var 1020 name DISP_C1_SB Link IOCARD_DISPLAY Device 1 Digit 0 Numbers 5 // Standby decimals
Var 1021 name DISP_C1_ACT Link IOCARD_DISPLAY Device 1 Digit 5 Numbers 5 // active display
Var 1022 name C1_DP Link IOCARD_OUT Device 1 Output 15 // Decimal Point


Var 1030 name C1_LH_ROT_VAL Link SUBRUTINE // Aligns LH rotary ref with COM1 SB freq
{
L0 = FROMBCD &FS_C1_SB_BCD
L1 = L0 / 100
&C1_LHS_ROT_VAL = TRUNC L1
}


Var 1031 name C1_RH_ROT_VAL Link SUBRUTINE // Aligns RH rotary ref with COM1 SB freq
{
L0 = FROMBCD &FS_C1_SB_BCD
L1 = &C1_LHS_ROT_VAL * 100
L2 = L0 - L1
&C1_RHS_ROT_VAL = L2 / 2.487179
}


Var 1032 name C1_UPDATE_LHS Link SUBRUTINE // Update COM1 stanby integers
{
&C1_SB_LHS = &C1_LHS_ROT_VAL
}




Var 1033 name C1_UPDATE_RHS Link SUBRUTINE // Update COM1 standby decimals
{
L0 = &C1_RHS_ROT_VAL * 2.5
&C1_SB_RHS = TRUNC L0
}




Var 1034 name SET_FS_C1_SB Link SUBRUTINE // Update COM1 standby frequency in FS
{
L0 = &C1_SB_LHS * 100
L1 = L0 + &C1_SB_RHS
&FS_C1_SB_BCD = TOBCD L1
}


Var 1040 name OutCom1_Act Link SUBRUTINE
{


//IF &MAST_SW = 1
//{
L0 = &Com1_act
&DISP_C1_ACT = L0 + 10000
}
//ELSE
//{
//&DISP_C1_ACT = -999999 // blank
//}
//}




Var 1041 name OutCom1_SB Link SUBRUTINE
{
//IF &MAST_SW = 1
//}
&C1_DP = 1
L0 = &C1_SB_LHS * 100
L1 = L0 + &C1_SB_RHS
&DISP_C1_SB = L1 + 10000
}
//ELSE
//{
//&C1_DP = 0
//&DISP_C1_SB = -999999 // blank


//}






//}

kiek
09-04-2012, 02:27 PM
Hi,
Did you update your sioc.ini to reflect your combined sources?
Note that you use as well logical Device 1 as Device 0, so I would expect at least two master Statements in your sioc.ini...

regards,
Nico

n19htmare
09-04-2012, 05:31 PM
Hi,
Did you update your sioc.ini to reflect your combined sources?
Note that you use as well logical Device 1 as Device 0, so I would expect at least two master Statements in your sioc.ini...

regards,
Nico

Hello Nico,




[SIOC]
IOCP_port=8092
IOCP_timeout=4000
Minimized=No
toggle_delay=20


CONFIG_FILE=.\mcpcustom2.ssi
[CONFIG_FILE=.\mcpcomm1.ssi]
[CONFIG_FILE=.\OCP4NGX_MCP-EFIS_PP v1.05.ssi]


[IOCARDS MODULE]
IOCard_disable=No
IOCard_LPT=No


[MASTERS]
MASTER=0,5,1,26
MASTER=1,4,1,28


[FSUIPC MODULE]
FSUipcdisable=No
FSUipcRefresh=60


[IOCP CLIENTS MODULES]
IOCPini_delay= 3000
IOCPclient0_disable=no
IOCPclient0_host=localhost
IOCPclient0_port=8099
IOCPclient1_disable=yes
IOCPclient1_host=localhost
IOCPclient1_port=8092


[SOUND MODULE]
Sound_disable=Yes
Volume=100




As I said, each one works flawless on their own. it's only when I combine the two scripts and then I try to open OCPNGX, the OCPNGX crashes. I should Add that the COMM1 Radio works fine with the combined script. It's the OCPNGX I have trouble running with combined script above.

Do you see anything funky in the script?

Roarkr
09-05-2012, 04:40 PM
Hi,

You should try to compile a new combined ssi file based on the MCP txt script part only and the COMM1 txt script. This in order to avoid any conflict between the EFIS and COMM1 which both are defined as device #1 in the script.

rgs

n19htmare
09-06-2012, 01:03 AM
Hi,

You should try to compile a new combined ssi file based on the MCP txt script part only and the COMM1 txt script. This in order to avoid any conflict between the EFIS and COMM1 which both are defined as device #1 in the script.

rgs

Not sure how I missed the duplicate references to device 1. I took out the EFIS code and complile. NO ERRORS.

I launched the script and COMM1 works perfectly, however, OCP4NGX still crashes on start-up.

baffled now :(.

EVENT VIEWER for OCP4NGX

Log Name: ApplicationSource: Application Error
Date: 9/5/2012 9:56:44 PM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: xxxx-PC
Description:
Faulting application name: OCP4NGX.exe, version: 0.0.0.0, time stamp: 0x5022d83a
Faulting module name: OCP4NGX.exe, version: 0.0.0.0, time stamp: 0x5022d83a
Exception code: 0xc0000005
Fault offset: 0x00008c36
Faulting process id: 0x5e8
Faulting application start time: 0x01cd8bec003c33be
Faulting application path: C:\Program Files (x86)\IOCards\SIOC\rk software\OCP4NGX.exe
Faulting module path: C:\Program Files (x86)\IOCards\SIOC\rk software\OCP4NGX.exe
Report Id: 40ee9f8b-f7df-11e1-b99b-0018f32e43ae
Event Xml:
<event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<system>


<eventid qualifiers="0">1000</eventid>
<level>2</level>
<task>100</task>
<keywords>0x80000000000000</keywords>
<timecreated systemtime="2012-09-06T04:56:44.000000000Z">
<eventrecordid>33119</eventrecordid>
<channel>Application</channel>
<computer>xxxx-PC</computer>
<security>
</security></timecreated></system>
<eventdata>
<data>OCP4NGX.exe</data>
<data>0.0.0.0</data>
<data>5022d83a</data>
<data>OCP4NGX.exe</data>
<data>0.0.0.0</data>
<data>5022d83a</data>
<data>c0000005</data>
<data>00008c36</data>
<data>5e8</data>
<data>01cd8bec003c33be</data>
<data>C:\Program Files (x86)\IOCards\SIOC\rk software\OCP4NGX.exe</data>
<data>C:\Program Files (x86)\IOCards\SIOC\rk software\OCP4NGX.exe</data>
<data>40ee9f8b-f7df-11e1-b99b-0018f32e43ae</data>
</eventdata>
</event>




SCRIPT



// *****************************************************************************
// * Config_SIOC ver 3.5 - By Manolo Vélez - www.opencockpits.com
// *****************************************************************************
// * FileName : OCP4NGX_MCP-EFIS_PP v1.05.txt
// * Date : 8/31/2012






Var 0000, Value 0
{
&LT_TIMER = 0
&TRANSBUSOFF = 0 // 0 = both busses is OFF
&SD_DELAY = 0
&BlankOrLit = -999999
&OnOrOff = 0
&Blank = 1
&Lit = 0
V2601 = 1 // 1 = Bus0 OFF
V2602 = 1 // 1 = Bus1 OFF
V2603 = 0
V2596 = 1 // 1 = Default no test
&ZERO_MCP = 0 // GET RID OF DIRT!
}


Var 0001, name ZERO_MCP
{
IF &TRANSBUSOFF = 0
{
&BlankOrLit = -999999
&OnOrOff = 0
CALL &MCP_LIGHTS
}
}


Var 0002, name LT_TIMER
{
IF &LT_TIMER = 1
{
&CONTROL = 0
&CONTROL = TIMER 1 ,0 ,200
}
ELSE
{
}
}


Var 0003, name SD_DELAY
{
IF &SD_DELAY = 1
{
&OnOrOff = 0
&BlankOrLit = -999999
CALL &MCP_LIGHTS
&SD_DELAY = 0
}
}


Var 0004, name BlankOrLit


Var 0005, name OnOrOff


Var 0006, name Blank


Var 0007, name Lit


Var 2603, name BATTERY


Var 2601, name TransBusOff0
{
&TRANSBUSOFF = CHANGEBITN 0 ,V2601
}


Var 2602, name TransBusOff1
{
&TRANSBUSOFF = CHANGEBITN 1 ,V2602
}


Var 0008, name TRANSBUSOFF
{
IF &TRANSBUSOFF = 0
{
&SD_DELAY = DELAY 1 ,690 // Delay 6 9 sec before shutdown
}
ELSE // Return to default powered MCP windows an
{
CALL &MCP_REFRESH
}
}


Var 2596, name LightsSelector
{
IF V2596 = 0
{
IF V2603 > 0 // Check if Battery is ON
{
&LT_TIMER = 1 // Timer for blanking and liting is initiat
&MIP_LT = 0
}
}
ELSE
{
&OnOrOff = 0
CALL &MCP_REFRESH // When LightsSelector is set back to defau
}
}


Var 0009, name CONTROL, Link SUBRUTINE
{
&Blank = CHANGEBITN 0 ,&Blank
&Lit = CHANGEBITN 0 ,&Lit
CALL &MIP_LT
}


Var 0010, name MIP_LT, Link SUBRUTINE
{
IF &MIP_LT = 0
{
IF &TRANSBUSOFF = 0 // Both TransBus is OFF then blank segments
{
&OnOrOff = 1
&BlankOrLit = -999999
CALL &MCP_LIGHTS
}
ELSE
{
&OnOrOff = 1
IF &Blank = 1 // blank all windows segments
{
&BlankOrLit = -999999
}
IF &Lit = 1 // lit all windows segments
{
&BlankOrLit = 888
}
CALL &MCP_LIGHTS
}
}
}


Var 0011, name MCP_REFRESH, Link SUBRUTINE
{
&MIP_LT = 1 // Default setting
&CONTROL = 1 // Kill timer
&LT_TIMER = 0 // Kill timer
CALL &CRSLtMCPw
CALL &IASMACHtMCPw
CALL &HDGtMCPw
CALL &ALTtMCPw
CALL &VStMCPw
CALL &CRSRtMCPw
&OannunATArm = V2577
&OannunN1 = V2563
&OannunSPEED = V2564
&OannunVNAV = V2565
&OannunLVL_CHG = V2566
&OannunHDG_SEL = V2567
&OannunLNAV = V2568
&OannunVOR_LOC = V2569
&OannunAPP = V2570
&OannunALT_HLD = V2571
&OannunVS = V2572
&OannunCMD_A = V2573
&OannunCWS_A = V2574
&OannunCMD_B = V2575
&OannunCWS_B = V2576
}


Var 0012, name MCP_LIGHTS, Link SUBRUTINE
{
&D_CrsL = &BlankOrLit
&D_IAS = &BlankOrLit
&D_IAS3 = &BlankOrLit
&D_Hdg = &BlankOrLit
&D_ALT = &BlankOrLit
&D_ALTL0 = &BlankOrLit
&D_ALTL00 = &BlankOrLit
&D_VSS = &BlankOrLit
&D_VS3 = &BlankOrLit
&D_VS4 = &BlankOrLit
&D_VS = &BlankOrLit
&D_CrsR = &BlankOrLit
&OannunATArm = &OnOrOff
&OannunN1 = &OnOrOff
&OannunSPEED = &OnOrOff
&OannunVNAV = &OnOrOff
&OannunLVL_CHG = &OnOrOff
&OannunHDG_SEL = &OnOrOff
&OannunLNAV = &OnOrOff
&OannunVOR_LOC = &OnOrOff
&OannunAPP = &OnOrOff
&OannunALT_HLD = &OnOrOff
&OannunVS = &OnOrOff
&OannunCMD_A = &OnOrOff
&OannunCWS_A = &OnOrOff
&OannunCMD_B = &OnOrOff
&OannunCWS_B = &OnOrOff
}


Var 0013, name D_CrsL, Link IOCARD_DISPLAY, Digit 0, Numbers 3


Var 0014, name toCRSL_window


Var 0015, name ROTACTIVE_CRSL


Var 2534, name CRSLtoNGX // CrsL to NGX panel
{
&toCRSL_window = V2534
CALL &CRSLtMCPw
&ROTACTIVE_CRSL = DELAY 0 , 100
}


Var 1106, name CRSLfromNGX // CrsL from NGX panel
{
IF &ROTACTIVE_CRSL = 0
{
V2534 = V1106
&toCRSL_window = V1106
CALL &CRSLtMCPw
}
ELSE
{
}
}


Var 0016, name ROTARY_CrsL, Link IOCARD_ENCODER, Input 4, Aceleration 2, Type 2
{
&ROTACTIVE_CRSL = 1
L0 = &ROTARY_CrsL * -1
V2534 = ROTATE 0 ,359 ,L0
}


Var 0017, name CRSLtMCPw, Link SUBRUTINE
{
IF &TRANSBUSOFF > 0
{
&D_CrsL = &toCRSL_window
}
}


Var 0018, name D_IAS, Link IOCARD_DISPLAY, Digit 3, Numbers 2


Var 0019, name D_IAS3, Link IOCARD_DISPLAY, Digit 5, Numbers 1


Var 0020, name toIASMACH_win


Var 0021, name ROTACTIVE_IAS


Var 2544, name IASset // IAS to NGX panel
{
&toIASMACH_win = V2544
CALL &IASMACHtMCPw // Subroutine to set IASMACH to MCP window
&ROTACTIVE_IAS = DELAY 0 ,100
}


Var 2547, name MACHset // MACH to NGX panel
{
&toIASMACH_win = V2547
CALL &IASMACHtMCPw // Subroutine to set IASMACH to MCP window
&ROTACTIVE_IAS = DELAY 0 ,100
}


Var 1119, name IASMACH // IAS from NGX panel
{
IF &ROTACTIVE_IAS = 0
{
IF V1119 > 99
{
V2544 = V1119
&toIASMACH_win = V1119
CALL &IASMACHtMCPw // Subroutine to set IASMACH to MCP window
}
ELSE
{
}
V2547 = V1119
&toIASMACH_win = V1119
CALL &IASMACHtMCPw // Subroutine to set IASMACH to MCP window
}
}


Var 0022, name ROTARY_IAS, Link IOCARD_ENCODER, Input 0, Aceleration 2, Type 2
{
IF V1115 = 0 // Respond only when Ias/Mach display on ..
{
IF V1119 > 99
{
&ROTACTIVE_IAS = 1
V1119 = V1119 // Block for updating of IAS during rotary
L0 = &ROTARY_IAS * -1
V1119 = LIMIT 100 ,350 ,L0
V2544 = V1119 // Rotary value to offset linked to EVT_MCP
}
ELSE
{
&ROTACTIVE_IAS = 1
V1119 = V1119
L0 = &ROTARY_IAS * -1 // Block for updating of MACH during rotary
V1119 = LIMIT 40 ,95 ,L0
V2547 = V1119 // Rotary value to offset linked to EVT_MCP
}
}
}


Var 0023, name IASMACHtMCPw, Link SUBRUTINE
{
IF &TRANSBUSOFF > 0
{
IF V1115 = 1
{
&D_IAS = -999999 // blank all segments
&D_IAS3 = -999999 // blank all segments
}
ELSE
{
IF &toIASMACH_win < 100
{
&D_IAS = &toIASMACH_win
&D_IAS3 = -999999 // blank all segments
}
ELSE
{
L0 = &toIASMACH_win
L1 = DIV L0 ,100
L2 = MOD L0 ,100
&D_IAS = L2
&D_IAS3 = L1
}
}
}
}


Var 1115, name IASBlank // var for indicating blanking or not blank
{
CALL &IASMACHtMCPw
}


Var 1117, name IASOverSpeed


Var 1118, name IASUnderSpeed


Var 0024, name D_Hdg, Link IOCARD_DISPLAY, Digit 6, Numbers 3


Var 0025, name toHDG_window


Var 0026, name ROTACTIVE_HDG


Var 2542, name HDGtoNGX // Hdg to NGX panel
{
&toHDG_window = V2542
CALL &HDGtMCPw
&ROTACTIVE_HDG = DELAY 0 ,100
}


Var 1126, name HDGfromNGX // HDG from NGX panel
{
IF &ROTACTIVE_HDG = 0
{
V2542 = V1126
&toHDG_window = V1126
CALL &HDGtMCPw
}
ELSE
{
}
}


Var 0027, name ROTARY_Hdg, Link IOCARD_ENCODER, Input 6, Aceleration 2, Type 2
{
IF &BANKHDG = 0 // Turning Heading
{
&ROTACTIVE_HDG = 1
L0 = &ROTARY_Hdg * -1 // turning right should be plus
V2542 = ROTATE 0 ,359 ,L0
}
ELSE // Turning Banking
{
L0 = &ROTARY_Hdg * -1 // turning right should be plus
V2528 = LIMIT 0 ,4 ,L0
}
}


Var 0028, name HDGtMCPw, Link SUBRUTINE
{
IF &TRANSBUSOFF > 0
{
&D_Hdg = &toHDG_window
}
}


Var 0029, name D_ALT, Link IOCARD_DISPLAY, Digit 9, Numbers 3


Var 0030, name D_ALTL00, Link IOCARD_DISPLAY, Digit 12, Numbers 1


Var 0031, name D_ALTL0, Link IOCARD_DISPLAY, Digit 13, Numbers 1


Var 0032, name ROTACTIVE_ALT


Var 0033, name toALT_window


Var 2524, name ALTtoNGX // ALT to NGX panel
{
&toALT_window = V2524
CALL &ALTtMCPw
&ROTACTIVE_ALT = DELAY 0 ,100
}


Var 2520, name tempalt


Var 1136, name ALTfromNGX // ALT from NGX panel
{
IF &ROTACTIVE_ALT = 0
{
L0 = V1136
V2520 = DIV L0 ,100
&toALT_window = V1136
CALL &ALTtMCPw
}
ELSE
{
}
}


Var 0034, name ROTARY_ALT, Link IOCARD_ENCODER, Input 2, Aceleration 2, Type 2
{
&ROTACTIVE_ALT = 1
L0 = &ROTARY_ALT * -1 // turning right should be plus
V2520 = LIMIT 0 ,640 ,L0
L2 = V2520 * 100
V2524 = L2
}


Var 0035, name ALTtMCPw, Link SUBRUTINE
{
IF &TRANSBUSOFF > 0
{
L0 = &toALT_window
IF L0 >= 10000
{
&D_ALTL0 = DIV L0 ,10000
L1 = MOD L0 ,10000
&D_ALTL00 = DIV L1 ,1000
&D_ALT = MOD L0 ,1000
}
ELSE
{
&D_ALTL0 = -999999
IF L0 >= 1000
{
&D_ALTL00 = DIV L0 ,1000
&D_ALT = MOD L0 ,1000
}
ELSE
{
&D_ALTL00 = -999999
&D_ALT = L0
}
}
}
}


Var 0036, name D_VS, Link IOCARD_DISPLAY, Digit 14, Numbers 2


Var 0037, name D_VS3, Link IOCARD_DISPLAY, Digit 16, Numbers 1


Var 0038, name D_VS4, Link IOCARD_DISPLAY, Digit 17, Numbers 1


Var 0039, name D_VSS, Link IOCARD_DISPLAY, Digit 18, Numbers 1


Var 0040, name ROTACTIVE_VS


Var 1140, name VSfromNGX
{
IF &ROTACTIVE_VS = 0
{
L0 = 48576
IF V1140 > L0
{
L1 = 65536
V2555 = V1140 - L1
}
ELSE
{
V2555 = V1140
}
}
ELSE
{
}
}


Var 0041, name tempvs


Var 0042, name tempvs0


Var 2555, name VS
{
&tempvs = V2555
&tempvs0 = 0
CALL &VStMCPw
&ROTACTIVE_VS = DELAY 0 ,100
}


Var 1143, name VertSpeedBlank


Var 0043, name ROTATOR_VS, Link IOCARD_ENCODER, Input 11, Aceleration 2, Type 2
{
IF V2555 <> -16960 // Respond only when in VS mode ...
{
&ROTACTIVE_VS = 1
L0 = &ROTATOR_VS * -1
&tempvs0 = LIMIT -99 ,99 ,L0
L2 = &tempvs0 * 50
V2555 = &tempvs + L2
}
}


Var 0044, name VStMCPw, Link SUBRUTINE
{
IF &TRANSBUSOFF > 0
{
IF V2555 = -16960
{
&D_VSS = -999999 // blank all segments
&D_VS3 = -999999
&D_VS4 = -999999
&D_VS = -999999
}
ELSE
{
L0 = V2555
IF L0 < 0
{
&D_VSS = -999998 // minus sign
L2 = L0 * -1
&D_VS4 = DIV L2 ,1000
L1 = MOD L2 ,1000
&D_VS3 = DIV L1 ,100
&D_VS = MOD L1 ,100
}
IF L0 >= 0
{
&D_VSS = -999999 // blank// blank all segments
&D_VS4 = DIV L0 ,1000
L1 = MOD L0 ,1000
&D_VS3 = DIV L1 ,100
&D_VS = MOD L1 ,100
}
}
}
}


Var 0045, name D_CrsR, Link IOCARD_DISPLAY, Digit 19, Numbers 3


Var 0046, name toCRSR_window


Var 0047, name ROTACTIVE_CRSR


Var 2535, name CRSRtoNGX // CrsR to NGX panel
{
&toCRSR_window = V2535
CALL &CRSRtMCPw
&ROTACTIVE_CRSR = DELAY 0 ,100
}


Var 1156, name CRSRfromNGX // CrsR from NGX panel
{
IF &ROTACTIVE_CRSR = 0
{
V2535 = V1156
&toCRSR_window = V1156
CALL &CRSRtMCPw
}
ELSE
{
}
}


Var 0048, name ROTARY_CrsR, Link IOCARD_ENCODER, Input 9, Aceleration 2, Type 2
{
&ROTACTIVE_CRSR = 1
L0 = &ROTARY_CrsR * -1
V2535 = ROTATE 0 ,359 ,L0
}


Var 0049, name CRSRtMCPw, Link SUBRUTINE
{
IF &TRANSBUSOFF > 0
{
&D_CrsR = &toCRSR_window
}
}


Var 0050, name FD_SW_L, Link IOCARD_SW, Input 16, Type I
{
V2539 = CHANGEBITN 0 ,V2539
}


Var 2539, name FD_L, Value 1


Var 0051, name AT_ARM_SW, Link IOCARD_SW, Input 33, Type I
{
V2527 = CHANGEBITN 0 ,V2527
IF &AT_ARM_SW = 1 // Temporary fix
{
V2577 = 1 // Temporary fix
}
ELSE
{
V2577 = 0
}
}


Var 2527, name AT_ARM, Value 1
{
IF 2527 = 0 // Temporary fix
{
V2577 = 1 // Temporary fix
}
ELSE
{
}
}


Var 2538, name DISENGAGE_BAR, Link IOCARD_SW, Input 15, Type I


Var 0052, name FD_SW_R, Link IOCARD_SW, Input 14, Type I
{
V2540 = CHANGEBITN 0 ,V2540
}


Var 2540, name FD_R, Value 1


Var 2548, name N1_SW, Link IOCARD_SW, Input 32, Type P


Var 2551, name SPEED_SW


Var 2549, name SPD_INTV_SW


Var 0053, name t_SPEED_SW, Link IOCARD_SW, Input 31, Type I
{
IF &t_SPEED_SW = 1
{
&s_delay = DELAY 1 ,100
}
ELSE
{
}
}


Var 0054, name s_delay // value 0
{
IF &s_delay = 1
{
IF &t_SPEED_SW = 1
{
V2549 = CHANGEBITN 0 ,V2549
}
ELSE
{
V2551 = CHANGEBITN 0 ,V2551
}
ELSE
{
}
&s_delay = 0
}
}


Var 2531, name CO_SW, Link IOCARD_SW, Input 13, Type P


Var 2552, name VNAV_SW, Link IOCARD_SW, Input 30, Type P


Var 2546, name LVL_CHG_SW, Link IOCARD_SW, Input 29, Type P


Var 0055, name BANKHDG, Value 0 // BANK = 0 then HDG active


Var 0056, name t_delay // value 0
{
IF &t_delay = 1
{
IF &t_HDG_SEL_SW = 1
{
&BANKHDG = CHANGEBITN 0 ,&BANKHDG
}
ELSE
{
V2541 = CHANGEBITN 0 ,V2541
}
ELSE
{
}
&t_delay = 0
}
}


Var 2541, name HDG_SEL_SW


Var 2528, name BANKING_SEL_SW


Var 0057, name t_HDG_SEL_SW, Link IOCARD_SW, Input 28, Type I
{
IF &t_HDG_SEL_SW = 1
{
&t_delay = DELAY 1 ,100
}
ELSE
{
}
}


Var 2545, name LNAV_SW, Link IOCARD_SW, Input 27, Type P


Var 2553, name VOR_LOC_SW, Link IOCARD_SW, Input 25, Type P


Var 2526, name APP_SW, Link IOCARD_SW, Input 24, Type P


Var 2522, name ALT_HLD_SW


Var 2523, name ALT_INTV_SW, Value 0


Var 0058, name t_ALT_HLD_SW, Link IOCARD_SW, Input 23, Type I
{
IF &t_ALT_HLD_SW = 1
{
&a_delay = DELAY 1 ,100
}
ELSE
{
}
}


Var 0059, name a_delay // value 0
{
IF &a_delay = 1
{
IF &t_ALT_HLD_SW = 1
{
V2523 = 1
V2523 = DELAY 0 ,100
}
ELSE
{
V2522 = CHANGEBITN 0 ,V2522
}
ELSE
{
}
&a_delay = 0
}
}


Var 2556, name VS_SW, Link IOCARD_SW, Input 22, Type P


Var 2529, name CMD_A_SW, Link IOCARD_SW, Input 21, Type P


Var 2536, name CSW_A_SW, Link IOCARD_SW, Input 20, Type P


Var 2530, name CMD_B_SW, Link IOCARD_SW, Input 19, Type P


Var 2537, name CWS_B_SW, Link IOCARD_SW, Input 18, Type P


Var 2577, name annunATArm, Link IOCARD_OUT, Output 22 // Temporary fix see above
{
IF V2596 = 0
{
}
ELSE
{
&OannunATArm = V2577
}
}


Var 2563, name annunN1
{
IF V2596 = 0
{
}
ELSE
{
&OannunN1 = V2563
}
}


Var 2564, name annunSPEED
{
IF V2596 = 0
{
}
ELSE
{
&OannunSPEED = V2564
}
}


Var 2565, name annunVNAV
{
IF V2596 = 0
{
}
ELSE
{
&OannunVNAV = V2565
}
}


Var 2566, name annunLVL_CHG
{
IF V2596 = 0
{
}
ELSE
{
&OannunLVL_CHG = V2566
}
}


Var 2567, name annunHDG_SEL
{
IF V2596 = 0
{
}
ELSE
{
&OannunHDG_SEL = V2567
}
}


Var 2568, name annunLNAV
{
IF V2596 = 0
{
}
ELSE
{
&OannunLNAV = V2568
}
}


Var 2569, name annunVOR_LOC
{
IF V2596 = 0
{
}
ELSE
{
&OannunVOR_LOC = V2569
}
}


Var 2570, name annunAPP
{
IF V2596 = 0
{
}
ELSE
{
&OannunAPP = V2570
}
}


Var 2571, name annunALT_HLD
{
IF V2596 = 0
{
}
ELSE
{
&OannunALT_HLD = V2571
}
}


Var 2572, name annunVS
{
IF V2596 = 0
{
}
ELSE
{
&OannunVS = V2572
}
}


Var 2573, name annunCMD_A
{
IF V2596 = 0
{
}
ELSE
{
&OannunCMD_A = V2573
}
}


Var 2574, name annubCWS_A
{
IF V2596 = 0
{
}
ELSE
{
&OannunCWS_A = V2574
}
}


Var 2575, name annunCMD_B
{
IF V2596 = 0
{
}
ELSE
{
&OannunCMD_B = V2575
}
}


Var 2576, name annunCWS_B
{
IF V2596 = 0
{
}
ELSE
{
&OannunCWS_B = V2576
}
}


Var 0060, name OannunATArm, Link IOCARD_OUT, Output 22 // Temporary fix see above


Var 0061, name OannunN1, Link IOCARD_OUT, Output 21


Var 0062, name OannunSPEED, Link IOCARD_OUT, Output 23


Var 0063, name OannunVNAV, Link IOCARD_OUT, Output 25


Var 0064, name OannunLVL_CHG, Link IOCARD_OUT, Output 24


Var 0065, name OannunHDG_SEL, Link IOCARD_OUT, Output 26


Var 0066, name OannunLNAV, Link IOCARD_OUT, Output 29


Var 0067, name OannunVOR_LOC, Link IOCARD_OUT, Output 28


Var 0068, name OannunAPP, Link IOCARD_OUT, Output 27


Var 0069, name OannunALT_HLD, Link IOCARD_OUT, Output 30


Var 0070, name OannunVS, Link IOCARD_OUT, Output 31


Var 0071, name OannunCMD_A, Link IOCARD_OUT, Output 33


Var 0072, name OannunCWS_A, Link IOCARD_OUT, Output 32


Var 0073, name OannunCMD_B, Link IOCARD_OUT, Output 35


Var 0074, name OannunCWS_B, Link IOCARD_OUT, Output 34




//*******************************
//***************************************
//***** COMM 1 ******************************** //*********************************************


Var 1000 name Com1_act
Var 1002 name FS_C1_SB_BCD Link FSUIPC_INOUT Offset $311A Length 2 // FS COM1 standby frequency in BCD format
Var 1003 name FS_C1_ACT_BCD Link FSUIPC_INOUT Offset $034E Length 2 // FS COM1 active frequency in BCD format
{
&Com1_act = FROMBCD &FS_C1_ACT_BCD
CALL &OutCom1_Act
CALL &C1_LH_ROT_VAL // Align rotary with new C1 SB integer val
CALL &C1_RH_ROT_VAL // Align rotary with new C1 SB decimal val
CALL &C1_UPDATE_LHS
CALL &C1_UPDATE_RHS
CALL &OutCom1_SB
}


Var 1004 name FS_C1_SWAP Link FSUIPC_OUT Offset $3123 Length 1 // FS COM1 active standby swap


Var 1005 name C1_SB_AS_DEC // COM1 standby frequency in decimal format
Var 1006 name C1_SB_LHS // COM1 standby frequency integers
Var 1007 name C1_SB_RHS // COM1 standby frequency decimals
Var 1008 name C1_RHS_ROT_VAL // COM1 right hand rotary encoder ref value
Var 1009 name C1_LHS_ROT_VAL // COM1 left hand rotary encoder ref value






Var 1010 name ROT_C1_LHS Link IOCARD_ENCODER Device 1 Input 34 Aceleration 1 Type 2
{
L0 = &ROT_C1_LHS * -1
&C1_LHS_ROT_VAL = ROTATE 18 36 L0
CALL &C1_UPDATE_LHS
CALL &SET_FS_C1_SB
CALL &OutCom1_SB
}


Var 1011 name ROT_C1_RHS Link IOCARD_ENCODER Device 1 Input 32 Aceleration 1 Type 2
{
L0 = &ROT_C1_RHS * -1
&C1_RHS_ROT_VAL = ROTATE 0 39 L0
CALL &C1_UPDATE_RHS
CALL &SET_FS_C1_SB
CALL &OutCom1_SB
}


Var 1012 name SW_C1_SWAP Link IOCARD_SW Device 1 Input 27 Type 1 // Active/Standby swap button
{
&FS_C1_SWAP = TOGGLE 3
}


Var 1015 name SW_C1_TEST Link IOCARD_SW Device 1 Input 26 // COMM TEST button sends 8's to Displays
{
IF &SW_C1_TEST = 1
{
&DISP_C1_ACT = 88888
&DISP_C1_SB = 88888
}
ELSE
{
CALL &OutCom1_Act
CALL &OutCom1_SB
}
}


Var 1020 name DISP_C1_SB Link IOCARD_DISPLAY Device 1 Digit 0 Numbers 5 // Standby decimals
Var 1021 name DISP_C1_ACT Link IOCARD_DISPLAY Device 1 Digit 5 Numbers 5 // active display
Var 1022 name C1_DP Link IOCARD_OUT Device 1 Output 15 // Decimal Point


Var 1030 name C1_LH_ROT_VAL Link SUBRUTINE // Aligns LH rotary ref with COM1 SB freq
{
L0 = FROMBCD &FS_C1_SB_BCD
L1 = L0 / 100
&C1_LHS_ROT_VAL = TRUNC L1
}


Var 1031 name C1_RH_ROT_VAL Link SUBRUTINE // Aligns RH rotary ref with COM1 SB freq
{
L0 = FROMBCD &FS_C1_SB_BCD
L1 = &C1_LHS_ROT_VAL * 100
L2 = L0 - L1
&C1_RHS_ROT_VAL = L2 / 2.487179
}


Var 1032 name C1_UPDATE_LHS Link SUBRUTINE // Update COM1 stanby integers
{
&C1_SB_LHS = &C1_LHS_ROT_VAL
}




Var 1033 name C1_UPDATE_RHS Link SUBRUTINE // Update COM1 standby decimals
{
L0 = &C1_RHS_ROT_VAL * 2.5
&C1_SB_RHS = TRUNC L0
}




Var 1034 name SET_FS_C1_SB Link SUBRUTINE // Update COM1 standby frequency in FS
{
L0 = &C1_SB_LHS * 100
L1 = L0 + &C1_SB_RHS
&FS_C1_SB_BCD = TOBCD L1
}


Var 1040 name OutCom1_Act Link SUBRUTINE
{


//IF &MAST_SW = 1
//{
L0 = &Com1_act
&DISP_C1_ACT = L0 + 10000
}
//ELSE
//{
//&DISP_C1_ACT = -999999 // blank
//}
//}




Var 1041 name OutCom1_SB Link SUBRUTINE
{
//IF &MAST_SW = 1
//}
&C1_DP = 1
L0 = &C1_SB_LHS * 100
L1 = L0 + &C1_SB_RHS
&DISP_C1_SB = L1 + 10000
}
//ELSE
//{
//&C1_DP = 0
//&DISP_C1_SB = -999999 // blank


//}






//}










ALSO - To ROARK, the script labled "OCP4NGX_MCP_PP v1.05.txt" in the rk software folder DOES NOT COMPILE. see following error, so I can't use that script, thus why I chose the script with EFIS....





Config_SIOC ver 3.5 - By Manolo Vélez - www.opencockpits.comOpen file "C:\Program Files (x86)\IOCards\SIOC\rk software\OCP4NGX_MCP_PP v1.05.txt"
10:13:13 PM
Phase 1
.OK.

Phase 2
ERROR! - Not is a Var attribute
Line: 84 Var 2603 Static name BATTERY
==> Static

Roarkr
09-06-2012, 04:30 AM
hi,
there seems to be a conflic between the Fsuipc program and my OCP4NGX program which is based on the PMDG SDK and a C++ coded IOCP Client. try again with the file here (http://flightsim4fun.com/download-opencockpits-drivers.html), if it doesn't work you have to wait until I make the COMM1 & NAV integration to my OCP4NGX.
I have had the hardware for those moudules 95% ready for months now, hopefully I will finish them soon.

rgs

nolatron
09-06-2012, 07:50 AM
Are you compiling the two files together using the "Group > Run" tool in Config SIOC (http://www.lekseecon.nl/configsioc.html#multiplefiles)?

I have that same COMM/NAV code combined with Roakr's MCP file for the PMDG and it's working fine (other than my encoder jumping digits).

I used Config SIOC to export the OCPNGX SSI file to a txt file, then listed all my scripts in the config_sioc.ini file and did a "run" to merge them to a single custom SSI file to make sure no variables conflict.

n19htmare
09-07-2012, 12:11 AM
Are you compiling the two files together using the "Group > Run" tool in Config SIOC (http://www.lekseecon.nl/configsioc.html#multiplefiles)?

I have that same COMM/NAV code combined with Roakr's MCP file for the PMDG and it's working fine (other than my encoder jumping digits).

I used Config SIOC to export the OCPNGX SSI file to a txt file, then listed all my scripts in the config_sioc.ini file and did a "run" to merge them to a single custom SSI file to make sure no variables conflict.

No, But I Just did.
Now OCP4NGX does't crash anymore but MCP doesn't work. Even during Cold and Dark start, MCP never starts up :(.

Do you mind sharing your INI file and script? you can message me if needed.
I remember your COMM script in your thread but I did not see your MCP script.

My comm works flawlessly. It's the OCP4NGX not liking the combination. I don't see any reason why OCP4NGX doesn't like the addition of COMM1 script, even though it's a difference device and different variables.


hi,

there seems to be a conflic between the Fsuipc program and my OCP4NGX program which is based on the PMDG SDK and a C++ coded IOCP Client. try again with the file here (http://flightsim4fun.com/download-opencockpits-drivers.html), if it doesn't work you have to wait until I make the COMM1 & NAV integration to my OCP4NGX.
I have had the hardware for those moudules 95% ready for months now, hopefully I will finish them soon.

rgs

Thanks for the link Roarkr. That works. I dunno what's different in that script than the one I was compiling. I'll have to sit down and compare the two when I have some time.

Now I can fly and not spend hours everynight to get it work :)
THanks!

Roarkr
09-07-2012, 04:09 AM
Thanks for the link Roarkr. That works. I dunno what's different in that script than the one I was compiling. I'll have to sit down and compare the two when I have some time.

Now I can fly and not spend hours everynight to get it work :)
THanks![/FONT]

Hi,

The script you downloaded from my site was just a combined compilation of OCP4NGX_MCP_PP v1.05.txt and the COMM1 script from this thread.

rgs

n19htmare
09-08-2012, 02:26 AM
Hi,

The script you downloaded from my site was just a combined compilation of OCP4NGX_MCP_PP v1.05.txt and the COMM1 script from this thread.

rgs

I never got the OCP4NGX_MCP_PP 1.05.txt compiled as stated in above post. SO I never tried to combine it with the COMM1

Thank you!

Can you look into why the MCP_pp_1.05.txt doesn't compile? It's the one included in your install.




Config_SIOC ver 3.5 - By Manolo Vélez - www.opencockpits.comOpen file "C:\Program Files (x86)\IOCards\SIOC\rk software\OCP4NGX_MCP_PP v1.05.txt"
10:13:13 PM
Phase 1
.OK.

Phase 2
ERROR! - Not is a Var attribute
Line: 84 Var 2603 Static name BATTERY
==> Static

Roarkr
09-08-2012, 09:22 AM
I never got the OCP4NGX_MCP_PP 1.05.txt compiled as stated in above post. SO I never tried to combine it with the COMM1

Thank you!

Can you look into why the MCP_pp_1.05.txt doesn't compile? It's the one included in your install.




Config_SIOC ver 3.5 - By Manolo Vélez - www.opencockpits.comOpen file "C:\Program Files (x86)\IOCards\SIOC\rk software\OCP4NGX_MCP_PP v1.05.txt"
10:13:13 PM
Phase 1
.OK.

Phase 2
ERROR! - Not is a Var attribute
Line: 84 Var 2603 Static name BATTERY
==> Static



Hi,

I have no problem to compile the OCP4NGX_MCP_PP v1.05.txt file that is a part of the latest download from my site.

Do you use the latest sioc software? http://www.opencockpits.com/uploads/Sioc_42B2.zip


rgs