[== Indéfini ==]
// SIOC SCRIPT FOR PROSIM
// IDX DEVICES SHOULD BE:
// MCP = 0
// EFIS CAPT = 1
// EFIS F/O = 2
// ////////////////////////////////////////////////
// EFIS Capt
// Prosim reads from 500 - 522
// ////////////////////////////////////////////////
Var 500, name I_E1_DISPMODE
Var 501, name I_E1_ZOOM
Var 502, name I_E1_NAV1
Var 503, name I_E1_NAV2
Var 504, name I_E1_STA, Link IOCARD_SW, Device 1, Input 27
Var 505, name I_E1_WPT, Link IOCARD_SW, Device 1, Input 28
Var 506, name I_E1_CTR, Link IOCARD_SW, Device 1, Input 29
Var 507, name I_E1_ARPT, Link IOCARD_SW, Device 1, Input 30
Var 508, name I_E1_TFC, Link IOCARD_SW, Device 1, Input 31
Var 509, name I_E1_DATA, Link IOCARD_SW, Device 1, Input 32
Var 510, name I_E1_POS, Link IOCARD_SW, Device 1, Input 33
Var 511, name I_E1_FPV, Link IOCARD_SW, Device 1, Input 34
Var 512, name I_E1_MTR, Link IOCARD_SW, Device 1, Input 38
Var 513, name I_E1_MINRST
Var 514, name I_E1_QNHSTD
Var 515, name I_E1_MINRADIO
Var 516, name I_E1_MINBARO
Var 517, name I_E1_CHANGEMIN
Var 518, name I_E1_BAROHPA
Var 519, name I_E1_BAROINCH
Var 520, name I_E1_CHGBARO
Var 521, name I_E1_TERR
Var 522, name I_E1_WXR
Var 523, Link IOCARD_SW, Device 1, Input 10 // VOR mode
{
If V523 = 1
{
&I_E1_DISPMODE = 2
}
}
Var 524, Link IOCARD_SW, Device 1, Input 11 // MAP mode
{
If V524 = 1
{
&I_E1_DISPMODE = 3
}
}
Var 525, Link IOCARD_SW, Device 1, Input 12 // PLAN mode
{
If V525 = 1
{
&I_E1_DISPMODE = 4
}
}
Var 526, Link IOCARD_SW, Device 1, Input 0 // Range 5
{
If V526 = 1
{
&I_E1_ZOOM = 1
}
}
Var 527, Link IOCARD_SW, Device 1, Input 1 // Range 10
{
If V527 = 1
{
&I_E1_ZOOM = 2
}
}
Var 528, Link IOCARD_SW, Device 1, Input 2 // Range 20
{
If V528 = 1
{
&I_E1_ZOOM = 3
}
}
Var 529, Link IOCARD_SW, Device 1, Input 3 // Range 40
{
If V529 = 1
{
&I_E1_ZOOM = 4
}
}
Var 530, Link IOCARD_SW, Device 1, Input 4 // Range 80
{
If V530 = 1
{
&I_E1_ZOOM = 5
}
}
Var 531, Link IOCARD_SW, Device 1, Input 5 // Range 160
{
If V531 = 1
{
&I_E1_ZOOM = 6
}
}
Var 532, Link IOCARD_SW, Device 1, Input 6 // Range 320
{
If V532 = 1
{
&I_E1_ZOOM = 7
}
}
Var 533, Link IOCARD_SW, Device 1, Input 7 // Range 640
{
If V533 = 1
{
&I_E1_ZOOM = 8
}
}
Var 535, Link IOCARD_SW, Device 1, Input 36 // NAV 1 VOR
{
CALL &E1NAV1
}
Var 536, Link IOCARD_SW, Device 1, Input 37 // NAV 1 ADF
{
CALL &E1NAV1
}
var 537, name E1NAV1, Link SUBRUTINE
{
If V535 = 1
{
&I_E1_NAV1 = 1
}
Else
{
If V536 = 1
{
&I_E1_NAV1 = 2
}
Else
{
&I_E1_NAV1 = 0
}
}
}
Var 538, Link IOCARD_SW, Device 1, Input 18 // NAV 2 VOR
{
CALL &E1NAV2
}
Var 539, Link IOCARD_SW, Device 1, Input 19 // NAV 2 ADF
{
CALL &E1NAV2
}
var 540, name E1NAV2, Link SUBRUTINE
{
If V538 = 1
{
&I_E1_NAV2 = 1
}
Else
{
If V539 = 1
{
&I_E1_NAV2 = 2
}
Else
{
&I_E1_NAV2 = 0
}
}
}
Var 541, Link IOCARD_SW, Device 1, Input 9 // APP mode
{
If V541 = 1
{
&I_E1_DISPMODE = 1
}
}
var 550, name Min1Moved
Var 551, name Bar1Moved
// Minimums knob push button
Var 552, Link IOCARD_SW, Device 1, Input 25
{
If V552 = 1
{
&Min1Moved = 0
}
Else
{
If &Min1Moved = 0
{
&I_E1_MINRST = Toggle 0
}
}
}
// QNH knob push button
Var 553, Link IOCARD_SW, Device 1, Input 22
{
If V553 = 1
{
&Bar1Moved = 0
}
Else
{
If &Bar1Moved = 0
{
&I_E1_QNHSTD = Toggle 0
}
}
}
// Minimums rotary encoder
Var 554, Link IOCARD_ENCODER, Device 1, Input 23, Aceleration 4, Type 2
{
&Min1Moved = 1
If V552 = 1
{
If V554 > 0
{
&I_E1_MINRADIO = Toggle 0
}
Else
{
&I_E1_MINBARO = Toggle 0
}
}
Else
{
&I_E1_CHANGEMIN = V554 * -1
&I_E1_CHANGEMIN = 0
}
}
// QNH rotary encoder
Var 555, Link IOCARD_ENCODER, Device 1, Input 20, Aceleration 4, Type 2
{
&Bar1Moved = 1
If V553 = 1
{
If V555 > 0
{
&I_E1_BAROINCH = Toggle 0
}
Else
{
&I_E1_BAROHPA = Toggle 0
}
}
Else
{
&I_E1_CHGBARO = V555 * -1
&I_E1_CHGBARO = 0
}
}
// ///////////////////////////////////
// End EFIS Captain
// ///////////////////////////////////
// ////////////////////////////////////////////////
// EFIS F/O
// ////////////////////////////////////////////////
Var 600, name I_E2_DISPMODE
Var 601, name I_E2_ZOOM
Var 602, name I_E2_NAV1
Var 603, name I_E2_NAV2
Var 604, name I_E2_STA, Link IOCARD_SW, Device 2, Input 27
Var 605, name I_E2_WPT, Link IOCARD_SW, Device 2, Input 28
Var 606, name I_E2_CTR, Link IOCARD_SW, Device 2, Input 29
Var 607, name I_E2_ARPT, Link IOCARD_SW, Device 2, Input 30
Var 608, name I_E2_TFC, Link IOCARD_SW, Device 2, Input 31
Var 609, name I_E2_DATA, Link IOCARD_SW, Device 2, Input 32
Var 610, name I_E2_POS, Link IOCARD_SW, Device 2, Input 33
Var 611, name I_E2_FPV, Link IOCARD_SW, Device 2, Input 34
Var 612, name I_E2_MTR, Link IOCARD_SW, Device 2, Input 38
Var 613, name I_E2_MINRST
Var 614, name I_E2_QNHSTD
Var 615, name I_E2_MINRADIO
Var 616, name I_E2_MINBARO
Var 617, name I_E2_CHANGEMIN
Var 618, name I_E2_BAROHPA
Var 619, name I_E2_BAROINCH
Var 620, name I_E2_CHGBARO
Var 621, name I_E2_TERR
Var 622, name I_E2_WXR
Var 623, Link IOCARD_SW, Device 2, Input 10 // VOR mode
{
If V623 = 1
{
&I_E2_DISPMODE = 2
}
}
Var 624, Link IOCARD_SW, Device 2, Input 11 // MAP mode
{
If V624 = 1
{
&I_E2_DISPMODE = 3
}
}
Var 625, Link IOCARD_SW, Device 2, Input 12 // PLAN mode
{
If V625 = 1
{
&I_E2_DISPMODE = 4
}
}
Var 626, Link IOCARD_SW, Device 2, Input 0 // Range 5
{
If V626 = 1
{
&I_E2_ZOOM = 1
}
}
Var 627, Link IOCARD_SW, Device 2, Input 1 // Range 10
{
If V627 = 1
{
&I_E2_ZOOM = 2
}
}
Var 628, Link IOCARD_SW, Device 2, Input 2 // Range 20
{
If V628 = 1
{
&I_E2_ZOOM = 3
}
}
Var 629, Link IOCARD_SW, Device 2, Input 3 // Range 40
{
If V629 = 1
{
&I_E2_ZOOM = 4
}
}
Var 630, Link IOCARD_SW, Device 2, Input 4 // Range 80
{
If V630 = 1
{
&I_E2_ZOOM = 5
}
}
Var 631, Link IOCARD_SW, Device 2, Input 5 // Range 160
{
If V631 = 1
{
&I_E2_ZOOM = 6
}
}
Var 632, Link IOCARD_SW, Device 2, Input 6 // Range 320
{
If V632 = 1
{
&I_E2_ZOOM = 7
}
}
Var 633, Link IOCARD_SW, Device 2, Input 7 // Range 640
{
If V633 = 1
{
&I_E2_ZOOM = 8
}
}
Var 635, Link IOCARD_SW, Device 2, Input 36 // NAV 1 VOR
{
CALL &E2NAV1
}
Var 636, Link IOCARD_SW, Device 2, Input 37 // NAV 1 ADF
{
CALL &E2NAV1
}
var 637, name E2NAV1, Link SUBRUTINE
{
If V635 = 1
{
&I_E2_NAV1 = 1
}
Else
{
If V636 = 1
{
&I_E2_NAV1 = 2
}
Else
{
&I_E2_NAV1 = 0
}
}
}
Var 638, Link IOCARD_SW, Device 2, Input 18 // NAV 2 VOR
{
CALL &E2NAV2
}
Var 639, Link IOCARD_SW, Device 2, Input 19 // NAV 2 ADF
{
CALL &E2NAV2
}
var 640, name E2NAV2, Link SUBRUTINE
{
If V638 = 1
{
&I_E2_NAV2 = 1
}
Else
{
If V639 = 1
{
&I_E2_NAV2 = 2
}
Else
{
&I_E2_NAV2 = 0
}
}
}
Var 641, Link IOCARD_SW, Device 2, Input 9 // APP mode
{
If V641 = 1
{
&I_E2_DISPMODE = 1
}
}
var 650, name Min2Moved
Var 651, name Bar2Moved
Var 652, Link IOCARD_SW, Device 2, Input 25
{
If V652 = 1
{
&Min2Moved = 0
}
Else
{
If &Min2Moved = 0
{
&I_E2_MINRST = Toggle 0
}
}
}
Var 653, Link IOCARD_SW, Device 2, Input 22
{
If V653 = 1
{
&Bar2Moved = 0
}
Else
{
If &Bar2Moved = 0
{
&I_E2_QNHSTD = Toggle 0
}
}
}
Var 654, Link IOCARD_ENCODER, Device 2, Input 23, Aceleration 4, Type 2
{
&Min2Moved = 1
If V652 = 1
{
If V654 > 0
{
&I_E2_MINRADIO = Toggle 0
}
Else
{
&I_E2_MINBARO = Toggle 0
}
}
Else
{
&I_E2_CHANGEMIN = V654 * -1
&I_E2_CHANGEMIN = 0
}
}
Var 655, Link IOCARD_ENCODER, Device 2, Input 20, Aceleration 4, Type 2
{
&Bar2Moved = 1
If V653 = 1
{
If V655 > 0
{
&I_E2_BAROINCH = Toggle 0
}
Else
{
&I_E2_BAROHPA = Toggle 0
}
}
Else
{
&I_E2_CHGBARO = V655 * -1
&I_E2_CHGBARO = 0
}
}
// ///////////////////////////
// End EFIS F/O
// ///////////////////////////
// ///////////////////////////
// MCP
// ///////////////////////////
// INITIALIZATION
Var 0000, Value 0
{
&SUB_BLINK = 0
&SUB_BLINK = TIMER 1, 0, 100
}
// DIGITS
// These are the actual MCP values that are read and written by Prosim. They need to be whole values.
Var 100, name D_COURSE1, Link IOCARD_DISPLAY, Device 0, Digit 0, Numbers 3
Var 102, name D_IAS, Link IOCARD_DISPLAY, Device 0, Digit 3, Numbers 3
Var 104, name D_HDG, Link IOCARD_DISPLAY, Device 0, Digit 6, Numbers 3
Var 106, name D_ALT, Link IOCARD_DISPLAY, Device 0, Digit 9, Numbers 5
Var 108, name D_VS, Link IOCARD_DISPLAY, Device 0, Digit 14, Numbers 5
Var 110, name D_COURSE2, Link IOCARD_DISPLAY, Device 0, Digit 19, Numbers 3
Var 112, Name VS_Trigger // Vertical Speed Trigger
// This variable is set to 1 when the VS wheel is rotated while the VS display is blanked.
// This can trigger a V/S mode if MCP altitude is different than current altitude.
Var 114, name BRIGHT, Link IOCARD_DISPLAY, Device 0, Digit 32, Numbers 3 // Bright control for digits
Var 116, name D_IAS_IND, Link IOCARD_DISPLAY, Device 0, Digit 22, Numbers 1
Var 118, name SUB_BLINK, Link SUBRUTINE
{
If &Inhibit_IAS = 0
{
IF &O_IASSYMB = 0
{
&D_IAS_IND = -999999
}
ELSE
{
IF &O_IASSYMB = 1
{
&D_IAS_IND = -999996
&D_IAS_IND = DELAY -999999 80
}
IF &O_IASSYMB = 2
{
&D_IAS_IND = 8
&D_IAS_IND = DELAY -999999 80
}
}
}
}
Var 120, name HDG_temp
Var 122, name BANK_act
// OUTPUTS
// These are the lights on the MCP, written by Prosim
Var 200, name DECIMAL
{
If &Inhibit_IAS = 0 // Do not place the decimal if the display is blanked
{
&IAS_DOT = &DECIMAL
}
}
Var 201, name IAS_DOT, Link IOCARD_OUT, Device 0, Output 20
Var 202, name O_N1, Link IOCARD_OUT, Device 0, Output 21
Var 204, name O_AT, Link IOCARD_OUT, Device 0, Output 22
Var 206, name O_SPEED, Link IOCARD_OUT, Device 0, Output 23
Var 208, name O_LVLCHG, Link IOCARD_OUT, Device 0, Output 24
Var 210, name O_VNAV, Link IOCARD_OUT, Device 0, Output 25
Var 212, name O_HDGSEL, Link IOCARD_OUT, Device 0, Output 26
Var 214, name O_APP, Link IOCARD_OUT, Device 0, Output 27
Var 216, name O_VORLOC, Link IOCARD_OUT, Device 0, Output 28
Var 218, name O_LNAV, Link IOCARD_OUT, Device 0, Output 29
Var 220, name O_ALTHLD, Link IOCARD_OUT, Device 0, Output 30
Var 222, name O_VS, Link IOCARD_OUT, Device 0, Output 31
Var 224, name O_CWSA, Link IOCARD_OUT, Device 0, Output 32
Var 226, name O_CMDA, Link IOCARD_OUT, Device 0, Output 33
Var 228, name O_CWSB, Link IOCARD_OUT, Device 0, Output 34
Var 230, name O_CMDB, Link IOCARD_OUT, Device 0, Output 35
Var 232, name O_FD1, Link IOCARD_OUT, Device 0, Output 37
Var 234, name O_FD2, Link IOCARD_OUT, Device 0, Output 36
Var 236, name O_IASSYMB // Flashing A/B in IAS window, 0=No warning, 1=Flashing A, 2=Flashing B
Var 238, name O_BACKLIGHT // Backlight: 1 = on, 0 = off
// ROTARY ENCODERS
// The rotary encoders control the MCP values. The actual rotary encoder variables are not read or written by Prosim.
// The rotary encoders change the MCP values. Before doing this, they will check the associated inhibit variable, to
// see if the display is not blanked. If the display is blanked, the rotary encoder ds nothing.
Var 300, name E_IAS, Link IOCARD_ENCODER, Device 0, Input 0, Aceleration 4, Type 2
{
If &Inhibit_IAS = 0
{
L0 = -1 * V300
If &DECIMAL = 1
{
V102 = LIMIT 50, 90, L0
}
Else
{
V102 = LIMIT 110, 400, L0
}
}
}
Var 302, name E_ALT, Link IOCARD_ENCODER, Device 0, Input 2, Aceleration 4, Type 2
{
If &Inhibit_Alt = 0
{
L0 = -100 * V302
V106 = LIMIT 0 ,50000, L0
}
}
Var 304, name E_COURSE1, Link IOCARD_ENCODER, Device 0, Input 4, Aceleration 4, Type 2
{
If &Inhibit_OBS1 = 0
{
L0 = V304 * -1
V100 = ROTATE 0, 359, L0
}
}
Var 306, name E_HDG, Link IOCARD_ENCODER, Device 0, Input 6, Aceleration 4, Type 2
{
If &Inhibit_HDG = 0
{
If &Bank_act = 0
{
L0 = &E_HDG * -1
&D_HDG = ROTATE 0, 359, L0
&HDG_temp = &D_HDG
}
If &I_BANK_SW = 1
{
&D_HDG = &I_BANK_LIMIT
L1 = &E_HDG * -5
&D_HDG = LIMIT 10, 30, L1
&I_BANK_LIMIT = &D_HDG
}
ELSE
{
&D_HDG = &HDG_temp
}
}
}
Var 308, name E_COURSE2, Link IOCARD_ENCODER, Device 0, Input 9, Aceleration 4, Type 2
{
If &Inhibit_OBS2 = 0
{
L0 = V308 * -1
V110 = ROTATE 0, 359, L0
}
}
Var 310, name E_VS, Link IOCARD_ENCODER, Device 0, Input 11, Aceleration 4, Type 2
{
If &Inhibit_VS = 0
{
L0 = V310 * -50
V108 = LIMIT -7000, 7000, L0
}
Else
{
&VS_Trigger = 1
}
}
// Display Inhibit
// Display inhibit variables signal the blanking of the displays. They are written by Prosim
Var 320, name Inhibit_IAS
{
If V320 = 1
{
&D_IAS = -999999
V201 = 0
}
Else
{
V201 = &DECIMAL
}
}
Var 322, name Inhibit_Alt
{
If V322 = 1
{
&D_ALT = -999999
}
}
Var 324, name Inhibit_OBS1
{
If V324 = 1
{
&D_COURSE1 = -999999
}
}
Var 326, name Inhibit_HDG
{
If V326 = 1
{
&D_HDG = -999999
}
}
Var 328, name Inhibit_OBS2
{
If V328 = 1
{
&D_COURSE2 = -999999
}
}
Var 330, name Inhibit_VS
{
If V330 = 1
{
&D_VS = -999999
}
}
// SWITCHES
// The MCP switches are read by Prosim
Var 400, name I_CO, Link IOCARD_SW, Device 0, Input 13
Var 402, name I_FD2, Link IOCARD_SW, Device 0, Input 14
Var 404, name I_DISENGAGE, Link IOCARD_SW, Device 0, Input 15
Var 406, name I_FD1, Link IOCARD_SW, Device 0, Input 16
Var 408, name I_CWSB, Link IOCARD_SW, Device 0, Input 18
Var 410, name I_CMDB, Link IOCARD_SW, Device 0, Input 19
Var 412, name I_CWSA, Link IOCARD_SW, Device 0, Input 20
Var 414, name I_CMDA, Link IOCARD_SW, Device 0, Input 21
Var 416, name I_VS, Link IOCARD_SW, Device 0, Input 22
Var 418, name I_ALTHLD, Link IOCARD_SW, Device 0, Input 23
Var 420, name I_APP, Link IOCARD_SW, Device 0, Input 24
Var 422, name I_VORLOC, Link IOCARD_SW, Device 0, Input 25
Var 424, name I_LNAV, Link IOCARD_SW, Device 0, Input 27
Var 426, name I_HDGSEL, Link IOCARD_SW, Device 0, Input 28
Var 428, name I_LVLCHG, Link IOCARD_SW, Device 0, Input 29
Var 430, name I_VNAV, Link IOCARD_SW, Device 0, Input 30
Var 432, name I_SPEED, Link IOCARD_SW, Device 0, Input 31
Var 434, name I_N1, Link IOCARD_SW, Device 0, Input 32
Var 436, name I_AT, Link IOCARD_SW, Device 0, Input 33
Var 438, name I_SPD_INTER, Link IOCARD_SW, Device 0, Input 37
Var 440, name I_ALT_INTER, Link IOCARD_SW, Device 0, Input 36
Var 442, name I_BANK_LIMIT, VALUE 10
Var 444, name I_BANK_SW, Link IOCARD_SW, Device 0, Input 34 // Activate bank limit
{
If &I_BANK_SW = 1
{
&Bank_act = 1
&D_HDG = &I_BANK_LIMIT
}
Else
{
&Bank_act = 0
&D_HDG = &HDG_temp
}
}
// ///////////////////////////
// END MCP
// ///////////////////////////
// *****************************************************************************
// * PEDESTAL
// *****************************************************************************
var 1,value 0
{
&ent_com1 = 118
&dec_com1 = 0
&act_com1 = 118000
&enc_com1 = 1
&ent_com2 = 118
&dec_com2 = 0
&act_com2 = 118000
&enc_com2 = 1
&ent_nav1 = 108
&dec_nav1 = 0
&act_nav1 = 10800
&enc_nav1 = 1
&ent_nav2 = 108
&dec_nav2 = 0
&act_nav2 = 10800
&enc_nav2 = 1
&ent_adf1 = 10
&dec_adf1 = 0
&act_adf1 = 1000
&enc_adf1 = 1
&danta_adf1 = 1
&dants_adf1 = 1
&dadfa_adf1 = 0
&dadfs_adf1 = 0
&ent_adf2 = 10
&dec_adf2 = 0
&act_adf2 = 1000
&enc_adf2 = 1
&danta_adf2 = 1
&dants_adf2 = 1
&dadfa_adf2 = 0
&dadfs_adf2 = 0
// ATC
&timerup = 0
&D_ACTIVE = 1200
&lastst = 0
&DIG_POS_STATUS = 5
&DIS_ATC = 1
&DIS_1 = 1
&DIS_2 = 0
&timeratc = 0
&timeratc = TIMER 1,0,35
}
// ************************************************************
// ******************************** COM1 **********************
// ************************************************************
var 2, name enc_com1
{
if &enc_com1 = 1
{
&io_pt_com1 = 1
&io_pt2_com1 = 1
call &sub_d_com1
&id2_com1 = &act_com1
}
else
{
&io_pt_com1 = 0
&io_pt2_com1 = 0
&id_com1 = -999999
&id2_com1 = -999999
}
}
var 4, name ent_com1
var 6, name dec_com1
var 8, name ie_dec_com1, link IOCARD_ENCODER, input 0, type 2, aceleration 1, device 40
{
if &enc_com1 = 1
{
l0 = &ie_dec_com1 * 25
l1 = &dec_com1 + l0
if l1 < 0
{
l1 = 975
}
if l1 > 975
{
l1 = 0
}
&dec_com1 = l1
call &sub_d_com1
}
}
var 10, name ie_ent_com1, link IOCARD_ENCODER, input 2, type 2, aceleration 1, device 40
{
if &enc_com1 = 1
{
l0 = &ie_ent_com1 * -1
&ent_com1 = rotate 118,135,l0
call &sub_d_com1
}
}
var 12, name id_com1,link IOCARD_DISPLAY, digit 6, numbers 6, device 40
var 14, name sub_d_com1, link SUBRUTINE
{
l0 = &ent_com1 * 1000
&id_com1 = l0 + &dec_com1
}
var 16, name io_pt_com1, link IOCARD_OUT, output 11, device 40
var 18, name ii_sw_com1, link IOCARD_SW, input 5, device 40
{
if &ii_sw_com1 = 1
{
if &enc_com1 = 1
{
l0 = &ent_com1 * 1000
l0 = l0 + &dec_com1
l1 = div &act_com1 1000
l2 = mod &act_com1 1000
&act_com1 = l0
&ent_com1 = l1
&dec_com1 = l2
call &sub_d_com1
&id2_com1 = &act_com1
}
}
}
var 20, name act_com1
var 22, name id2_com1,link IOCARD_DISPLAY, digit 0, numbers 6, device 40
{
if &id2_com1 > 0
{
&xp_com1 = div &id2_com1 10
}
}
var 24, name io_pt2_com1, link IOCARD_OUT, output 11, device 40
var 26, name xp_com1, value 11800
{
l0 = &xp_com1 - 10000
&fcom1 = tobcd l0
}
// ************************************************************
// ******************************** COM2 **********************
// ************************************************************
var 1102, name enc_com2
{
if &enc_com2 = 1
{
&io_pt_com2 = 1
&io_pt2_com2 = 1
call &sub_d_com2
&id2_com2 = &act_com2
}
else
{
&io_pt_com2 = 0
&io_pt2_com2 = 0
&id_com2 = -999999
&id2_com2 = -999999
}
}
var 1104, name ent_com2
var 1106, name dec_com2
var 1108, name ie_dec_com2, link IOCARD_ENCODER, input 72, type 2, aceleration 1, device 40
{
if &enc_com2 = 1
{
l0 = &ie_dec_com2 * 25
l1 = &dec_com2 + l0
if l1 < 0
{
l1 = 975
}
if l1 > 975
{
l1 = 0
}
&dec_com2 = l1
call &sub_d_com2
}
}
var 1110, name ie_ent_com2, link IOCARD_ENCODER, input 74, type 2, aceleration 1, device 40
{
if &enc_com2 = 1
{
l0 = &ie_ent_com2 * -1
&ent_com2 = rotate 118,135,l0
call &sub_d_com2
}
}
var 1112, name id_com2,link IOCARD_DISPLAY, digit 70, numbers 6, device 40
var 1114, name sub_d_com2, link SUBRUTINE
{
l0 = &ent_com2 * 1000
&id_com2 = l0 + &dec_com2
}
var 1116, name io_pt_com2, link IOCARD_OUT, output 75, device 40
var 1118, name ii_sw_com2, link IOCARD_SW, input 77, device 40
{
if &ii_sw_com2 = 1
{
if &enc_com2 = 1
{
l0 = &ent_com2 * 1000
l0 = l0 + &dec_com2
l1 = div &act_com2 1000
l2 = mod &act_com2 1000
&act_com2 = l0
&ent_com2 = l1
&dec_com2 = l2
call &sub_d_com2
&id2_com2 = &act_com2
}
}
}
var 1120, name act_com2
var 1122, name id2_com2,link IOCARD_DISPLAY, digit 64, numbers 6, device 40
{
if &id2_com2 > 0
{
&xp_com2 = div &id2_com2 10
}
}
var 1124, name io_pt2_com2, link IOCARD_OUT, output 75, device 40
var 1126, name xp_com2, value 11800
{
l0 = &xp_com2 - 10000
&fcom2 = tobcd l0
}
// *********************************************
// ******************* NAV1 *******************
// *********************************************
var 54, name enc_nav1
{
if &enc_nav1 = 1
{
&io_pt_nav1 = 1
&io_pt2_nav1 = 1
call &sub_d_nav1
&id2_nav1 = &act_nav1
}
else
{
&io_pt_nav1 = 0
&io_pt2_nav1 = 0
&id_nav1 = -999999
&id2_nav1 = -999999
}
}
var 56, name ent_nav1
var 58, name dec_nav1
var 60, name ie_dec_nav1, link IOCARD_ENCODER, input 9, type 2, aceleration 1, device 40
{
if &enc_nav1 = 1
{
l0 = &ie_dec_nav1 * 25
l1 = &dec_nav1 + l0
if l1 < 0
{
l1 = 975
}
if l1 > 975
{
l1 = 0
}
&dec_nav1 = l1
call &sub_d_nav1
}
}
var 62, name ie_ent_nav1, link IOCARD_ENCODER, input 11, type 2, aceleration 1, device 40
{
if &enc_nav1 = 1
{
l0 = &ie_ent_nav1 * -1
&ent_nav1 = rotate 108,117,l0
call &sub_d_nav1
}
}
var 64, name id_nav1,link IOCARD_DISPLAY, digit 21, numbers 5, device 40
var 66, name sub_d_nav1, link SUBRUTINE
{
l0 = &ent_nav1 * 100
l1 = div &dec_nav1 10
&id_nav1 = l0 + l1
}
var 68, name io_pt_nav1, link IOCARD_OUT, output 12, device 40
var 70, name ii_sw_nav1, link IOCARD_SW, input 14, device 40
{
if &ii_sw_nav1 = 1
{
if &enc_nav1 = 1
{
l0 = &ent_nav1 * 100
l1 = div &dec_nav1 10
l0 = l0 + l1
l1 = div &act_nav1 100
l2 = mod &act_nav1 100
&act_nav1 = l0
&ent_nav1 = l1
l0 = mod l2 10
l2 = l2 * 10
if l0 > 0
{
l2 = l2 + 5
}
&dec_nav1 = l2
call &sub_d_nav1
&id2_nav1 = &act_nav1
}
}
}
var 72, name act_nav1
var 74, name id2_nav1,link IOCARD_DISPLAY, digit 16, numbers 5, device 40
{
if &id2_nav1 > 0
{
&xp_nav1 = &id2_nav1
}
}
var 76, name io_pt2_nav1, link IOCARD_OUT, output 12, device 40
var 78, name xp_nav1, value 10800
{
l0 = &xp_nav1 - 10000
&fnav1 = tobcd l0
}
// *********************************************
// ******************* NAV2 *******************
// *********************************************
var 154, name enc_nav2
{
if &enc_nav2 = 1
{
&io_pt_nav2 = 1
&io_pt2_nav2 = 1
call &sub_d_nav2
&id2_nav2 = &act_nav2
}
else
{
&io_pt_nav2 = 0
&io_pt2_nav2 = 0
&id_nav2 = -999999
&id2_nav2 = -999999
}
}
var 156, name ent_nav2
var 158, name dec_nav2
var 160, name ie_dec_nav2, link IOCARD_ENCODER, input 81, type 2, aceleration 1, device 40
{
if &enc_nav2 = 1
{
l0 = &ie_dec_nav2 * 25
l1 = &dec_nav2 + l0
if l1 < 0
{
l1 = 975
}
if l1 > 975
{
l1 = 0
}
&dec_nav2 = l1
call &sub_d_nav2
}
}
var 162, name ie_ent_nav2, link IOCARD_ENCODER, input 83, type 2, aceleration 1, device 40
{
if &enc_nav2 = 1
{
l0 = &ie_ent_nav2 * -1
&ent_nav2 = rotate 108,117,l0
call &sub_d_nav2
}
}
var 164, name id_nav2,link IOCARD_DISPLAY, digit 85, numbers 5, device 40
var 166, name sub_d_nav2, link SUBRUTINE
{
l0 = &ent_nav2 * 100
l1 = div &dec_nav2 10
&id_nav2 = l0 + l1
}
var 168, name io_pt_nav2, link IOCARD_OUT, output 76, device 40
var 170, name ii_sw_nav2, link IOCARD_SW, input 86, device 40
{
if &ii_sw_nav2 = 1
{
if &enc_nav2 = 1
{
l0 = &ent_nav2 * 100
l1 = div &dec_nav2 10
l0 = l0 + l1
l1 = div &act_nav2 100
l2 = mod &act_nav2 100
&act_nav2 = l0
&ent_nav2 = l1
l0 = mod l2 10
l2 = l2 * 10
if l0 > 0
{
l2 = l2 + 5
}
&dec_nav2 = l2
call &sub_d_nav2
&id2_nav2 = &act_nav2
}
}
}
var 172, name act_nav2
var 174, name id2_nav2,link IOCARD_DISPLAY, digit 80, numbers 5, device 40
{
if &id2_nav2 > 0
{
&xp_nav2 = &id2_nav2
}
}
var 176, name io_pt2_nav2, link IOCARD_OUT, output 76, device 40
var 178, name xp_nav2, value 10800
{
l0 = &xp_nav2 - 10000
&fnav2 = tobcd l0
}
// *********************************************
// ******************* ADF1 *******************
// *********************************************
var 1218, name enc_adf1
{
if &enc_adf1 = 1
{
&io_pt_adf1 = 1
call &sub_d_adf1
&id2_adf1 = &act_adf1
&o_adf1 = 1
}
else
{
&io_pt_adf1 = 0
&id_adf1 = -999999
&id2_adf1 = -999999
&o_adf1 = 0
}
}
var 1220, name ent_adf1
var 1222, name dec_adf1
var 1224, name ie_dec_adf1, link IOCARD_ENCODER, input 18, type 2, aceleration 5, device 40
{
if &enc_adf1 = 1
{
l0 = &ie_dec_adf1 * 1
l1 = &dec_adf1 + l0
if l1 < 0
{
l1 = 99
}
if l1 > 99
{
l1 = 0
}
&dec_adf1 = l1
call &sub_d_adf1
}
}
var 1226, name ie_ent_adf1, link IOCARD_ENCODER, input 20, type 2, aceleration 4, device 40
{
if &enc_adf1 = 1
{
l0 = &ie_ent_adf1 * -1
l1 = &ent_adf1 + l0
if l1 < 10
{
l1 = 179
}
if l1 > 179
{
l1 = 10
}
&ent_adf1 = l1
call &sub_d_adf1
}
}
var 1228, name id_adf1,link IOCARD_DISPLAY, digit 37, numbers 5, device 40
var 1230, name sub_d_adf1, link SUBRUTINE
{
l0 = &ent_adf1 * 100
l1 = &dec_adf1
&id_adf1 = l0 + l1
}
var 1234, name ii_sw_adf1, link IOCARD_SW, input 23,device 40
{
if &ii_sw_adf1 = 1
{
if &enc_adf1 = 1
{
l0 = &ent_adf1 * 100
l1 = &dec_adf1
l0 = l0 + l1
l1 = div &act_adf1 100
l2 = mod &act_adf1 100
&act_adf1 = l0
&ent_adf1 = l1
&dec_adf1 = l2
call &sub_d_adf1
&id2_adf1 = &act_adf1
}
}
}
var 1236, name act_adf1
var 1238, name id2_adf1,link IOCARD_DISPLAY, digit 32, numbers 5, device 40
{
if &id2_adf1 > 0
{
&xp_adf1 = &id2_adf1
}
}
var 1240, name io_pt_adf1, link IOCARD_OUT, output 13, device 40
Var 1242, name o_adf1
var 1254, name xp_adf1
{
l0 = div &xp_adf1 10000
l1 = l0 * 10000
l2 = &xp_adf1 - l1
l2 = div l2 10
&fadf1A = tobcd l2
l0 = l0 * 100
l1 = div &xp_adf1 10
l1 = l1 * 10
l2 = &xp_adf1 - l1
l2 = l2 + l0
&fadf1B = tobcd l2
}
var 1256, name ant_adf1, link IOCARD_SW, input 22, device 40
{
if &ant_adf1 = 1
{
&danta_adf1 = 0
&dants_adf1 = 0
&dadfa_adf1 = 1
&dadfs_adf1 = 1
}
else
{
&danta_adf1 = 1
&dants_adf1 = 1
&dadfa_adf1 = 0
&dadfs_adf1 = 0
}
}
var 1258, name danta_adf1, link IOCARD_DISPLAY, digit 43, numbers 1, device 40
var 1260, name dants_adf1, link IOCARD_DISPLAY, digit 44, numbers 1, device 40
var 1262, name dadfa_adf1, link IOCARD_DISPLAY, digit 42, numbers 1, device 40
var 1264, name dadfs_adf1, link IOCARD_DISPLAY, digit 45, numbers 1, device 40
Var 1266, name S_ADF1TONE, Link IOCARD_SW, Input 24, device 40
{
&toneadf1 = CHANGEBITN 0 &S_ADF1TONE
}
// *********************************************
// ******************* ADF2 *******************
// *********************************************
var 1318, name enc_adf2
{
if &enc_adf2 = 1
{
&io_pt_adf2 = 1
call &sub_d_adf2
&id2_adf2 = &act_adf2
&o_adf2 = 1
}
else
{
&io_pt_adf2 = 0
&id_adf2 = -999999
&id2_adf2 = -999999
&o_adf2 = 0
}
}
var 1320, name ent_adf2
var 1322, name dec_adf2
var 1324, name ie_dec_adf2, link IOCARD_ENCODER, input 90, type 2, aceleration 5, device 40
{
if &enc_adf2 = 1
{
l0 = &ie_dec_adf2 * 1
l1 = &dec_adf2 + l0
if l1 < 0
{
l1 = 99
}
if l1 > 99
{
l1 = 0
}
&dec_adf2 = l1
call &sub_d_adf2
}
}
var 1326, name ie_ent_adf2, link IOCARD_ENCODER, input 92, type 2, aceleration 4, device 40
{
if &enc_adf2 = 1
{
l0 = &ie_ent_adf2 * -1
l1 = &ent_adf2 + l0
if l1 < 10
{
l1 = 179
}
if l1 > 179
{
l1 = 10
}
&ent_adf2 = l1
call &sub_d_adf2
}
}
var 1328, name id_adf2,link IOCARD_DISPLAY, digit 101, numbers 5, device 40
var 1330, name sub_d_adf2, link SUBRUTINE
{
l0 = &ent_adf2 * 100
l1 = &dec_adf2
&id_adf2 = l0 + l1
}
var 1334, name ii_sw_adf2, link IOCARD_SW, input 95,device 40
{
if &ii_sw_adf2 = 1
{
if &enc_adf2 = 1
{
l0 = &ent_adf2 * 100
l1 = &dec_adf2
l0 = l0 + l1
l1 = div &act_adf2 100
l2 = mod &act_adf2 100
&act_adf2 = l0
&ent_adf2 = l1
&dec_adf2 = l2
call &sub_d_adf2
&id2_adf2 = &act_adf2
}
}
}
var 1336, name act_adf2
var 1338, name id2_adf2,link IOCARD_DISPLAY, digit 96, numbers 5, device 40
{
if &id2_adf2 > 0
{
&xp_adf2 = &id2_adf2
}
}
var 1340, name io_pt_adf2, link IOCARD_OUT, output 77, device 40
Var 1342, name o_adf2
var 1354, name xp_adf2
{
l0 = div &xp_adf2 10000
l1 = l0 * 10000
l2 = &xp_adf2 - l1
l2 = div l2 10
&fadf2A = tobcd l2
l0 = l0 * 100
l1 = div &xp_adf2 10
l1 = l1 * 10
l2 = &xp_adf2 - l1
l2 = l2 + l0
&fadf2B = tobcd l2
}
var 1356, name ant_adf2, link IOCARD_SW, input 94, device 40
{
if &ant_adf2 = 1
{
&danta_adf2 = 0
&dants_adf2 = 0
&dadfa_adf2 = 1
&dadfs_adf2 = 1
}
else
{
&danta_adf2 = 1
&dants_adf2 = 1
&dadfa_adf2 = 0
&dadfs_adf2 = 0
}
}
var 1358, name danta_adf2, link IOCARD_DISPLAY, digit 107, numbers 1, device 40
var 1360, name dants_adf2, link IOCARD_DISPLAY, digit 108, numbers 1, device 40
var 1362, name dadfa_adf2, link IOCARD_DISPLAY, digit 106, numbers 1, device 40
var 1364, name dadfs_adf2, link IOCARD_DISPLAY, digit 109, numbers 1, device 40
Var 1366, name S_ADF2TONE, Link IOCARD_SW, Input 96, device 40
{
&toneadf2 = CHANGEBITN 0 &S_ADF2TONE
}
// *********************************************
// ******************* ATC ********************
// *********************************************
Var 1400, name DIG_POS_STATUS
{
&finatc = 0
IF &DIG_POS_STATUS = 5
{
&timerup = 0
CALL &DIGITS2_SUB
}
else
{
&timerup = 1
CALL &DIGITS2_SUB
}
}
Var 1402, name DIG_1_SUB, Value 0
{
CALL &DIGITS_SUB
}
Var 1404, name DIG_2_SUB, Value 0
{
CALL &DIGITS_SUB
}
Var 1406, name DIG_3_SUB, Value 2
{
CALL &DIGITS_SUB
}
Var 1408, name DIG_4_SUB, Value 1
{
CALL &DIGITS_SUB
}
Var 1410, name D_ACTIVE, Link IOCARD_DISPLAY, Device 40, Digit 90, Numbers 4
Var 1412, name D_FAIL, Link IOCARD_DISPLAY, Device 40, Digit 94, Numbers 1
Var 1416, name DIS_ATC, Link IOCARD_OUT, Device 40, Output 99
Var 1418, name DIS_1, Link IOCARD_OUT, Device 40, Output 100
Var 1420, name DIS_2, Link IOCARD_OUT, Device 40, Output 101
Var 1422, name LED_FAIL, Link IOCARD_OUT, Device 40, Output 98
Var 1424, name E_LEFT, Link IOCARD_ENCODER, Device 40, Input 113, Aceleration 0, Type 2
{
L0 = &E_LEFT * 1
&DIG_POS_STATUS = ROTATE 1 ,5 ,L0
}
Var 1426, name E_RIGHT, Link IOCARD_ENCODER, Device 40, Input 115, Aceleration 1, Type 2
{
IF &DIG_POS_STATUS = 1
{
L0 = &E_RIGHT * -1
&DIG_1_SUB = ROTATE 0 ,7 ,L0
}
IF &DIG_POS_STATUS = 2
{
L0 = &E_RIGHT * -1
&DIG_2_SUB = ROTATE 0 ,7 ,L0
}
IF &DIG_POS_STATUS = 3
{
L0 = &E_RIGHT * -1
&DIG_3_SUB = ROTATE 0 ,7 ,L0
}
IF &DIG_POS_STATUS = 4
{
L0 = &E_RIGHT * -1
&DIG_4_SUB = ROTATE 0 ,7 ,L0
}
}
Var 1428, name I_IDENT, Link IOCARD_SW, Device 40, Input 78
{
IF &I_IDENT = 1
{
&IVAP_SB_IDENT = 1
}
}
Var 1430, name I_XPNDR, Link IOCARD_SW, Device 40, Input 79
{
IF &STANDBY = 0
{
CALL &check_xp
}
}
var 1431, name check_xp, link subrutine
{
IF &I_XPNDR = 1
{
&DIS_1 = 0
&DIS_2 = 1
}
ELSE
{
&DIS_1 = 1
&DIS_2 = 0
}
}
Var 1432, name STANDBY, Link IOCARD_SW, Device 40, Input 139
{
IF &STANDBY = 1
{
&IVAP_SB_MODE = 1
&DIS_1 = 0
&DIS_2 = 0
}
ELSE
{
CALL &check_xp
}
}
Var 1434, name I_R_ALT, Link IOCARD_SW, Device 40, Input 140
Var 1436, name I_R_XPN, Link IOCARD_SW, Device 40, Input 141
{
IF &I_R_XPN = 1
{
&IVAP_SB_MODE = 0
}
}
Var 1438, name I_R_TAO, Link IOCARD_SW, Device 40, Input 142
{
IF &I_R_TAO = 1
{
&TCAS_MAGENTA = 51
}
}
Var 1440, name I_R_TAR, Link IOCARD_SW, Device 40, Input 143
{
IF &I_R_TAR = 1
{
&TCAS_MAGENTA = 51
}
}
Var 1442, name DIGITS_SUB, Link SUBRUTINE
{
L0 = &DIG_4_SUB * 1000
L1 = &DIG_3_SUB * 100
L0 = L0 + L1
L1 = &DIG_2_SUB * 10
L0 = L0 + L1
L0 = L0 + &DIG_1_SUB
&D_ACTIVE = L0
&FS_XPDER_ID = TOBCD &D_ACTIVE
}
// ****************** TIMER ****************
// *****************************************
var 1444, name timeratc, link subrutine
{
if &timerup = 0
{
&lastst = 0
}
else
{
IF &DIG_POS_STATUS = 1
{
IF &lastst = 0
{
&D_ATC1 = -999999
}
ELSE
{
&D_ATC1 = &DIG_1_SUB
}
}
IF &DIG_POS_STATUS = 2
{
IF &lastst = 0
{
&D_ATC2 = -999999
}
ELSE
{
&D_ATC2 = &DIG_2_SUB
}
}
IF &DIG_POS_STATUS = 3
{
IF &lastst = 0
{
&D_ATC3 = -999999
}
ELSE
{
&D_ATC3 = &DIG_3_SUB
}
}
IF &DIG_POS_STATUS = 4
{
IF &lastst = 0
{
&D_ATC4 = -999999
}
ELSE
{
&D_ATC4 = &DIG_4_SUB
}
}
IF &lastst = 0
{
&lastst = 1
}
ELSE
{
&lastst = 0
}
IF &finatc = 50
{
&DIG_POS_STATUS = 5
}
ELSE
{
&finatc = &finatc + 1
}
}
// DOOR
IF &lockcount > 0
{
&lockcount = &lockcount - 1
&STBAUTOL = CHANGEBITN 0 &STBAUTOL
}
ELSE
{
&STBAUTOL = 0
}
// CARGO
IF &contacargo > 0
{
&contacargo = &contacargo + 1
IF &contacargo > 5
{
&contacargo = 0
&FCAFTL = 1
&FCFWDL = 1
}
}
// AILTRIM
IF &S_RDAILUL = 1
{
IF &S_RDAILDL = 1
{
&ailt_o = LIMIT -16000, 16000, -500
}
}
IF &S_RDAILUR = 1
{
IF &S_RDAILDR = 1
{
&ailt_o = LIMIT -16000, 16000, 500
}
}
}
var 1446, name lastst
var 1448, name timerup
Var 1450, name D_ATC1, Link IOCARD_DISPLAY, Device 40, Digit 90, Numbers 1
Var 1452, name D_ATC2, Link IOCARD_DISPLAY, Device 40, Digit 91, Numbers 1
Var 1454, name D_ATC3, Link IOCARD_DISPLAY, Device 40, Digit 92, Numbers 1
Var 1456, name D_ATC4, Link IOCARD_DISPLAY, Device 40, Digit 93, Numbers 1
var 1458, name DIGITS2_SUB, link subrutine
{
&D_ATC1 = &DIG_1_SUB
&D_ATC2 = &DIG_2_SUB
&D_ATC3 = &DIG_3_SUB
&D_ATC4 = &DIG_4_SUB
}
var 1460, name finatc, value 0
// *************************************************
// ******************* AUDIO 1 ********************
// *************************************************
Var 1500, name S_AU1VH1MI, Link IOCARD_SW, DEVICE 40, Input 27 // AUDIO1 VHF1 MIC SWITCH
{
if &S_AU1VH1MI = 1
{
&audio_o = SETBIT 7
&audio_o = CLEARBIT 6
}
}
Var 1502, name S_AU1VH2MI, Link IOCARD_SW, DEVICE 40, Input 28 // AUDIO1 VHF2 MIC SWITCH
{
if &S_AU1VH2MI = 1
{
&audio_o = CLEARBIT 7
&audio_o = SETBIT 6
}
}
Var 1504, name AU1VH1MI, Link IOCARD_OUT, DEVICE 40, Output 14 // AUDIO1 VHF1 MIC LED
Var 1506, name AU1VH2MI, Link IOCARD_OUT, DEVICE 40, Output 15 // AUDIO1 VHF2 MIC LED
Var 1508, name S_AU1VH1VO, Link IOCARD_SW, DEVICE 40, Input 29 // AUDIO1 VHF1 VOL SWITCH
{
if &S_AU1VH1VO = 1
{
l0 = TESTBIT &audio_i,5
&audio_o = CHANGEBITN 5,l0
}
}
Var 1510, name S_AU1VH2VO, Link IOCARD_SW, DEVICE 40, Input 30 // AUDIO1 VHF2 VOL SWITCH
{
if &S_AU1VH2VO = 1
{
l0 = TESTBIT &audio_i,5
&audio_o = CHANGEBITN 5,l0
}
}
Var 1512, name AU1VH1VO, Link IOCARD_OUT, DEVICE 40, Output 16 // AUDIO1 VHF1 VOL LED
Var 1514, name AU1VH2VO, Link IOCARD_OUT, DEVICE 40, Output 17 // AUDIO1 VHF2 VOL LED
Var 1516, name S_AU1NA1VO, Link IOCARD_SW, DEVICE 40, Input 31 // AUDIO1 NAV1 VOL SWITCH
{
if &S_AU1NA1VO = 1
{
l0 = TESTBIT &audio_i,4
&audio_o = CHANGEBITN 4,l0
}
}
Var 1518, name S_AU1NA2VO, Link IOCARD_SW, DEVICE 40, Input 32 // AUDIO1 NAV2 VOL SWITCH
{
if &S_AU1NA2VO = 1
{
l0 = TESTBIT &audio_i,3
&audio_o = CHANGEBITN 3,l0
}
}
Var 1520, name S_AU1AD1VO, Link IOCARD_SW, DEVICE 40, Input 33 // AUDIO1 ADF1 VOL SWITCH
{
if &S_AU1AD1VO = 1
{
l0 = TESTBIT &audio_i,0
&audio_o = CHANGEBITN 0,l0
}
}
Var 1522, name S_AU1AD2VO, Link IOCARD_SW, DEVICE 40, Input 34 // AUDIO1 ADF2 VOL SWITCH
Var 1524, name S_AU1MKRVO, Link IOCARD_SW, DEVICE 40, Input 35 // AUDIO1 MARKER VOL SWITCH
{
if &S_AU1MKRVO = 1
{
l0 = TESTBIT &audio_i,2
&audio_o = CHANGEBITN 2,l0
}
}
Var 1526, name AU1NA1VO, Link IOCARD_OUT, DEVICE 40, Output 18 // AUDIO1 NAV1 VOL LED
Var 1528, name AU1NA2VO, Link IOCARD_OUT, DEVICE 40, Output 19 // AUDIO1 NAV2 VOL LED
Var 1530, name AU1AD1VO, Link IOCARD_OUT, DEVICE 40, Output 20 // AUDIO1 ADF1 VOL LED
Var 1532, name AU1AD2VO, Link IOCARD_OUT, DEVICE 40, Output 21 // AUDIO1 ADF2 VOL LED
Var 1534, name AU1MKRVO, Link IOCARD_OUT, DEVICE 40, Output 22 // AUDIO1 MARKER VOL LED
// *************************************************
// ******************* AUDIO 2 ********************
// *************************************************
Var 1600, name S_AU2VH1MI, Link IOCARD_SW, DEVICE 40, Input 99 // AUDIO1 VHF1 MIC SWITCH
{
if &S_AU2VH1MI = 1
{
&audio_o = SETBIT 7
&audio_o = CLEARBIT 6
}
}
Var 1602, name S_AU2VH2MI, Link IOCARD_SW, DEVICE 40, Input 100 // AUDIO1 VHF2 MIC SWITCH
{
if &S_AU2VH2MI = 1
{
&audio_o = CLEARBIT 7
&audio_o = SETBIT 6
}
}
Var 1604, name AU2VH1MI, Link IOCARD_OUT, DEVICE 40, Output 78 // AUDIO1 VHF1 MIC LED
Var 1606, name AU2VH2MI, Link IOCARD_OUT, DEVICE 40, Output 79 // AUDIO1 VHF2 MIC LED
Var 1608, name S_AU2VH1VO, Link IOCARD_SW, DEVICE 40, Input 101 // AUDIO1 VHF1 VOL SWITCH
{
if &S_AU2VH1VO = 1
{
l0 = TESTBIT &audio_i,5
&audio_o = CHANGEBITN 5,l0
}
}
Var 1610, name S_AU2VH2VO, Link IOCARD_SW, DEVICE 40, Input 102 // AUDIO1 VHF2 VOL SWITCH
{
if &S_AU2VH2VO = 1
{
l0 = TESTBIT &audio_i,5
&audio_o = CHANGEBITN 5,l0
}
}
Var 1612, name AU2VH1VO, Link IOCARD_OUT, DEVICE 40, Output 80 // AUDIO1 VHF1 VOL LED
Var 1614, name AU2VH2VO, Link IOCARD_OUT, DEVICE 40, Output 81 // AUDIO1 VHF2 VOL LED
Var 1616, name S_AU2NA1VO, Link IOCARD_SW, DEVICE 40, Input 103 // AUDIO1 NAV1 VOL SWITCH
{
if &S_AU2NA1VO = 1
{
l0 = TESTBIT &audio_i,4
&audio_o = CHANGEBITN 4,l0
}
}
Var 1618, name S_AU2NA2VO, Link IOCARD_SW, DEVICE 40, Input 104 // AUDIO1 NAV2 VOL SWITCH
{
if &S_AU2NA2VO = 1
{
l0 = TESTBIT &audio_i,3
&audio_o = CHANGEBITN 3,l0
}
}
Var 1620, name S_AU2AD1VO, Link IOCARD_SW, DEVICE 40, Input 105 // AUDIO1 ADF1 VOL SWITCH
{
if &S_AU2AD1VO = 1
{
l0 = TESTBIT &audio_i,0
&audio_o = CHANGEBITN 0,l0
}
}
Var 1622, name S_AU2AD2VO, Link IOCARD_SW, DEVICE 40, Input 106 // AUDIO1 ADF2 VOL SWITCH
Var 1624, name S_AU2MKRVO, Link IOCARD_SW, DEVICE 40, Input 107 // AUDIO1 MARKER VOL SWITCH
{
if &S_AU2MKRVO = 1
{
l0 = TESTBIT &audio_i,2
&audio_o = CHANGEBITN 2,l0
}
}
Var 1626, name AU2NA1VO, Link IOCARD_OUT, DEVICE 40, Output 82 // AUDIO1 NAV1 VOL LED
Var 1628, name AU2NA2VO, Link IOCARD_OUT, DEVICE 40, Output 83 // AUDIO1 NAV2 VOL LED
Var 1630, name AU2AD1VO, Link IOCARD_OUT, DEVICE 40, Output 84 // AUDIO1 ADF1 VOL LED
Var 1632, name AU2AD2VO, Link IOCARD_OUT, DEVICE 40, Output 85 // AUDIO1 ADF2 VOL LED
Var 1634, name AU2MKRVO, Link IOCARD_OUT, DEVICE 40, Output 86 // AUDIO1 MARKER VOL LED
// *************************************************
// ******************* STAB TRIM ******************
// *************************************************
Var 1650, name S_STBOVRD, Link IOCARD_SW, DEVICE 40, Input 135 // STAB TRIM OVERRIDE-NORM SWITCH
{
IF &S_STBOVRD = 1
{
&stabtrim_o = SETBIT 13
}
else
{
&stabtrim_o = CLEARBIT 13
}
}
Var 1652, name R_STBDAUTO, Link IOCARD_SW, DEVICE 40, Input 137 // STAB TRIM DOOR AUTO ROTARY SWITCH
{
IF &R_STBDAUTO = 1
{
&lockcount = 15
}
}
var 1654, name lockcount, value 0
Var 1656, name STBAUTOL, Link IOCARD_OUT, DEVICE 40, Output 97 // STAB TRIM AUTO-UNLOCK INDICATOR
Var 1658, name R_STBDUNLK, Link IOCARD_SW, DEVICE 40, Input 136 // STAB TRIM DOOR UNLOCK ROTARY SWITCH
{
IF &R_STBDUNLK = 1
{
&lockcount = 0
}
}
Var 1660, name R_STBDDENY, Link IOCARD_SW, DEVICE 40, Input 138 // STAB TRIM DOOR DENY ROTARY SWITCH
{
IF &R_STBDDENY = 1
{
&lockcount = 0
}
}
// ************************************************
// ******************* CARGO ********************
// ************************************************
Var 700, name S_FTEST, Link IOCARD_SW, DEVICE 40, Input 117 // FIRE CARGO TEST SWITCH
{
IF &S_FTEST = 1
{
IF &testrun = 0
{
&testrun = 1
&FCDISCL = 1
&FCDISCBARL = 1
&FCEXTFWDL = 1
&FCEXTAFTL = 1
&contacargo = 1
}
else
{
&contacargo = 0
&testrun = 0
&FCDISCL = 0
&FCDISCBARL = 0
&FCEXTFWDL = 0
&FCEXTAFTL = 0
&FCAFTL = 0
&FCFWDL = 0
}
}
}
var 702, name testrun, value 0
var 704, name contacargo, value 0
Var 776, name FCDISCL, Link IOCARD_OUT, DEVICE 40, Output 87 // FIRE CARGO DISCHARGE KORRY
Var 778, name FCDISCBARL, Link IOCARD_OUT, DEVICE 40, Output 88 // FIRE CARGO DISCHARGE BAR KORRY
Var 780, name FCAFTL, Link IOCARD_OUT, DEVICE 40, Output 89 // FIRE CARGO AFT KORRY
Var 784, name FCFWDL, Link IOCARD_OUT, DEVICE 40, Output 91 // FIRE CARGO FWD KORRY
Var 790, name FCEXTFWDL, Link IOCARD_OUT, DEVICE 40, Output 94 // FIRE CARGO EXT FWD
Var 792, name FCEXTAFTL, Link IOCARD_OUT, DEVICE 40, Output 95 // FIRE CARGO EXT AFT
// ************************************************
// ******************* FIRE ENGINES *************
// ************************************************
Var 804, name S_FETSTOVH, Link IOCARD_SW, DEVICE 40, Input 47 // FIRE ENGINES TEST OVH-FIRE SWITCH
{
IF &S_FETSTOVH = 1
{
&ENG1_OVHL = 1
&ENG2_OVHL = 1
&FIREWHELLL = 1
&FIRE1L = 1
&FIREAL = 1
&FIRE2L = 1
}
else
{
&ENG1_OVHL = 0
&ENG2_OVHL = 0
&FIREWHELLL = 0
&FIRE1L = 0
&FIREAL = 0
&FIRE2L = 0
}
}
Var 806, name S_FETSTFAULT, Link IOCARD_SW, DEVICE 40, Input 48 // FIRE ENGINES TEST FAULT-INOP SWITCH
{
IF &S_FETSTFAULT = 1
{
&APUDETINOPL = 1
&FIREFAULTL = 1
}
else
{
&APUDETINOPL = 0
&FIREFAULTL = 0
}
}
Var 814, name S_EXT1TEST, Link IOCARD_SW, DEVICE 40, Input 53 // FIRE ENGINE EXTINGUISHER 1 TEST SWITCH
{
IF &S_EXT1TEST = 1
{
&FIREG1L = 1
&FIREGAL = 1
&FIREG2L = 1
}
ELSE
{
IF &S_EXT2TEST = 0
{
&FIREG1L = 0
&FIREGAL = 0
&FIREG2L = 0
}
}
}
Var 816, name S_EXT2TEST, Link IOCARD_SW, DEVICE 40, Input 52 // FIRE ENGINE EXTINGUISHER 2 TEST SWITCH
{
IF &S_EXT2TEST = 1
{
&FIREG1L = 1
&FIREGAL = 1
&FIREG2L = 1
}
ELSE
{
IF &S_EXT1TEST = 0
{
&FIREG1L = 0
&FIREGAL = 0
&FIREG2L = 0
}
}
}
Var 848, name ENG1_OVHL, Link IOCARD_OUT, DEVICE 40, Output 23 // ENGINE 1 OVERHEAT
Var 852, name APUDETINOPL, Link IOCARD_OUT, DEVICE 40, Output 25 // APU DET INOPERATIVE
Var 854, name FIREFAULTL, Link IOCARD_OUT, DEVICE 40, Output 26 // FIRE ENGINES FAULT
Var 856, name FIREWHELLL, Link IOCARD_OUT, DEVICE 40, Output 27 // FIRE WHELL WELL
Var 858, name ENG2_OVHL, Link IOCARD_OUT, DEVICE 40, Output 28 // ENGINE 2 OVERHEAT
Var 862, name RBOTDISL, Link IOCARD_OUT, DEVICE 40, Output 30 // ENGINE 2 BOTTLE DISCHARGE
Var 864, name FIRE1L, Link IOCARD_OUT, DEVICE 40, Output 31 // ENGINE 1 FIRE HANDLE LIGHT
Var 866, name FIREAL, Link IOCARD_OUT, DEVICE 40, Output 32 // APU FIRE HANDLE LIGHT
Var 868, name FIRE2L, Link IOCARD_OUT, DEVICE 40, Output 33 // ENGINE 2 FIRE HANDLE LIGHT
Var 870, name FIREG1L, Link IOCARD_OUT, DEVICE 40, Output 34 // FIRE ENGINE 1 GREEN LED
Var 872, name FIREGAL, Link IOCARD_OUT, DEVICE 40, Output 35 // FIRE APU GREEN LED
Var 874, name FIREG2L, Link IOCARD_OUT, DEVICE 40, Output 36 // FIRE ENGINE 2 GREEN LED
// ************************************************
// ******************* RADAR ********************
// ************************************************
Var 900, name R_RADTST, Link IOCARD_SW, DEVICE 40, Input 69 // RADAR WX-TEST ROTARY SWITCH
{
IF &R_RADTST = 1
{
&radar_pm = 381
}
}
Var 902, name R_RADMAP, Link IOCARD_SW, DEVICE 40, Input 71 // RADAR WX-TURB-MAP ROTARY SWITCH
{
IF &R_RADMAP = 1
{
&radar_pm = 380
}
}
// ******************************************************
// ******************* RUDDER TRIM ********************
// ******************************************************
Var 964, name S_RDAILUL, Link IOCARD_SW, DEVICE 40, Input 63 // RUDDER TRIM AILERON UP LEFT SWITCH
Var 966, name S_RDAILUR, Link IOCARD_SW, DEVICE 40, Input 64 // RUDDER TRIM AILERON UP RIGHT SWITCH
Var 968, name S_RDAILDL, Link IOCARD_SW, DEVICE 40, Input 65 // RUDDER TRIM AILERON DOWN LEFT SWITCH
Var 970, name S_RDAILDR, Link IOCARD_SW, DEVICE 40, Input 66 // RUDDER TRIM AILERON DOWN RIGHT SWITCH
Var 978, name E_RUDDER, Link IOCARD_ENCODER, DEVICE 40, Input 67, Aceleration 1, Type 2 // RUDDER TRIM ENCODER
{
l0 = &E_RUDDER * -500
&ruddert_o = LIMIT -16000, 16000, l0
}
Var 980, name grudtrim, link USB_SERVOS, DEVICE 41, Output 1, PosL 0, PosC 511, PosR 1023 // RUDDER TRIM INDICATOR
Var 982, name leftservo, value 470 // ***** Change de value for your left extreme value for 15 in the indicator ****
var 984, name centerservo, value 350 // ***** change de value for your center value in the indicator ****
Var 986, name rightservo, value 230 // ***** Change de value for your right extreme value for 15 in the indicator ****
var 988, name runindicator, link subrutine
{
if &ruddert_o = 0
{
l0 = ¢erservo
}
else
{
if &ruddert_o < 0 // LEFT
{
l0 = ¢erservo - &leftservo
}
else // RIGHT
{
l0 = &rightservo - ¢erservo
}
l0 = l0 * &ruddert_o
l0 = l0 / 16384
l0 = l0 + ¢erservo
}
&grudtrim = l0
}
// ********* OFFSETS ****
Var 5250, Link FSUIPC_OUT, name fcom1, Offset $034E, Length 2 // COM1 Active
Var 5252, Link FSUIPC_OUT, name fcom2, Offset $3118, Length 2 // COM2 Active
Var 5254, Link FSUIPC_OUT, name fnav1, Offset $0350, Length 2 // NAV1 Active
Var 5256, Link FSUIPC_OUT, name fnav2, Offset $0352, Length 2 // NAV2 Active
Var 5258, Link FSUIPC_OUT, name fadf1A, Offset $034c, Length 2 // adf1 Active part1
Var 5260, Link FSUIPC_OUT, name fadf1B, Offset $0356, Length 2 // ADF1 Active part2
Var 5262, Link FSUIPC_OUT, name fadf2A, Offset $02D4, Length 2 // ADF2 Active part1
Var 5264, Link FSUIPC_OUT, name fadf2B, Offset $02D6, Length 2 // ADF2 Active part2
Var 5266, Link FSUIPC_OUT, name toneadf1, Offset $3107, Length 2 // ADF1 TONE
Var 5268, Link FSUIPC_OUT, name toneadf2, Offset $02FB, Length 2 // ADF2 TONE
Var 5270, name FS_XPDER_ID, Link FSUIPC_INOUT, Offset $0354, Length 2
Var 5272, name IVAP_SB_MODE, Link FSUIPC_INOUT, Offset $7B91, Length 1
Var 5274, name IVAP_SB_IDENT, Link FSUIPC_INOUT, Offset $7B93, Length 1
Var 5276, name XPDER_FAIL, Link FSUIPC_INOUT, Offset $0B6F, Length 1
{
IF &XPDER_FAIL = 1
{
&D_FAIL = -999997
&LED_FAIL = 1
}
ELSE
{
&D_FAIL = -999999
&LED_FAIL = 0
}
}
Var 5278, name TCAS_MAGENTA, Link FSUIPC_INOUT, Offset $04F4, Length 2
Var 5280, name audio_o, Link FSUIPC_INOUT, Offset $3122, Length 1 // Radio Audio Bits
Var 5282, name audio_i, Link FSUIPC_IN, Offset $3122, Length 1 // Radio Audio Bits
{
&AU1VH1MI = TESTBIT &audio_i,7
&AU1VH2MI = TESTBIT &audio_i,6
&AU1VH1VO = TESTBIT &audio_i,5
&AU1VH2VO = TESTBIT &audio_i,5
&AU1NA1VO = TESTBIT &audio_i,4
&AU1NA2VO = TESTBIT &audio_i,3
&AU1AD1VO = TESTBIT &audio_i,0
&AU1MKRVO = TESTBIT &audio_i,2
&AU2VH1MI = TESTBIT &audio_i,7
&AU2VH2MI = TESTBIT &audio_i,6
&AU2VH1VO = TESTBIT &audio_i,5
&AU2VH2VO = TESTBIT &audio_i,5
&AU2NA1VO = TESTBIT &audio_i,4
&AU2NA2VO = TESTBIT &audio_i,3
&AU2AD1VO = TESTBIT &audio_i,0
&AU2MKRVO = TESTBIT &audio_i,2
}
Var 5284, name stabtrim_o, Link FSUIPC_INOUT, Offset $050a, Length 2 // stab trim override
Var 5286, name radar_pm, link FSUIPC_INOUT, offset $04f4, length 2 // PMagenta Commands
Var 5288, name ruddert_o, link FSUIPC_INOUT, offset $0c04, length 2, type 1 // Rudder trim
{
CALL &runindicator
}
Var 5290, name ailt_o, link FSUIPC_INOUT, offset $0c02, length 2, type 1 // Ailerons trim