Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20
  1. #11
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: XPNDR Code Problem

    Jerry

    Why not post your code. That should not be too difficult to fix - famous last words!

    David

  2. #12
    150+ Forum Groupie
    Join Date
    Aug 2008
    Location
    Dallas, Texas
    Posts
    192
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: XPNDR Code Problem

    David

    Here's my EFIS Code. I haven't finished my FO EFIS so I just left that on DEVICE 12 which doesn't exist. Guess that's ok.

    // *****************************************************************************
    // * Config_SIOC ver 4.3 - By Manuel Velez - www.opencockpits.com
    // *****************************************************************************
    // * FileName : PM_B747_EFIS.txt
    // * Date : 6/11/2013


    Var 0026, name I_5, Link IOCARD_SW, Input 37
    {
    IF &I_5 = 1
    {
    &PM_RANG = 0
    }
    }

    Var 0027, name I_10, Link IOCARD_SW, Input 55
    {
    IF &I_10 = 1
    {
    &PM_RANG = 1
    }
    }

    Var 0028, name I_20, Link IOCARD_SW, Input 58
    {
    IF &I_20 = 1
    {
    &PM_RANG = 2
    }
    }

    Var 0029, name I_40, Link IOCARD_SW, Input 57
    {
    IF &I_40 = 1
    {
    &PM_RANG = 3
    }
    }

    Var 0030, name I_80, Link IOCARD_SW, Input 61
    {
    IF &I_80 = 1
    {
    &PM_RANG = 4
    }
    }

    Var 0031, name I_160, Link IOCARD_SW, Input 54
    {
    IF &I_160 = 1
    {
    &PM_RANG = 5
    }
    }

    Var 0032, name I_320, Link IOCARD_SW, Input 60
    {
    IF &I_320 = 1
    {
    &PM_RANG = 6
    }
    }

    Var 0033, name I_640, Link IOCARD_SW, Input 59
    {
    IF &I_640 = 1
    {
    &PM_RANG = 7
    }
    }

    Var 0034, name I_APP, Link IOCARD_SW, Input 46
    {
    IF &I_APP = 1
    {
    &PM_MODO = 5
    }
    }

    Var 0035, name I_VOR, Link IOCARD_SW, Input 47
    {
    IF &I_VOR = 1
    {
    &PM_MODO = 3
    }
    }

    Var 0036, name I_MAP, Link IOCARD_SW, Input 49
    {
    IF &I_MAP = 1
    {
    &PM_MODO = 1
    }
    }

    Var 0037, name I_PLN, Link IOCARD_SW, Input 48
    {
    IF &I_PLN = 1
    {
    &PM_MODO = 4
    }
    }

    Var 0038, name I_S1, Link IOCARD_SW, Input 38
    {
    IF &I_S1 = 1
    {
    &PM_MODO = 90 // STA
    }
    }

    Var 0039, name I_S2, Link IOCARD_SW, Input 40
    {
    IF &I_S2 = 1
    {
    &PM_MODO = 93 // WPT
    }
    }

    Var 0040, name I_S3, Link IOCARD_SW, Input 53
    {
    IF &I_S3 = 1
    {
    &PM_MODO = 6 // CTR
    }
    }

    Var 0041, name I_S4, Link IOCARD_SW, Input 39
    {
    IF &I_S4 = 1
    {
    &PM_MODO = 94 // ARPT
    }
    }

    Var 0042, name I_S5, Link IOCARD_SW, Input 6
    {
    IF &I_S5 = 1
    {
    &PM_MODO = 82 // TERR
    }
    }

    Var 0043, name I_S6, Link IOCARD_SW, Input 62
    {
    IF &I_S6 = 1
    {
    &PM_MODO = 54 // TFC
    }
    }

    Var 0044, name I_S7, Link IOCARD_SW, Input 37
    {
    IF &I_S7 = 1
    {
    &PM_MODO = 72 // WXR
    }
    }

    Var 0045, name I_SR1, Link IOCARD_SW, Input 50
    {
    IF &I_SR1 = 1
    {
    &PM_MODO = 14 // FPV
    }
    }

    Var 0046, name I_SR2, Link IOCARD_SW, Input 70
    {
    IF &I_SR2 = 1
    {
    &PM_MODO = 26 // MTRS
    }
    }

    Var 0047, name I_BARONSW, Link IOCARD_SW, Input 51, Type P
    {
    IF &I_BARONSW = 1
    {
    &COD_ELAN = 49
    }
    ELSE
    {
    &COD_ELAN = 49
    }
    }

    Var 0048, name I_MINSW, Link IOCARD_SW, Input 41
    {
    IF &I_MINSW = 1
    {
    &SUB_DH = 3000
    }
    }

    Var 0049, name I_VOR1, Link IOCARD_SW, Input 42
    {
    IF &I_VOR1 = 1
    {
    &PM_MODO = 75
    }
    ELSE
    {
    IF &I_ADF1 = 0
    {
    &PM_MODO = 73
    }
    }
    }

    Var 0050, name I_ADF1, Link IOCARD_SW, Input 36
    {
    IF &I_ADF1 = 1
    {
    &PM_MODO = 74
    }
    ELSE
    {
    IF &I_VOR1 = 0
    {
    &PM_MODO = 73
    }
    }
    }

    Var 0051, name I_VOR2, Link IOCARD_SW, Input 52
    {
    IF &I_VOR2 = 1
    {
    &PM_MODO = 78
    }
    ELSE
    {
    IF &I_ADF2 = 0
    {
    &PM_MODO = 76
    }
    }
    }

    Var 0052, name I_ADF2, Link IOCARD_SW, Input 45
    {
    IF &I_ADF2 = 1
    {
    &PM_MODO = 77
    }
    ELSE
    {
    IF &I_VOR2 = 0
    {
    &PM_MODO = 76
    }
    }
    }

    Var 0053, name E_BARO, Link IOCARD_ENCODER, Input 65, Aceleration 1, Type 2
    {
    L0 = &E_BARO * -1
    &SUB_BAR = &SUB_BAR + L0
    }

    Var 0054, name E_MIN, Link IOCARD_ENCODER, Input 63, Aceleration 1, Type 2
    {
    L0 = &E_MIN * 100
    &SUB_DH = &SUB_DH + L0
    }

    Var 0055, name SUB_DH, Link SUBRUTINE
    {
    IF &SUB_DH > 20000
    {
    &SUB_DH = 20000
    }
    IF &SUB_DH < 0
    {
    &SUB_DH = 0
    }
    L0 = DIV &SUB_DH ,100
    &PM_DH = L0
    }

    Var 0056, name SUB_BAR, Link SUBRUTINE
    {
    L0 = &SUB_BAR * 16
    &FS_QNH = L0
    }

    Var 0057, name SUB2_DH, Link SUBRUTINE
    {
    IF &SUB2_DH > 20000
    {
    &SUB2_DH = 20000
    }
    IF &SUB2_DH < 0
    {
    &SUB2_DH = 0
    }
    L0 = DIV &SUB2_DH ,100
    &PM2_DH = L0
    }

    Var 0058, name SUB2_BAR, Link SUBRUTINE
    {
    L0 = &SUB2_BAR * 16
    &FS2_QNH = L0
    }

    Var 0059, name COD_ELAN, Link FSUIPC_INOUT, Offset $04F2, Length 2

    Var 0060, name PM_MODO, Link FSUIPC_INOUT, Offset $04F4, Length 2 // PM_EFIS_MODO

    Var 0061, name PM_RANG, Link FSUIPC_OUT, Offset $04F8, Length 2 // PM_EFIS_RANG

    Var 0062, name PM_DH, Link FSUIPC_OUT, Offset $04FA, Length 2 // PM_EFIS_DH

    Var 0063, name FS_QNH, Link FSUIPC_OUT, Offset $0330, Length 2 // FS_QNH_MB

    Var 0064, name PM2_RANG, Link FSUIPC_OUT, Offset $5524, Length 2 // PM_EFIS_RANG FO

    Var 0065, name PM2_DH, Link FSUIPC_OUT, Offset $5532, Length 2 // PM_EFIS_DH FO

    Var 0066, name FS2_QNH, Link FSUIPC_OUT, Offset $552E, Length 2 // FS_QNH_MB FO

    Var 0067, name I2_5, Link IOCARD_SW, Device 12, Input 0
    {
    IF &I2_5 = 1
    {
    &PM2_RANG = 0
    }
    }

    Var 0068, name I2_10, Link IOCARD_SW, Device 12, Input 1
    {
    IF &I2_10 = 1
    {
    &PM2_RANG = 1
    }
    }

    Var 0069, name I2_20, Link IOCARD_SW, Device 12, Input 2
    {
    IF &I2_20 = 1
    {
    &PM2_RANG = 2
    }
    }

    Var 0070, name I2_40, Link IOCARD_SW, Device 12, Input 3
    {
    IF &I2_40 = 1
    {
    &PM2_RANG = 3
    }
    }

    Var 0071, name I2_80, Link IOCARD_SW, Device 12, Input 4
    {
    IF &I2_80 = 1
    {
    &PM2_RANG = 4
    }
    }

    Var 0072, name I2_160, Link IOCARD_SW, Device 12, Input 5
    {
    IF &I2_160 = 1
    {
    &PM2_RANG = 5
    }
    }

    Var 0073, name I2_320, Link IOCARD_SW, Device 12, Input 6
    {
    IF &I2_320 = 1
    {
    &PM2_RANG = 6
    }
    }

    Var 0074, name I2_640, Link IOCARD_SW, Device 12, Input 7
    {
    IF &I2_640 = 1
    {
    &PM2_RANG = 7
    }
    }

    Var 0075, name I2_APP, Link IOCARD_SW, Device 12, Input 9
    {
    IF &I2_APP = 1
    {
    &PM_MODO = 105
    }
    }

    Var 0076, name I2_VOR, Link IOCARD_SW, Device 12, Input 10
    {
    IF &I2_VOR = 1
    {
    &PM_MODO = 103
    }
    }

    Var 0077, name I2_MAP, Link IOCARD_SW, Device 12, Input 11
    {
    IF &I2_MAP = 1
    {
    &PM_MODO = 101
    }
    }

    Var 0078, name I2_PLN, Link IOCARD_SW, Device 12, Input 12
    {
    IF &I2_PLN = 1
    {
    &PM_MODO = 104
    }
    }

    Var 0079, name I2_S1, Link IOCARD_SW, Device 12, Input 27
    {
    IF &I2_S1 = 1
    {
    &PM_MODO = 90 // STA
    }
    }

    Var 0080, name I2_S2, Link IOCARD_SW, Device 12, Input 28
    {
    IF &I2_S2 = 1
    {
    &PM_MODO = 93 // WPT
    }
    }

    Var 0081, name I2_S3, Link IOCARD_SW, Device 12, Input 29
    {
    IF &I2_S3 = 1
    {
    &PM_MODO = 6 // CTR
    }
    }

    Var 0082, name I2_S4, Link IOCARD_SW, Device 12, Input 30
    {
    IF &I2_S4 = 1
    {
    &PM_MODO = 94 // ARPT
    }
    }

    Var 0083, name I2_S5, Link IOCARD_SW, Device 12, Input 31
    {
    IF &I2_S5 = 1
    {
    }
    }

    Var 0084, name I2_S6, Link IOCARD_SW, Device 12, Input 32
    {
    IF &I2_S6 = 1
    {
    &PM_MODO = 95 // DATA
    }
    }

    Var 0085, name I2_S7, Link IOCARD_SW, Device 12, Input 33
    {
    IF &I2_S7 = 1
    {
    &PM_MODO = 96 // POS
    }
    }

    Var 0086, name I2_SR1, Link IOCARD_SW, Device 12, Input 34
    {
    IF &I2_SR1 = 1
    {
    &PM_MODO = 14 // FPV
    }
    }

    Var 0087, name I2_SR2, Link IOCARD_SW, Device 12, Input 38
    {
    IF &I2_SR2 = 1
    {
    &PM_MODO = 126 // MTRS
    }
    }

    Var 0088, name I2_BARONSW, Link IOCARD_SW, Device 12, Input 22
    {
    IF &I2_BARONSW = 1
    {
    &SUB2_BAR = 1013
    L0 = 1013 * 16
    L0 = L0 + 1
    &FS2_QNH = L0
    }
    }

    Var 0089, name I2_MINSW, Link IOCARD_SW, Device 12, Input 25
    {
    IF &I2_MINSW = 1
    {
    &SUB2_DH = 3000
    }
    }

    Var 0090, name I2_VOR1, Link IOCARD_SW, Device 12, Input 36
    {
    IF &I2_VOR1 = 1
    {
    &PM_MODO = 175
    }
    ELSE
    {
    IF &I2_ADF1 = 0
    {
    &PM_MODO = 173
    }
    }
    }

    Var 0091, name I2_ADF1, Link IOCARD_SW, Device 12, Input 37
    {
    IF &I2_ADF1 = 1
    {
    &PM_MODO = 174
    }
    ELSE
    {
    IF &I2_VOR1 = 0
    {
    &PM_MODO = 173
    }
    }
    }

    Var 0092, name I2_VOR2, Link IOCARD_SW, Device 12, Input 18
    {
    IF &I2_VOR2 = 1
    {
    &PM_MODO = 178
    }
    ELSE
    {
    IF &I2_ADF2 = 0
    {
    &PM_MODO = 176
    }
    }
    }

    Var 0093, name I2_ADF2, Link IOCARD_SW, Device 12, Input 19
    {
    IF &I2_ADF2 = 1
    {
    &PM_MODO = 177
    }
    ELSE
    {
    IF &I2_VOR2 = 0
    {
    &PM_MODO = 176
    }
    }
    }

    Var 0094, name E2_BARO, Link IOCARD_ENCODER, Device 12, Input 20, Aceleration 1, Type 2
    {
    L0 = &E2_BARO * 1
    &SUB2_BAR = &SUB2_BAR + L0
    }

    Var 0095, name E2_MIN, Link IOCARD_ENCODER, Device 12, Input 23, Aceleration 1, Type 2
    {
    L0 = &E2_MIN * 100
    &SUB2_DH = &SUB2_DH + L0
    }

  3. #13
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: XPNDR Code Problem

    Hi Jerry

    Just saw your code, but I am away from home for the next day or so. Will respond then with either changes to your code or a copy of mine!

    David

  4. #14
    150+ Forum Groupie
    Join Date
    Aug 2008
    Location
    Dallas, Texas
    Posts
    192
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: XPNDR Code Problem

    Quote Originally Posted by fordgt40 View Post
    Hi Jerry

    Just saw your code, but I am away from home for the next day or so. Will respond then with either changes to your code or a copy of mine!

    David
    Thanks David, looking forward to your reply

    Jerry

  5. #15
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: XPNDR Code Problem

    Hi Jerry

    I cannot categorically say your code is wrong, as my setup is down at present and I cannot run a simulation to check the values of &E_Baro. However, I attach my code for the Baro function, which I know works ok. The switch Barohpa switches the display between metric and imperial units.


    Var 1370, name BAROHPA, Link IOCARD_SW, input 101


    Var 1390, name E_BARO, Link IOCARD_ENCODER, input 102, Aceleration 1, Type 2
    {
    IF &BAROHPA = 1
    {
    L0 = &E_BARO * -16
    &FS_QNH = &FS_QNH + L0
    }
    ELSE
    {
    L0 = &E_BARO * -4
    &FS_QNH = &FS_QNH + L0
    }
    }


    Var 1440, name FS_QNH, Link FSUIPC_INOUT, Offset $0330, Length 2 // FS_QNH


    Any probs then let me know

    David

  6. #16
    150+ Forum Groupie
    Join Date
    Aug 2008
    Location
    Dallas, Texas
    Posts
    192
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: XPNDR Code Problem

    David

    I tried disabling my BARO code and inserting yours with my inputs but when I try to compile I get an error message "Access violation at address 004400752 in module'config_sioc.exe'. Read of address 00000024. I forgot to mention that I'm using Project Magenta GC, CDU, MCP and pmSystems software. I didn't realize that PM uses their own offsets to Read/Write to the FS EFIS. I guess I need to post this question in their forum unless you're familiar with their programing. Thanks for your help.

    Jerry

  7. #17
    150+ Forum Groupie
    Join Date
    Aug 2008
    Location
    Dallas, Texas
    Posts
    192
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: XPNDR Code Problem

    Quote Originally Posted by fordgt40 View Post
    Hi Jerry

    I cannot categorically say your code is wrong, as my setup is down at present and I cannot run a simulation to check the values of &E_Baro. However, I attach my code for the Baro function, which I know works ok. The switch Barohpa switches the display between metric and imperial units.


    Var 1370, name BAROHPA, Link IOCARD_SW, input 101


    Var 1390, name E_BARO, Link IOCARD_ENCODER, input 102, Aceleration 1, Type 2
    {
    IF &BAROHPA = 1
    {
    L0 = &E_BARO * -16
    &FS_QNH = &FS_QNH + L0
    }
    ELSE
    {
    L0 = &E_BARO * -4
    &FS_QNH = &FS_QNH + L0
    }
    }


    Var 1440, name FS_QNH, Link FSUIPC_INOUT, Offset $0330, Length 2 // FS_QNH


    Any probs then let me know

    David
    David
    You probably thought this subject was dead. I didn't mention that I do most of my flying in the USA, hence I use in. rather than HPA. I decided to do some flying in Europe so I changed over to HPA and the digits change correctly so I guess the problem has something to do with converting to in. I have no idea how to fix that.

    Jerry

  8. #18
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: XPNDR Code Problem

    Hi Jerry

    I will look at it this weekend and get back to you

    David

  9. #19
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: XPNDR Code Problem

    Hi Jerry

    I have fired up my sim and checked the code I sent you. It all works ok both in metric and imperial units. I am also using the same FSUIPC offset as you ie 0330. So, I do not understand why the code does not run on your machine. Did you cut and paste my code into yours, if so, then delete the new code and enter my code by hand as sometimes cutting and pasting can introduce additional control characters.

    Else, have you tried using the iocpconsole function to see your variable values and also use the log command. Then you will see how the values change when the encoder is turned and it should be evident what is happening, so you can then change the code accordingly. I agree that I think your sioc code to convert the 0330 offset value is wrong, but by using the iocpconsole function it should be readily apparent where the code is going wrong

    David

  10. #20
    150+ Forum Groupie
    Join Date
    Aug 2008
    Location
    Dallas, Texas
    Posts
    192
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: XPNDR Code Problem

    Thanks David. I'll try those suggestions when I have time and get back to you.

    Jerry

Page 2 of 2 FirstFirst 12