Results 1 to 2 of 2
  1. #1
    25+ Posting Member
    Join Date
    Apr 2010
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Question HELP, i am totally lost with SOIC

    hi GUys,

    i am looking at soic, reading all the articles i can find, and still cannot get my head around how to program this. i have got encoders, switches and such to confirgure to run the mindstar g1000 software, but i cannot get m head around how i should be writing the code for soic.

    any kind soul care to help out??



  2. #2
    150+ Forum Groupie pdpo's Avatar
    Join Date
    Nov 2005
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: HELP, i am totally lost with SOIC

    Hi there,

    SIOC is not that difficult ... the documentation is not that good but the site of Niko Kaan (Kiek) is a good starting point with many small parts of SIOC code which you can try out and modify and then learn by trying.
    The catch of SIOC lies in the fact that the SIOC script you need to write is actually only an input to the sioc program itself which works in the background.
    So when you define a variable as FSUIPC_IN type, then the SIOC program will start reading every X ms this offset and if the value of this offset changes from the previous value known to the SIOC program itself then the body of the script attached to the variable is executed.
    This behavior is also valid for IOCARD_INPUT type of vars but here the SIOC reads every 10ms the hardware and if an input changes value (from 1 to 0 or from 0 to 1) then the body attached to this input variable in the script is executed.
    Same is applicable for the normal variables which have no input (no fsuipc/no hardware input), only when they change value the script attached to it is executed. So when an fsuipc offset changes and in the body of that fsuipc variable you change the value of several normal variables, then this creates a avalance effect since each variable change causes executing of a script (if its defined of course).
    Ones you understand this concept then its easier to get along with SIOC scripting.
    Remind that if no variable changes, no inputs changes, then SIOC will just read continuously the fsuipc offsets and the hardware for changes in the states and only if there are changes in one of those, then some part of the script is invoked.

    Greetz Peter

    PS: the best way to learn is to try some small script, understand what happens and if that small script doesnt do what you expect it to do, then post this script here and tell what you expect it to do, then we can explain why it behaves the way it does ...

    PS : X ms : this value is defined in the SIOC.INI

    PS : of course this is only the basic working of SIOC since there is also another function. SIOC itself is also a server for other clients. Clients on other computers can register themselves to some variables or even all variables. Then when a variable changes value its not only executing the attached body to that variable but the server send the variables value also via the network to the clients who have registered to this variable.
    But this way of working is of course a little more complicated.

    PS : when learning SIOC scripts make use of IOCPconsole program. This program is a client to SIOC (as described above) and it registers itself to the variables you select. When a variable changes value this iocpconsole shows this change and you can easily follow what happens.

Similar Threads

  1. Totally lost with outputs card
    By Steve A in forum OpenCockpits General Discussion
    Replies: 12
    Last Post: 06-14-2010, 11:21 AM
  2. Totally Stickered!
    By AlexJ in forum General Aviation (GA) Builder Disccusion
    Replies: 7
    Last Post: 04-12-2010, 08:12 AM
  3. Can SOIC handle switch bounce?
    By jmig in forum OpenCockpits General Discussion
    Replies: 20
    Last Post: 10-27-2009, 09:13 PM
  4. CNC 100% Totally Finished.
    By riche543 in forum MyCockpit Crew Rest (Off topic chat forum)
    Replies: 11
    Last Post: 07-08-2009, 10:30 AM
  5. totally baffled
    By tiburon in forum OpenCockpits General Discussion
    Replies: 11
    Last Post: 04-24-2009, 07:23 AM