Results 1 to 3 of 3
  1. #1
    150+ Forum Groupie flatlandpilot's Avatar
    Join Date
    May 2009
    Location
    Netherlands, Zwolle
    Posts
    150
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    OC MCP on X-Plane

    Hi there,

    I looks like I can't find working script on the net to get my OC MCP
    working with X-Plane

    Yesterday night I got the 7-segment displays working (a bit)
    and hope to get the switches in sync with the simulator soon.

    my first steps of the MCP Sioc script:

    // *****************************************************************************
    // * Config_SIOC ver 3.7B1 - By Manolo V閘ez - www.opencockpits.com
    // *****************************************************************************
    // * FileName : MCP.txt
    // * Edited by M.Heeroma

    Var 0000, Value 0
    {
    &D_COURSE = 100
    }
    Var 0001, name digitos, Link IOCARD_DISPLAY, Digit 21, Numbers 1
    Var 0030, name D_COURSE, Link IOCARD_DISPLAY, Digit 0, Numbers 3
    Var 0031, name D_Heading, Link IOCARD_DISPLAY, Digit 6, Numbers 3
    Var 0032, name D_IAS Link IOCARD_DISPLAY, Digit 3, Numbers 3
    Var 0033, name D_Atitude Link IOCARD_DISPLAY, Digit 9, Numbers 5
    Var 0034, name D_VertSpeed Link IOCARD_DISPLAY, Digit 14, Numbers 5
    Var 0035, name D_COURSE2 Link IOCARD_DISPLAY, Digit 19, Numbers 3

    // OUTPUTS
    Var 200, name DECIMAL, Link IOCARD_OUT, Output 20
    Var 202, name O_N1, Link IOCARD_OUT, Output 21
    Var 204, name O_AT, Link IOCARD_OUT, Output 22
    Var 206, name O_SPEED, Link IOCARD_OUT, Output 23
    Var 208, name O_LVLCHG, Link IOCARD_OUT, Output 24
    Var 210, name O_VNAV, Link IOCARD_OUT, Output 25
    Var 212, name O_HDGSEL, Link IOCARD_OUT, Output 26
    Var 214, name O_APP, Link IOCARD_OUT, Output 27
    Var 216, name O_VORLOC, Link IOCARD_OUT, Output 28
    Var 218, name O_LNAV, Link IOCARD_OUT, Output 29
    Var 220, name O_ALTHLD, Link IOCARD_OUT, Output 30
    Var 222, name O_VS, Link IOCARD_OUT, Output 31
    Var 224, name O_CWSA, Link IOCARD_OUT, Output 32
    Var 226, name O_CMDA, Link IOCARD_OUT, Output 33
    Var 228, name O_CWSB, Link IOCARD_OUT, Output 34
    Var 230, name O_CMDB, Link IOCARD_OUT, Output 35

    // ROTARY ENCODERS
    Var 300, name E_IAS, Link IOCARD_ENCODER, Input 0, Aceleration 1, Type 2
    Var 302, name E_ALT, Link IOCARD_ENCODER, Input 2, Aceleration 1, Type 2
    Var 304, name E_COURSE1, Link IOCARD_ENCODER, Input 4, Aceleration 1, Type 2
    Var 306, name E_HDG, Link IOCARD_ENCODER, Input 6, Aceleration 1, Type 2
    Var 308, name E_COURSE2, Link IOCARD_ENCODER, Input 9, Aceleration 1, Type 2
    Var 310, name E_VS, Link IOCARD_ENCODER, Input 11, Aceleration 1, Type 2

    // SWITCHES
    Var 400, name I_CO, Link IOCARD_SW, Input 13
    Var 402, name I_FD2, Link IOCARD_SW, Input 14
    Var 404, name I_DISENGAGE, Link IOCARD_SW, Input 15
    Var 406, name I_FD1, Link IOCARD_SW, Input 16
    Var 408, name I_CWSB, Link IOCARD_SW, Input 18
    Var 410, name I_CMDB, Link IOCARD_SW, Input 19
    Var 412, name I_CWSA, Link IOCARD_SW, Input 20
    Var 414, name I_CMDA, Link IOCARD_SW, Input 21
    Var 416, name I_VS, Link IOCARD_SW, Input 22
    Var 418, name I_ALTHLD, Link IOCARD_SW, Input 23
    Var 420, name I_APP, Link IOCARD_SW, Input 24
    Var 422, name I_VORLOC, Link IOCARD_SW, Input 25
    Var 424, name I_LNAV, Link IOCARD_SW, Input 27
    Var 426, name I_HDGSEL, Link IOCARD_SW, Input 28
    Var 428, name I_LVLCHG, Link IOCARD_SW, Input 29
    Var 430, name I_VNAV, Link IOCARD_SW, Input 30
    Var 432, name I_SPEED, Link IOCARD_SW, Input 31
    Var 434, name I_N1, Link IOCARD_SW, Input 32
    Var 436, name I_AT, Link IOCARD_SW, Input 33

    // NAV1 CRS
    // *****************************************************************************
    Var 51 Link FSUIPC_INOUT Offset $0C4E Length 2 // NAV1 CRS in FSUIPC
    {
    v52 = v51 // new value from FSUIPC ?
    }

    Var 52 // internal NAV1 CRS
    {
    &D_COURSE = v52 // write to my 3-digit display
    }

    Var 53 Link IOCARD_ENCODER, Input 4, Aceleration 6, Type 2 // Course encoder
    {
    L0 = v53 * -1 // make sure turning right increments
    v52 = ROTATE 0 359 L0 // update NAV1 CRS
    v51 = v52 // write to FSUIPC
    }

    // IAS
    // *****************************************************************************
    Var 61 Link FSUIPC_INOUT Offset $02BC Length 4 // IAS in FSUIPC
    {
    v62 = v61 // new value from FSUIPC ?
    }

    Var 62 // internal IAS
    {
    &D_IAS = v62 // write to my 3-digit display
    }

    Var 63 Link IOCARD_ENCODER, Input 0, Aceleration 6, Type 2 // IAS encoder
    {
    L0 = v63 * -1 // make sure turning right increments
    v62 = ROTATE 0 359 L0 // update IAS
    v61 = v62 // write to FSUIPC
    }

    // Heading
    // *****************************************************************************
    Var 71 Link FSUIPC_INOUT Offset $07CC Length 2 // Heading in FSUIPC
    {
    v72 = v71 // new value from FSUIPC ?
    }

    Var 72 // internal Heading
    {
    &D_Heading = v72 // write to my 3-digit display
    }

    Var 73 Link IOCARD_ENCODER, Input 6, Aceleration 6, Type 2 // Heading encoder
    {
    L0 = v73 * -1 // make sure turning right increments
    v72 = ROTATE 0 359 L0 // update Heading
    v71 = v72 // write to FSUIPC
    }
    // Altitude
    // *****************************************************************************
    Var 81 Link FSUIPC_INOUT Offset $07D4 Length 4 // Altitude in FSUIPC
    {
    v82 = v81 / 19975.37 // new value from FSUIPC ?
    }

    Var 82 // internal Altitude
    {
    &D_Atitude = v82 // write to my 3-digit display
    }

    Var 83 Link IOCARD_ENCODER, Input 2, Aceleration 6, Type 2 // Altitude encoder
    {
    L0 = v83 * -1 // make sure turning right increments
    v82 = ROTATE 0 359 L0 // update Altitude
    v81 = v82 * 19975.37 // write to FSUIPC
    }
    // VertSpeed
    // *****************************************************************************
    Var 91 Link FSUIPC_INOUT Offset $07F2 Length 2 // VertSpeed in FSUIPC
    {
    v92 = v91 // new value from FSUIPC ?
    }

    Var 92 // internal VertSpeed
    {
    &D_VertSpeed = v92 // write to my 3-digit display
    }

    Var 93 Link IOCARD_ENCODER, Input 11, Aceleration 6, Type 2 // VertSpeed encoder
    {
    L0 = v93 * -100 // make sure turning right increments
    v92 = ROTATE -9000 9000 L0 // update VertSpeed
    IF v92 < 0 // Si temporal V/S es negativo
    {
    v91 = v92 + 65536 // pasa a binario negativo.
    }
    ELSE
    {
    v91 = v92 // Si no, deja igual pasando el valor al PM
    }
    //v91 = v92 // write to FSUIPC
    }
    // NAV2 CRS
    // *****************************************************************************
    Var 41 Link FSUIPC_INOUT Offset $0D4E Length 2 // NAV2 CRS in FSUIPC
    {
    v42 = v41 // new value from FSUIPC ?
    }

    Var 42 // internal NAV2 CRS
    {
    &D_COURSE2 = v42 // write to my 3-digit display
    }

    Var 43 Link IOCARD_ENCODER, Input 9, Aceleration 6, Type 2 // Course encoder
    {
    L0 = v43 * -1 // make sure turning right increments
    v42 = ROTATE 0 359 L0 // update NAV2 CRS
    v41 = v42 // write to FSUIPC
    }
    When once you have tasted flight,
    you will forever walk the earth with your eyes turned skyward

  2. #2
    150+ Forum Groupie flatlandpilot's Avatar
    Join Date
    May 2009
    Location
    Netherlands, Zwolle
    Posts
    150
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: OC MCP on X-Plane

    Almost workable version:

    // *****************************************************************************
    // * Config_SIOC ver 3.7B1 - By Manolo V閘ez - www.opencockpits.com
    // *****************************************************************************
    // * FileName : MCP_Define.txt
    // * Date : 7/6/2011

    Var 0000, Value 0
    {
    &D_COURSE = 100
    }
    Var 0001, name digitos, Link IOCARD_DISPLAY, Digit 21, Numbers 1
    Var 0030, name D_COURSE, Link IOCARD_DISPLAY, Digit 0, Numbers 3
    Var 0031, name D_Heading, Link IOCARD_DISPLAY, Digit 6, Numbers 3
    Var 0032, name D_IAS Link IOCARD_DISPLAY, Digit 3, Numbers 3
    Var 0033, name D_Atitude Link IOCARD_DISPLAY, Digit 9, Numbers 5
    Var 0034, name D_VertSpeed Link IOCARD_DISPLAY, Digit 14, Numbers 5
    Var 0035, name D_COURSE2 Link IOCARD_DISPLAY, Digit 19, Numbers 3

    // OUTPUTS
    Var 200, name DECIMAL, Link IOCARD_OUT, Output 20
    Var 202, name O_N1, Link IOCARD_OUT, Output 21
    Var 204, name O_AT, Link IOCARD_OUT, Output 22
    Var 206, name O_SPEED, Link IOCARD_OUT, Output 23
    Var 208, name O_LVLCHG, Link IOCARD_OUT, Output 24
    Var 210, name O_VNAV, Link IOCARD_OUT, Output 25
    Var 212, name O_HDGSEL, Link IOCARD_OUT, Output 26
    Var 214, name O_APP, Link IOCARD_OUT, Output 27
    Var 216, name O_VORLOC, Link IOCARD_OUT, Output 28
    Var 218, name O_LNAV, Link IOCARD_OUT, Output 29
    Var 220, name O_ALTHLD, Link IOCARD_OUT, Output 30
    Var 222, name O_VS, Link IOCARD_OUT, Output 31
    Var 224, name O_CWSA, Link IOCARD_OUT, Output 32
    Var 226, name O_CMDA, Link IOCARD_OUT, Output 33
    Var 228, name O_CWSB, Link IOCARD_OUT, Output 34
    Var 230, name O_CMDB, Link IOCARD_OUT, Output 35

    // ROTARY ENCODERS
    Var 300, name E_IAS, Link IOCARD_ENCODER, Input 0, Aceleration 1, Type 2
    Var 302, name E_ALT, Link IOCARD_ENCODER, Input 2, Aceleration 1, Type 2
    Var 304, name E_COURSE1, Link IOCARD_ENCODER, Input 4, Aceleration 1, Type 2
    Var 306, name E_HDG, Link IOCARD_ENCODER, Input 6, Aceleration 1, Type 2
    Var 308, name E_COURSE2, Link IOCARD_ENCODER, Input 9, Aceleration 1, Type 2
    Var 310, name E_VS, Link IOCARD_ENCODER, Input 11, Aceleration 1, Type 2

    // SWITCHES
    Var 400, name I_CO, Link IOCARD_SW, Input 13
    Var 402, name I_FD2, Link IOCARD_SW, Input 14
    Var 404, name I_DISENGAGE, Link IOCARD_SW, Input 15
    //Var 406, name I_FD1, Link IOCARD_SW, Input 16
    Var 408, name I_CWSB, Link IOCARD_SW, Input 18
    Var 410, name I_CMDB, Link IOCARD_SW, Input 19
    Var 412, name I_CWSA, Link IOCARD_SW, Input 20
    Var 414, name I_CMDA, Link IOCARD_SW, Input 21
    //Var 416, name I_VS, Link IOCARD_SW, Input 22
    //Var 418, name I_ALTHLD, Link IOCARD_SW, Input 23
    Var 420, name I_APP, Link IOCARD_SW, Input 24
    //Var 422, name I_VORLOC, Link IOCARD_SW, Input 25
    Var 424, name I_LNAV, Link IOCARD_SW, Input 27
    //Var 426, name I_HDGSEL, Link IOCARD_SW, Input 28
    Var 428, name I_LVLCHG, Link IOCARD_SW, Input 29
    Var 430, name I_VNAV, Link IOCARD_SW, Input 30
    Var 432, name I_SPEED, Link IOCARD_SW, Input 31
    Var 434, name I_N1, Link IOCARD_SW, Input 32
    //Var 436, name I_AT, Link IOCARD_SW, Input 33

    // NAV1 CRS
    // *****************************************************************************
    Var 51 Link FSUIPC_INOUT Offset $0C4E Length 2 // NAV1 CRS in FSUIPC
    {
    v52 = v51 // new value from FSUIPC ?
    }

    Var 52 // internal NAV1 CRS
    {
    &D_COURSE = v52 // write to my 3-digit display
    }

    Var 53 Link IOCARD_ENCODER, Input 4, Aceleration 6, Type 2 // Course encoder
    {
    L0 = v53 * -1 // make sure turning right increments
    v52 = ROTATE 0 359 L0 // update NAV1 CRS
    v51 = v52 // write to FSUIPC
    }

    // IAS
    // *****************************************************************************
    Var 61 Link FSUIPC_INOUT Offset $02BC Length 4 // IAS in FSUIPC

    {
    v62 = v61 // new value from FSUIPC ?
    }

    Var 62 // internal IAS
    {
    &D_IAS = v62 // write to my 3-digit display
    }

    Var 63 Link IOCARD_ENCODER, Input 0, Aceleration 6, Type 2 // IAS encoder
    {
    L0 = v63 * -1 // make sure turning right increments
    v62 = ROTATE 0 359 L0 // update IAS
    v61 = v62 // write to FSUIPC
    }

    // Heading
    // *****************************************************************************
    Var 71 Link FSUIPC_INOUT Offset $07CC Length 2 // Heading in FSUIPC
    {
    v72 = v71 / 182 // new value from FSUIPC ?
    }

    Var 72 // internal Heading
    {
    &D_Heading = v72 // write to my 3-digit display
    }

    Var 73 Link IOCARD_ENCODER, Input 6, Aceleration 6, Type 2 // Heading encoder
    {
    L0 = v73 * -1 // make sure turning right increments
    v72 = ROTATE 0 359 L0 // update Heading
    v71 = v72 * 182 // write to FSUIPC
    }
    // Altitude
    // *****************************************************************************
    Var 81 Link FSUIPC_INOUT Offset $07D4 Length 4 // Altitude in FSUIPC
    {
    v82 = v81 / 19975.37 // new value from FSUIPC ?
    }

    Var 82 // internal Altitude
    {
    &D_Atitude = v82 // write to my 3-digit display
    }

    Var 83 Link IOCARD_ENCODER, Input 2, Aceleration 6, Type 2 // Altitude encoder
    {
    L0 = v83 * -1 // make sure turning right increments
    v82 = ROTATE 0 359 L0 // update Altitude
    v81 = v82 * 19975.37 // write to FSUIPC
    }
    // VertSpeed
    // *****************************************************************************
    Var 91 Link FSUIPC_INOUT Offset $07F2 Length 2 // VertSpeed in FSUIPC
    {
    v92 = v91 // new value from FSUIPC ?
    }

    Var 92 // internal VertSpeed
    {
    &D_VertSpeed = v92 // write to my 3-digit display
    }

    Var 93 Link IOCARD_ENCODER, Input 11, Aceleration 6, Type 2 // VertSpeed encoder
    {
    L0 = v93 * -100 // make sure turning right increments
    v92 = ROTATE -9000 9000 L0 // update VertSpeed
    IF v92 < 0 // Si temporal V/S es negativo
    {
    v91 = v92 + 65536 // pasa a binario negativo.
    }
    ELSE
    {
    v91 = v92 // Si no, deja igual pasando el valor al PM
    }
    //v91 = v92 // write to FSUIPC
    }
    // NAV2 CRS
    // *****************************************************************************
    Var 41 Link FSUIPC_INOUT Offset $0D4E Length 2 // NAV2 CRS in FSUIPC
    {
    v42 = v41 // new value from FSUIPC ?
    }

    Var 42 // internal NAV2 CRS
    {
    &D_COURSE2 = v42 // write to my 3-digit display
    }

    Var 43 Link IOCARD_ENCODER, Input 9, Aceleration 6, Type 2 // Course encoder
    {
    L0 = v43 * -1 // make sure turning right increments
    v42 = ROTATE 0 359 L0 // update NAV2 CRS
    v41 = v42 // write to FSUIPC
    }
    // HDG SEL
    // *****************************************************************************
    Var 101 Link FSUIPC_INOUT Offset $07C8 Length 2 // HDG SEL in FSUIPC
    {
    v102 = v101 // new value from FSUIPC ?
    }

    Var 102 // internal HDG SEL
    {
    &O_HDGSEL = v102 // write to my led
    }
    Var 426, name I_HDGSEL, Link IOCARD_SW, Input 28
    {
    IF v426 = 1
    {
    IF v102 = 1
    {
    V101 = 0
    }
    ELSE
    {
    V101 = 1
    }
    }
    }
    // ALT HLD
    // *****************************************************************************
    Var 111 Link FSUIPC_INOUT Offset $07D0 Length 4 // ALT HLD in FSUIPC
    {
    v112 = v111 // new value from FSUIPC ?
    }

    Var 112 // internal ALT HLD
    {
    &O_ALTHLD = v112 // write to my led
    }
    Var 418, name I_ALTHLD, Link IOCARD_SW, Input 23
    {
    IF v418 = 1
    {
    IF v112 = 1
    {
    V111 = 0
    }
    ELSE
    {
    V111 = 1
    }
    }
    }
    // vs HLD
    // *****************************************************************************
    Var 121 Link FSUIPC_INOUT Offset $07EC Length 4 // vs HLD in FSUIPC
    {
    v122 = v121 // new value from FSUIPC ?
    }

    Var 122 // internal vs HLD
    {
    &O_VS = v122 // write to my led
    }
    Var 416, name I_VS, Link IOCARD_SW, Input 22
    {
    IF v416 = 1
    {
    IF v122 = 1
    {
    V121 = 0
    &D_VertSpeed = -999999
    }
    ELSE
    {
    V121 = 1
    }
    }
    }
    // AT ARM
    // *****************************************************************************
    Var 131 Link FSUIPC_INOUT Offset $810 Length 4 // AT ARM in FSUIPC
    {
    v132 = v131 // new value from FSUIPC ?
    }

    Var 132 // internal AT ARM
    {
    &O_AT = v132 // write to my led
    }
    Var 436, name I_AT, Link IOCARD_SW, Input 33
    {
    V131 = v436
    }
    // VOR LOC
    // *****************************************************************************
    Var 141 Link FSUIPC_INOUT Offset $07C4 Length 4 // VOR LOC in FSUIPC
    {
    v142 = v141 // new value from FSUIPC ?
    }

    Var 142 // internal VOR LOC
    {
    &O_VORLOC = v142 // write to my led
    }
    Var 422, name I_VORLOC, Link IOCARD_SW, Input 25
    {
    IF v422 = 1
    {
    IF v142 = 1
    {
    V141 = 0
    }
    ELSE
    {
    V141 = 1
    }
    }
    }
    // FD1
    // *****************************************************************************
    Var 151 Link FSUIPC_INOUT Offset $07Cc Length 4 // FD1 in FSUIPC
    {
    v152 = v151 // new value from FSUIPC ?
    }

    Var 152 // internal FD1
    {
    //&O_AT = v152 // write to my led
    }
    Var 406, name I_FD1, Link IOCARD_SW, Input 16
    {
    V151 = v406
    }
    When once you have tasted flight,
    you will forever walk the earth with your eyes turned skyward

  3. #3
    150+ Forum Groupie flatlandpilot's Avatar
    Join Date
    May 2009
    Location
    Netherlands, Zwolle
    Posts
    150
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: OC MCP on X-Plane

    Flyable version, I close the text-editor and go flying.


    // *****************************************************************************
    // * Config_SIOC ver 3.7B1 - By Manolo V閘ez - www.opencockpits.com
    // *****************************************************************************
    // * FileName : MCP_Define.txt
    // * Date : 7/6/2011

    Var 0000, Value 0
    {
    }

    Var 0001, name digitos, Link IOCARD_DISPLAY, Digit 21, Numbers 1
    Var 0030, name D_COURSE, Link IOCARD_DISPLAY, Digit 0, Numbers 3
    Var 0031, name D_Heading, Link IOCARD_DISPLAY, Digit 6, Numbers 3
    Var 0032, name D_IAS Link IOCARD_DISPLAY, Digit 3, Numbers 3
    Var 0033, name D_Atitude Link IOCARD_DISPLAY, Digit 9, Numbers 5
    Var 0034, name D_VertSpeed Link IOCARD_DISPLAY, Digit 14, Numbers 5
    Var 0035, name D_COURSE2 Link IOCARD_DISPLAY, Digit 19, Numbers 3

    // OUTPUTS
    Var 200, name DECIMAL, Link IOCARD_OUT, Output 20
    Var 202, name O_N1, Link IOCARD_OUT, Output 21
    Var 204, name O_AT, Link IOCARD_OUT, Output 22
    Var 206, name O_SPEED, Link IOCARD_OUT, Output 23
    Var 208, name O_LVLCHG, Link IOCARD_OUT, Output 24
    Var 210, name O_VNAV, Link IOCARD_OUT, Output 25
    Var 212, name O_HDGSEL, Link IOCARD_OUT, Output 26
    Var 214, name O_APP, Link IOCARD_OUT, Output 27
    Var 216, name O_VORLOC, Link IOCARD_OUT, Output 28
    Var 218, name O_LNAV, Link IOCARD_OUT, Output 29
    Var 220, name O_ALTHLD, Link IOCARD_OUT, Output 30
    Var 222, name O_VS, Link IOCARD_OUT, Output 31
    Var 224, name O_CWSA, Link IOCARD_OUT, Output 32
    Var 226, name O_CMDA, Link IOCARD_OUT, Output 33
    Var 228, name O_CWSB, Link IOCARD_OUT, Output 34
    Var 230, name O_CMDB, Link IOCARD_OUT, Output 35

    // SWITCHES
    Var 400, name I_CO, Link IOCARD_SW, Input 13
    Var 402, name I_FD2, Link IOCARD_SW, Input 14
    Var 404, name I_DISENGAGE, Link IOCARD_SW, Input 15
    Var 408, name I_CWSB, Link IOCARD_SW, Input 18
    Var 410, name I_CMDB, Link IOCARD_SW, Input 19
    Var 412, name I_CWSA, Link IOCARD_SW, Input 20
    Var 414, name I_CMDA, Link IOCARD_SW, Input 21
    Var 420, name I_APP, Link IOCARD_SW, Input 24
    Var 424, name I_LNAV, Link IOCARD_SW, Input 27
    Var 428, name I_LVLCHG, Link IOCARD_SW, Input 29
    Var 430, name I_VNAV, Link IOCARD_SW, Input 30
    Var 434, name I_N1, Link IOCARD_SW, Input 32

    // NAV1 CRS
    // *****************************************************************************
    Var 51 Link FSUIPC_INOUT Offset $0C4E Length 2 // NAV1 CRS in FSUIPC
    {
    v52 = v51 // new value from FSUIPC ?
    }

    Var 52 // internal NAV1 CRS
    {
    &D_COURSE = v52 // write to my 3-digit display
    }

    Var 53 Link IOCARD_ENCODER, Input 4, Aceleration 6, Type 2 // Course encoder
    {
    L0 = v53 * -1 // make sure turning right increments
    v52 = ROTATE 0 359 L0 // update NAV1 CRS
    v51 = v52 // write to FSUIPC
    }

    // IAS
    // *****************************************************************************
    Var 61 Link FSUIPC_INOUT Offset $07E8 Length 4 // IAS in FSUIPC
    {
    v62 = v61 / 655.36 // new value from FSUIPC ?
    v65 = TESTBIT V62 ,15
    }
    Var 65 // internal IAS
    {
    }

    Var 62 // internal IAS
    {
    &D_IAS = v62 // write to my 3-digit display
    &DECIMAL = 1
    }

    Var 63 Link IOCARD_ENCODER, Input 0, Aceleration 6, Type 2 // IAS encoder
    {
    L0 = v63 * -1 // make sure turning right increments
    v62 = LIMIT 0 99 L0 // update IAS
    v61 = v62 * 655.36 // write to FSUIPC
    }

    // Heading
    // *****************************************************************************
    Var 71 Link FSUIPC_INOUT Offset $07CC Length 2 // Heading in FSUIPC
    {
    v72 = v71 / 182 // new value from FSUIPC ?
    }

    Var 72 // internal Heading
    {
    &D_Heading = v72 // write to my 3-digit display
    }

    Var 73 Link IOCARD_ENCODER, Input 6, Aceleration 6, Type 2 // Heading encoder
    {
    L0 = v73 * -1 // make sure turning right increments
    v72 = ROTATE 0 359 L0 // update Heading
    v71 = v72 * 182 // write to FSUIPC
    }
    // Altitude
    // *****************************************************************************
    Var 81 Link FSUIPC_INOUT Offset $07D4 Length 4 // Altitude in FSUIPC
    {
    v82 = v81 / 19975.37 // new value from FSUIPC ? 65536
    }

    Var 82 // internal Altitude
    {
    &D_Atitude = v82 // write to my 3-digit display
    }

    Var 83 Link IOCARD_ENCODER, Input 2, Aceleration 6, Type 2 // Altitude encoder
    {
    L0 = v83 * -100 // make sure turning right increments
    v82 = LIMIT 0 16000 L0 // update Altitude
    v81 = v82 * 19975.37 // write to FSUIPC
    }
    // VertSpeed
    // *****************************************************************************
    Var 91 Link FSUIPC_INOUT Offset $07F2 Length 2 // VertSpeed in FSUIPC
    {
    L0 = V91 // En L0 el valor leido
    C0 = TESTBIT V91 ,15 // is it a negative ?
    IF C0
    {
    V92 = L0 - 65536 // negative
    }
    ELSE
    {
    V92 = L0 // positive
    }
    // v92 = v91 // new value from FSUIPC ?
    }

    Var 92 // internal VertSpeed
    {
    &D_VertSpeed = v92 // write to my 3-digit display
    }

    Var 93 Link IOCARD_ENCODER, Input 11, Aceleration 6, Type 2 // VertSpeed encoder
    {
    L0 = v93 * -100 // make sure turning right increments
    v92 = ROTATE -9000 9000 L0 // update VertSpeed
    IF v92 < 0 // temp
    {
    v91 = v92 + 65536 // negative
    }
    ELSE
    {
    v91 = v92 // positive
    }
    //v91 = v92 // write to FSUIPC
    }
    // NAV2 CRS
    // *****************************************************************************
    Var 41 Link FSUIPC_INOUT Offset $0D4E Length 2 // NAV2 CRS in FSUIPC
    {
    v42 = v41 // new value from FSUIPC ?
    }

    Var 42 // internal NAV2 CRS
    {
    &D_COURSE2 = v42 // write to my 3-digit display
    }

    Var 43 Link IOCARD_ENCODER, Input 9, Aceleration 6, Type 2 // Course encoder
    {
    L0 = v43 * -1 // make sure turning right increments
    v42 = ROTATE 0 359 L0 // update NAV2 CRS
    v41 = v42 // write to FSUIPC
    }
    // HDG SEL
    // *****************************************************************************
    Var 101 Link FSUIPC_INOUT Offset $07C8 Length 2 // HDG SEL in FSUIPC
    {
    v102 = v101 // new value from FSUIPC ?
    }

    Var 102 // internal HDG SEL
    {
    &O_HDGSEL = v102 // write to my led
    }
    Var 426, name I_HDGSEL, Link IOCARD_SW, Input 28
    {
    IF v426 = 1
    {
    IF v102 = 1
    {
    V101 = 0
    }
    ELSE
    {
    V101 = 1
    }
    }
    }
    // ALT HLD
    // *****************************************************************************
    Var 111 Link FSUIPC_INOUT Offset $07D0 Length 4 // ALT HLD in FSUIPC
    {
    v112 = v111 // new value from FSUIPC ?
    }

    Var 112 // internal ALT HLD
    {
    &O_ALTHLD = v112 // write to my led
    }
    Var 418, name I_ALTHLD, Link IOCARD_SW, Input 23
    {
    IF v418 = 1
    {
    IF v112 = 1
    {
    V111 = 0
    }
    ELSE
    {
    V111 = 1
    }
    }
    }
    // vs HLD
    // *****************************************************************************
    Var 121 Link FSUIPC_INOUT Offset $07EC Length 4 // vs HLD in FSUIPC
    {
    v122 = v121 // new value from FSUIPC ?
    }

    Var 122 // internal vs HLD
    {
    &O_VS = v122 // write to my led
    IF v122 = 1
    {
    &D_VertSpeed = v92 // enable vs display
    }
    ELSE
    {
    &D_VertSpeed = -999999 // darken vs display
    }

    }
    Var 416, name I_VS, Link IOCARD_SW, Input 22
    {
    IF v416 = 1
    {
    IF v122 = 1
    {
    V121 = 0
    &D_VertSpeed = -999999 // darken vs display
    }
    ELSE
    {
    V121 = 1
    &D_VertSpeed = v92 // enable vs display
    }
    }
    }
    // AT ARM
    // *****************************************************************************
    Var 131 Link FSUIPC_INOUT Offset $810 Length 4 // AT ARM in FSUIPC
    {
    v132 = v131 // new value from FSUIPC ?
    }

    Var 132 // internal AT ARM
    {
    &O_AT = v132 // write to my led
    }
    Var 436, name I_AT, Link IOCARD_SW, Input 33
    {
    V131 = v436
    }
    // VOR LOC
    // *****************************************************************************
    Var 141 Link FSUIPC_INOUT Offset $07C4 Length 4 // VOR LOC in FSUIPC
    {
    v142 = v141 // new value from FSUIPC ?
    }

    Var 142 // internal VOR LOC
    {
    &O_VORLOC = v142 // write to my led
    }
    Var 422, name I_VORLOC, Link IOCARD_SW, Input 25
    {
    IF v422 = 1
    {
    IF v142 = 1
    {
    V141 = 0
    }
    ELSE
    {
    V141 = 1
    }
    }
    }
    // FD1
    // *****************************************************************************
    Var 151 Link FSUIPC_INOUT Offset $07Cc Length 4 // FD1 in FSUIPC
    {
    v152 = v151 // new value from FSUIPC ?
    }

    Var 152 // internal FD1
    {
    //&O_AT = v152 // write to my led
    }
    Var 406, name I_FD1, Link IOCARD_SW, Input 16
    {
    V151 = v406
    }

    // Speed HLD
    // *****************************************************************************
    Var 161 Link FSUIPC_INOUT Offset $07DC Length 4 // Speed HLD in FSUIPC
    {
    v162 = v161 // new value from FSUIPC ?
    }

    Var 162 // internal Speed HLD
    {
    &O_SPEED = v162 // write to my led
    }
    Var 432, name I_SPEED, Link IOCARD_SW, Input 31
    {
    IF v432 = 1
    {
    IF v162 = 1
    {
    V161 = 0
    }
    ELSE
    {
    V161 = 1
    }
    }
    }
    When once you have tasted flight,
    you will forever walk the earth with your eyes turned skyward