07-06-2010, 02:41 AM #1
- Join Date
- Apr 2010
HELP, i am totally lost with SOIC
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??
07-06-2010, 03:21 AM #2
Re: HELP, i am totally lost with SOIC
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.
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.FS9+PM+AST+opencockpits
By Steve A in forum OpenCockpits General DiscussionReplies: 12Last Post: 06-14-2010, 11:21 AM
By AlexJ in forum General Aviation (GA) Builder DisccusionReplies: 7Last Post: 04-12-2010, 08:12 AM
By jmig in forum OpenCockpits General DiscussionReplies: 20Last Post: 10-27-2009, 09:13 PM
By riche543 in forum MyCockpit Crew Rest (Off topic chat forum)Replies: 11Last Post: 07-08-2009, 10:30 AM
By tiburon in forum OpenCockpits General DiscussionReplies: 11Last Post: 04-24-2009, 07:23 AM