SIOC Software

SIOC is a programming language/system that is used to program a flight simulator based on Opencockpits IOCards. Basically this means connecting a switch in your home build cockpit to the aircraft add-on in MS Flight simulator and, the other way around, using information in that add-on to control led's and digits in your cockpit.

The documentation of Opencockpits about SIOC is huge and overwhelming, and not always correctly translated into English... There is often confusion about how to use SIOC. Therefore I will try to explain the basics.

To start with one should forget about running at multiple PC's, forget about the IOCP protocol/variables and forget about 'servers'. One only needs:

Furthermore, the siocmonitor.exe program is very handy to check whether your hardware is correctly working or not. SIOC, config-sioc and siocmonitor are all installed by the sioc.zip package (free).

A presentation (from Opencockpits) can be downloaded here.


SIOC: The Golden Rule

Very important to understand is that SIOC is not a 'normal' procedural programming language with a clear start and a clear end (like Pascal, C, C++, Java, ...), but an event driven scripting language ...

Ok... (uh, yes...), but what does that mean???

Well, SIOC works with Variable declarations. Variables represent connections to the outside  world, such as FSUIPC offsets (your link with your aircraft in FS9/FSX), push buttons, switches, rotary switches, rotary encoders, led's, 7-segment display, servo's, and so on, or they represent internal program states or subroutines.

SIOC monitors the Variables connected to the outside world say 50 times per second in order to detect any changes in values. If a Variable gets another value, then (and only then!) the code in the body of the Variable, enclosed by curly brackets { }, is executed. This can cause another Variable to change value and so you may get a chain of events. Ideal for simulating the logics of an aircraft!

It is very important to understand this behavior of SIOC. One might call it the SIOC Golden Rule:

SIOC golden Rule

[sheet from a power point presentation by Opencockpits]

Jump to top of this page


SIOC window

If you start sioc.exe the SIOC window will pop up. Below is a screen shot of that window at my PC.SIOC window

The <IOCards> Module sub window should indicate Running.

The <FSUIPC> Module sub window gives information about use and status of FSUIPC. This depends on your setting in sioc.ini (see below); whether you have enabled FSUIPC or not. Note if you are not using FSUIPC offsets in your SIOC script you better disable FSUIPC.

The <IOCP> SERVER sub window gives information about the Host address (192.168.1.105) and the Port (8092) over which an IOCP server that is build in SIOC, is available. My lekseecon program connects to this IOCP server to exchange information about the Variables in the SIOC program. In the LOG sub window you will find the message "IOCP Client Connected" as soon as lekseecon connects to SIOC. The actual number of Clients connected is indicated in the IOCP SERVER sub window.

The <IOCP> Client Modules #0 and #1. For almost all users these should be Disabled, don't pay much attention to it, just take the settings in your sioc.ini as I have (see below).

The Devices sub window tells you which Opencockpits USB cards SIOC has detected. At my PC it has detected my two USB expansion cards, my MCP module, my Chrono module, my IOCards-Keys card and my USB Outputs card.

The Line "IDX = 0 - USBexp V2 - Device = 35 " gives important information: it means that in my computer the (physical) Device number of this USB expansion card has got number 35. In the sioc.ini file you can specify the logical device number for the use of this device in SIOC (in this case 0). This logical number is used as parameter for the DEVICE attribute for SIOC variables. The link between the logical device number used in SIOC and the physical device number at my PC is defined in the sioc.ini file in the SIOC folder. Below a screen shot of -part of- my sioc.ini:

sioc.ini

Let me explain the first line in the [MASTERS] block:

MASTER=0,4,4,35

You see? By doing this we have linked DEVICE 0 to physica device 35 (as you can see in the SIOC main window). Be aware that if you unplug your USB card and plug it into another USB port you will get another number then 35 ... and you will have to update your sioc.ini. But the advantage of this concept is that you do not have to change your SIOC scripts.

More info about the DEVICE attribute in SIOC is given in this how-to example.

To get your settings right just start SIOC and write down the Device number(-s) detected. Then close SIOC, update your sioc.ini and start again.

The LOG sub window shows that SIOC has loaded and is running the script cockpit767.ssi.

Finally the line E:\IOCards\SIOC\cockpit767.lst in the black rectangle at the bottom shows value of the CONFIG_SIOC parameter in sioc.ini. This parameter specifies the SIOC source that will be input to SIOC.exe. In this case cocpit767.lst is a file containing just the names of (lots of) SIOC scripts that together control my cockpit:

cockpit767

As SIOC starts it will first compile these scripts (takes about 2 seconds) and if there are no errors (indicated by File Compiled! in the LOG window) it will start executing.

Note that this .lst technique is different from the config_sioc approach where you pre-compile a script to a .ssi file. The .lst approach is particularly handy when you have a lot of already developed (finished) SIOC scripts and you only may want to make small changes or you may want to use (over time) different subsets.

Jump to top of this page