Results 1 to 5 of 5
  1. #1
    300+ Forum Addict


    tiburon's Avatar
    Join Date
    May 2007
    Location
    Amsterdam
    Posts
    353
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    combining SIOC scripts

    Hi,
    I have a baffling (for me) problem. I have two scripts, one OC script for their MCP and a script I found here for making the rotary switch on the OC XPNDR work.
    Both work flawlessly on their own but when I try to combine them they don't.

    So here's the XPNDR script :

    Code:
    // *****************************************************************************
    // * Config_SIOC    -     By Mattia Lambreschi
    // *****************************************************************************
    // * FileName : sioc.txt
    // * Date : 03/02/2011
    
    
    
    Var 405, name STATUS
    Var 399, name TASTO, Link KEYS
    
    Var 406, name I_R_STB, Link IOCARD_SW, Input 0
    {
      IF &I_R_STB = 1
      {
        V420 = 10 
      }    
     
    }
    Var 408, name I_R_ALT, Link IOCARD_SW, Input 1
    {
      IF &I_R_ALT = 1
      {
        V420 = 20
      }
    
    }
    
    
    Var 410, name I_R_XPN, Link IOCARD_SW, Input 2
    {
      IF &I_R_XPN = 1
      {
        V420 = 30    
      }
    }
    
    
    
    
    Var 412, name I_R_TAO, Link IOCARD_SW, Input 3
    {
      IF &I_R_TAO = 1
      {
        V420 = 40    
      }
    }
    Var 414, name I_R_TAR, Link IOCARD_SW, Input 4
    {
      IF &I_R_TAR = 1
      {
        V420 = 50    
      }
    }
    
    Var 0420, Link SUBRUTINE
    {
      IF V0405 >= V0420
      {
        &TASTO = 1    
        &TASTO = 0    
        V0405 = V0420    
      }
      ELSE
      {
        &TASTO = 2    
        &TASTO = 0    
        V0405 = V0420    
      }
    }
    And the MCP script :

    Code:
    // *****************************************************************************
    // * Config_SIOC ver 3.5   -     By Manolo Vélez    -    www.opencockpits.com
    // *****************************************************************************
    // * FileName : sioc mcp pmdg w_bat.txt
    // * Date : 14/09/2009
    
    
    
    Var 0001, name keys, Link KEYS     // variable transfert emulateur clavier ( S
    
    Var 0002, name MEMHDG, Value 0
    
    Var 0003, name IAS, Link FSUIPC_IN, Offset $02BC, Length 4
    
    Var 0004, name MACH, Link FSUIPC_IN, Offset $11C6, Length 2
    
    Var 0005, name MEMALT, Value 10000
    
    Var 0010, name FDLEFTled, Link IOCARD_OUT, Output 39
    
    Var 0011, name ATled, Link IOCARD_OUT, Output 22
    
    Var 0012, name N1led, Link IOCARD_OUT, Output 21
    
    Var 0013, name SPEEDled, Link IOCARD_OUT, Output 23
    
    Var 0014, name LVLCHGled, Link IOCARD_OUT, Output 24
    
    Var 0015, name HDGled, Link IOCARD_OUT, Output 26
    
    Var 0016, name VNAVled, Link IOCARD_OUT, Output 25
    
    Var 0017, name LNAVled, Link IOCARD_OUT, Output 29
    
    Var 0018, name VORLOCled, Link IOCARD_OUT, Output 28
    
    Var 0019, name APPled, Link IOCARD_OUT, Output 27
    
    Var 0020, name ALTHOLDled, Link IOCARD_OUT, Output 30
    
    Var 0021, name VSled, Link IOCARD_OUT, Output 31
    
    Var 0022, name CMDAled, Link IOCARD_OUT, Output 33
    
    Var 0023, name CMDBled, Link IOCARD_OUT, Output 35
    
    Var 0024, name CWSAled, Link IOCARD_OUT, Output 32
    
    Var 0025, name CWSBled, Link IOCARD_OUT, Output 34
    
    Var 0026, name VSminus, Link IOCARD_OUT, Output 45
    
    Var 0027, name IASpoint, Link IOCARD_OUT, Output 20
    
    Var 0030, name CRSLEFTdisplay, Link IOCARD_DISPLAY, Digit 0, Numbers 3
    
    Var 0031, name IASdisplay, Link IOCARD_DISPLAY, Digit 3, Numbers 3
    
    Var 0032, name HDGdisplay, Link IOCARD_DISPLAY, Digit 6, Numbers 3
    
    Var 0033, name ALTdisplay, Link IOCARD_DISPLAY, Digit 9, Numbers 5
    
    Var 0034, name VSdisplay, Link IOCARD_DISPLAY, Digit 14, Numbers 5
    
    Var 0035, name CRSRdisplay, Link IOCARD_DISPLAY, Digit 19, Numbers 3
    
    Var 0040, name MCPstatus, Link FSUIPC_IN, Offset $62BC, Length 4
    {
      &FDLEFTled = TESTBIT &MCPstatus ,12
      &ATled = TESTBIT &MCPstatus ,14
      &N1led = TESTBIT &MCPstatus ,15
      &SPEEDled = TESTBIT &MCPstatus ,16
      &VNAVled = TESTBIT &MCPstatus ,18
      &LVLCHGled = TESTBIT &MCPstatus ,17
      &HDGled = TESTBIT &MCPstatus ,22
      &LNAVled = TESTBIT &MCPstatus ,19
      &VORLOCled = TESTBIT &MCPstatus ,20
      &APPled = TESTBIT &MCPstatus ,21
      &ALTHOLDled = TESTBIT &MCPstatus ,23
      &VSled = TESTBIT &MCPstatus ,24
      &CMDAled = TESTBIT &MCPstatus ,8
      &CMDBled = TESTBIT &MCPstatus ,9
      &CWSAled = TESTBIT &MCPstatus ,25
      &CWSBled = TESTBIT &MCPstatus ,26
      CALL &HDGaff
      CALL &IASaff
      CALL &ALTaff
      CALL &VSaff
    }
    
    Var 0041, name SPDINTV, Link FSUIPC_IN, Offset $62C0, Length 1
    {
      CALL &IASaff
    }
    
    Var 0042, name COstatus, Link FSUIPC_IN, Offset $621E, Length 2
    {
      CALL &IASaff
    }
    
    Var 0050, name CRSpmdg, Link FSUIPC_IN, Offset $0C4E, Length 2
    {
      IF &CRSpmdg = 360
      {
        &CRSLEFTdisplay = 0    
      }
      ELSE
      {
        &CRSLEFTdisplay = &CRSpmdg    
      }
    }
    
    Var 0051, name IASpmdg, Link FSUIPC_IN, Offset $6220, Length 2
    {
      CALL &IASaff
    }
    
    Var 0052, name hdgpmdg, Link FSUIPC_IN, Offset $622C, Length 2
    {
      CALL &HDGaff
    }
    
    Var 0053, name ALTpmdg, Link FSUIPC_IN, Offset $622E, Length 2
    {
      CALL &ALTaff
    }
    
    Var 0054, name VSpmdg, Link FSUIPC_IN, Offset $6230, Length 2
    {
      CALL &VSaff
    }
    
    Var 0055, name CRS2pmdg, Link FSUIPC_IN, Offset $0C4E, Length 2
    {
      IF &CRS2pmdg = 360
      {
        &CRSRdisplay = 0    
      }
      ELSE
      {
        &CRSRdisplay = &CRS2pmdg    
      }
    }
    
    Var 0060, name FDswitch, Link IOCARD_SW, Input 16
    {
      IF &FDswitch = 1
      {
        IF &FDLEFTled = 0
        {
          &keys = 56    
          &keys = 0    
        }
      }
      ELSE
      {
        IF &FDswitch = 0
        {
          IF &FDLEFTled = 1
          {
            &keys = 56    
            &keys = 0    
          }
        }
      }
    }
    
    Var 0061, name ATswitch, Link IOCARD_SW, Input 33
    {
      IF &ATswitch = 1
      {
        IF &ATled = 0
        {
          &keys = 44    
          &keys = 0    
        }
      }
      ELSE
      {
        IF &ATswitch = 0
        {
          IF &ATled = 1
          {
            &keys = 44    
            &keys = 0    
          }
        }
      }
    }
    
    Var 0062, name N1bp, Link IOCARD_SW, Input 32
    {
      IF &N1bp = 1
      {
        &keys = 61    
        &keys = 0    
      }
    }
    
    Var 0063, name SPEEDbp, Link IOCARD_SW, Input 31
    {
      IF &SPEEDbp = 1
      {
        &keys = 51    
        &keys = 0    
      }
    }
    
    Var 0064, name VNAVbp, Link IOCARD_SW, Input 30
    {
      IF &VNAVbp = 1
      {
        &keys = 57    
        &keys = 0    
      }
    }
    
    Var 0065, name LVLCHGbp, Link IOCARD_SW, Input 29
    {
      IF &LVLCHGbp = 1
      {
        &keys = 59    
        &keys = 0    
      }
    }
    
    Var 0066, name HDGbp, Link IOCARD_SW, Input 28
    {
      IF &HDGbp = 1
      {
        &keys = 62    
        &keys = 0    
      }
    }
    
    Var 0067, name LNAVbp, Link IOCARD_SW, Input 27
    {
      IF &LNAVbp = 1
      {
        &keys = 69    
        &keys = 0    
      }
    }
    
    Var 0068, name VORLOCbp, Link IOCARD_SW, Input 25
    {
      IF &VORLOCbp = 1
      {
        &keys = 70    
        &keys = 0    
      }
    }
    
    Var 0069, name APPbp, Link IOCARD_SW, Input 24
    {
      IF &APPbp = 1
      {
        &keys = 63    
        &keys = 0    
      }
    }
    
    Var 0070, name ALTHOLDbp, Link IOCARD_SW, Input 23
    {
      IF &ALTHOLDbp = 1
      {
        &keys = 64    
        &keys = 0    
      }
    }
    
    Var 0071, name VSbp, Link IOCARD_SW, Input 22
    {
      IF &VSbp = 1
      {
        &keys = 58    
        &keys = 0    
      }
    }
    
    Var 0072, name CMDAbp, Link IOCARD_SW, Input 21
    {
      IF &CMDAbp = 1
      {
        &keys = 66    
        &keys = 0    
      }
    }
    
    Var 0073, name CMDBbp, Link IOCARD_SW, Input 19
    {
      IF &CMDBbp = 1
      {
        &keys = 67    
        &keys = 0    
      }
    }
    
    Var 0074, name CWSAbp, Link IOCARD_SW, Input 20
    {
      IF &CWSAbp = 1
      {
        &keys = 65    
        &keys = 0    
      }
    }
    
    Var 0075, name CWSBbp, Link IOCARD_SW, Input 18
    {
      IF &CWSBbp = 1
      {
        &keys = 68    
        &keys = 0    
      }
    }
    
    Var 0076, name APDISCObp, Link IOCARD_SW, Input 15
    {
      IF &APDISCObp = 1
      {
        &keys = 26    
        &keys = 0    
      }
      ELSE
      {
        &keys = 26    
        &keys = 0    
      }
    }
    
    Var 0077, name CObp, Link IOCARD_SW, Input 13
    {
      IF &CObp = 1
      {
        &keys = 60    
        &keys = 0    
      }
    }
    
    Var 0078, name FDRswitch, Link IOCARD_SW, Input 14
    {
      IF &FDRswitch = 1
      {
        &keys = 73    
        &keys = 0    
      }
      ELSE
      {
        &keys = 73    
        &keys = 0    
      }
    }
    
    Var 0080, name CRSLEFTrot, Link IOCARD_ENCODER, Input 4, Aceleration 1, Type 2
    {
      IF &CRSLEFTrot = 1
      {
        &keys = 45    
        &keys = 0    
      }
      ELSE
      {
        &keys = 46    
        &keys = 0    
      }
    }
    
    Var 0081, name IASrot, Link IOCARD_ENCODER, Input 0, Aceleration 1, Type 2
    {
      IF &IASrot = 1
      {
        &keys = 49    
        &keys = 0    
      }
      ELSE
      {
        &keys = 50    
        &keys = 0    
      }
    }
    
    Var 0082, name HDGrot, Link IOCARD_ENCODER, Input 6, Aceleration 1, Type 2
    {
      IF &HDGrot = 1
      {
        &keys = 47    
        &keys = 0    
      }
      ELSE
      {
        &keys = 48    
        &keys = 0    
      }
      IF &HDGled = 0
      {
        L0 = &HDGrot * -1
        &MEMHDG = ROTATE 0 ,359 ,L0
      }
      CALL &HDGaff
    }
    
    Var 0083, name ALTrot, Link IOCARD_ENCODER, Input 2, Aceleration 1, Type 2
    {
      IF &ALTrot = 1
      {
        &keys = 53    
        &keys = 0    
      }
      ELSE
      {
        &keys = 52    
        &keys = 0    
      }
      IF &VNAVled = 1
      {
        L0 = &ALTrot * -100
        &MEMALT = LIMIT 0 ,50000 ,L0
        CALL &ALTaff
      }
    }
    
    Var 0084, name VSrot, Link IOCARD_ENCODER, Input 11, Aceleration 1, Type 2
    {
      IF &VSrot = 1
      {
        &keys = 54    
        &keys = 0    
      }
      ELSE
      {
        &keys = 55    
        &keys = 0    
      }
    }
    
    Var 0085, name CRSRIGHTrot, Link IOCARD_ENCODER, Input 9, Aceleration 1, Type 2
    {
      IF &CRSRIGHTrot = 1
      {
        &keys = 45    
        &keys = 0    
      }
      ELSE
      {
        &keys = 46    
        &keys = 0    
      }
    }
    
    Var 0086, name BATTERY, Link FSUIPC_INOUT, Offset $3102, Length 1
    {
      IF &BATTERY = 0
      {
        &ALTdisplay = -999999    
        &CRSLEFTdisplay = -999999    
        &CRSRdisplay = -999999    
        &HDGdisplay = -999999    
        &IASdisplay = -999999    
        &IASpoint = 0    
        &VSdisplay = -999999    
        &VSminus = 0    
      }
      ELSE
      {
        CALL &ALTaff
        CALL &HDGaff
        CALL &IASaff
        CALL &VSaff
        &CRSLEFTdisplay = &CRSpmdg    
        &CRSRdisplay = &CRS2pmdg    
      }
    }
    
    Var 9999, name VSaff, Link SUBRUTINE
    {
      IF &VSled = 1
      {
        IF &VSpmdg < 60000
        {
          &VSdisplay = &VSpmdg    
          &VSminus = 0    
        }
        ELSE
        {
          L0 = &VSpmdg - 65536
          &VSdisplay = L0    
          &VSminus = 1    
        }
      }
      ELSE
      {
        &VSdisplay = -999999    
        &VSminus = 0    
      }
    }
    
    Var 9998, name IASaff, Link SUBRUTINE
    {
      C0 = &SPDINTV = 21
      C0 = C0 AND &VNAVled
      IF C0    
      {
        &IASdisplay = -999999    
      }
      ELSE
      {
        IF &COstatus < 4
        {
          &IASdisplay = &IASpmdg    
          &IASpoint = 0    
        }
        ELSE
        {
          L0 = &IASpmdg / &IAS
          L0 = L0 * 12800
          L0 = L0 * &MACH
          &IASdisplay = L0 / 20480
          &IASpoint = 1    
        }
      }
    }
    
    Var 9997, name HDGaff, Link SUBRUTINE
    {
      IF &LNAVled = 0
      {
        IF &hdgpmdg = 360
        {
          &MEMHDG = 0    
        }
        ELSE
        {
          &MEMHDG = &hdgpmdg    
        }
      }
      &HDGdisplay = &MEMHDG    
    }
    
    Var 9996, name ALTaff, Link SUBRUTINE
    {
      IF &VNAVled = 0
      {
        &MEMALT = &ALTpmdg    
      }
      &ALTdisplay = &MEMALT    
    }
    I open the config_sioc.ini and put in the names of the two scripts, fire up config_sioc.exe,go to group, run et voilá, no errors. I save the script as test.ssi.

    I adjust the sioc.ini to the following:

    Code:
    IOCP_port=8090
    
    
    IOCP_timeout=4000
     
    Minimized=No
    
    
    toggle_delay=20
    
    CONFIG_FILE=.\SCRIPTS\test.ssi
    
    IOCard_disable=No
    
    IOCard_LPT=No
    
    
    [------------- CARDS CONFIG -------------]
    
    
    master=1,5,1,0
    MASTER=0,11,2,26
    
    
    USBStepper=0,0
    USBKeys=2,19
    USBServos=0,0
    USBRelays=0,0
    USBDCmotor=0,0
    
    
    
    USBAnalogic=0,0
    
    
    FSUipcdisable=No
    
    FSUipcRefresh=50
    
    
    IOCPini_delay=3000
     
    IOCPclient0_disable=Yes
    
    IOCPclient0_host=localhost
    
    IOCPclient0_port=8090
    
    
    IOCPclient1_disable=Yes
    
    IOCPclient1_host=localhost
    
    IOCPclient1_port=8099
    
    
    
    Sound_disable=yes
    
    Volume=100
    
    
    
    
    [ #1 ]
    Sound=APDis.wav,-1,-1,-1
    
    [ #2 ]
    Sound=*outermk.wav,-1,-1,-1
    
    [ #3 ]
    Sound=*hello.wav
    
    
    window =a.txt - Bloc de notas 
    
    
    
    #1=\3U\4
    #2=\1U\2
    #3=
    #4=
    #5=
    #6=
    #7=
    #8=
    #9=
    #10=
    #11=
    #12=
    #13=
    #14=
    #15=
    #16=
    #17=
    #18=
    #19=
    #20=
    #21=
    #22=
    #23=
    #24=
    #25=
    #26=\3\1Y\2\4
    #27=
    #28=
    #29=
    #30=
    #31=
    #32=
    #33=
    #34=
    #35=
    #36=
    #37=
    #38=
    #39=
    #40=
    #41=
    #42=
    #43=
    #44=\1R\2
    #45=\3\I\4
    #46=\1\G\2
    #47=\3\L\4
    #48=\3\1H\2\4
    #49=\1\O\2
    #50=\3\1V\2\4
    #51=\3M\4
    #52=\3\1Z\2\4
    #53=\3\F\4
    #54=\3\1\O\2\4
    #55=\3\1P\2\4
    #56=\3F\4
    #57=\3V\4
    #58=\3P\4
    #59=\3I\4
    #60=\1I\2
    #61=\3\1N\2\4
    #62=\3H\4
    #63=\3A\4
    #64=\3Z\4
    #65=\3\H\4
    #66=\3\1A\2\4
    #67=\1\H\2
    #68=\3\1\H\2\4
    #69=\3N\4
    #70=\3O\4
    #71=\3\I\4
    #72=\1\G\2
    #73=\3\1\G\2\4
    #74=
    #75=
    #76=
    #77=
    #78=
    #79=
    #80=
    #81=
    #82=
    #83=
    #84=
    #85=
    #86=
    #87=
    #88=
    #200=
    
    [ End of File ]
    I use shft U and CTL U for the rotary since CTL I was taken by LVLCHG.
    And fire up FS : The MCP doesn't come alive and does nothing, the xpndr shows 5 zeroes and can't be adjusted and the rotary switch only works in one direction.

    Please help ?

  2. #2
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,202
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: combining SIOC scripts

    Hi,
    That's because you have defined the MCP to be at logical DEVICE 1 (in your sioc.ini, see the Master statement), while in your MCP script you are using (by default) DEVICE 0 for every in- and output.
    The solution is to add DEVICE 1 to every In- and Output definition in your MCP script.

    Regards,
    Nico Kaan

  3. #3
    300+ Forum Addict


    tiburon's Avatar
    Join Date
    May 2007
    Location
    Amsterdam
    Posts
    353
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: combining SIOC scripts

    Thanks Nico,

    i changed the device number of the USBkeys card and added "device 1" to the few lines of the XPNDR and it works, fantastic.
    Is there a way to extinguish the displays of the MCP when you exit FS ? Now they remain alight.
    Also there's a few lines of code in the script that if I read correctly if the battery switch is off the displays should be off ?
    But when I start the PMDG 737 cold and dark the all the displays (except VS of course) come alive.

    regards

    Martin

  4. #4
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,202
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: combining SIOC scripts

    Quote Originally Posted by tiburon View Post
    Is there a way to extinguish the displays of the MCP when you exit FS ? Now they remain alight.
    Yes there is but it needs some more code. Thisis the way to go

    regards,
    Nico

  5. #5
    300+ Forum Addict


    tiburon's Avatar
    Join Date
    May 2007
    Location
    Amsterdam
    Posts
    353
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: combining SIOC scripts

    Thanks, I'll look into that a bit later. I'm doing a flight right now to test things, still have a few issues with the MCP, they probably stem from conflicting keystrokes in RC4 and FSPassenger.