Вы находитесь на странице: 1из 44

IOCards Step by step

Part 2: SIOC language




By Claude Kieffer Translate to Spanish: Michel Alcntara
This part has been edited thanks to the technical collaboration of Guy Boullu


1his tutorial contens:

1- SIOC Why?.
2- SIOC Ior Who?.
3- SIOC and the IOCards cards.
4- Which programs that We should install?
5- First test with SIOC
6- The SIOC Variables, or IOCP variables
7- Variables: ClasiIication
8- Inicialization variable
9- FSUIPC linked variables.
10-Read: a variable linked to IOCards with IF and ELSE
11-Write: a landing gear command with IF and ELSE
12-Three conditions IF and ELSE
13-DELAY Iunction
14-Who does command?
15-The IOCP console
16-TESTBIT Iunction
17-SETBIT, CLEARBIT and CHANGEBIT Iunctions
18-Local variables
19-Subroutines
20-Logic operators
21-Encoders
22-Analog inputs
23-Displays
24-Sounds
25-Other Iunctions
26-Conclusion

SIOC why?
The system classic IOCard, to which we already dedicate the Iirst part oI the tutorial
IOCards step by step", it is adapted since Ior the beginners its "programming" it is simple
and it is it more than it is enough Ior most oI the home cockpits projects.
SIOC is a language oI more potent programming that allows to make a home cockpit with
complex logical Iunctions, timers, mathematics compute, etc.
We will be able to very easily to do task as "I light on an intermittent alarm iI the speed is
lower than 130 Kts, iI the landing gear is retracted, iI the Ilaps is extended ".
That it is not possible with the IOCard.

SIOC Ior who?
Manuel Vlez, the SIOC and IOCards designer, comments: "The SIOC is a potent
language for advanced users "(Avsim, 14 March 2006)
Nico Kaan, an user Irom Netherland says: "even to beginners, I recommend them that the
SIOC uses and not the base IOCard . But he also adds: "of course it is preferable to have
some notions of computer programming, but it is better not to be built a booth... " (Avsim,
14 March 2006)
However, there are them that they are clumsy in the programming knowledge (as me) but
that they want to understand what is the SIOC and like it works.
Those dummies make eIIorts, they try to read the documentation that provides them the
web oI OpenCockpits. When reading it then they discover with happiness that the SIOC is
"a system oI programming oI vertical structure that IOCP works with the protocol and that
this based on events". As logical, the clumsy one gets scared. At once he makes blot and
new bill and he thinks "that is not Ior me."
Because in Iact to avoid that type oI Irustrations this tutorial it has been imagined.
Undoubtedly it is a little chancy to make simple a complicated system. It necessarily takes
to approaches. But that it cares the method iI when Iinishing these exercises, it is able to
manage the main Iunctions oI a home cockpit with the SIOC! Same when you has arrived
to that phase, it is much easier to go later on Ior itselI and to discover reIinements that we
won't try here.
Undoubtedly iI we have a Iriend that gets ready them with the SIOC, the best thing it is go
to visit him. That made with Guy Boullu and he explained to me the bases oI the system.
Guy, I really thank you your help and your patience.
They also can the clumsy ones to examine the programming Iiles SIOC (those. ssi) oI other
users, to compare them, to prove them that there is not risk some and it is very instructive.
Then, one will surely be able to conclude that, as Nico Kaan comments, it is possible to
begin a home cockpit directly with SIOC.
The onlv thing that is indispensable is to be logical. When we know what wants to get,
exactlv one can verv easilv to describe a function, to define all that is needed to act.
Therefore, to take that sheet of conditions to SIOC is quite easv. Good, also that supposes
to know the airplane that we want to simulate perfectlv.
SIOC and the IOCards cards
SIOC perIectly can work at the same time that a programming IOCard. ThereIore iI one
already has a home cockpit working with IOCard, it is not useIul to transIorm everything.
The landing gear will be able to be programmed with SIOC and the whole rest with
IOCard. Then, little bit to little bit, already you will change module by module.
The IOCards cards works with the Flight Simulator thru the FSUIPC protocol. The SIOC
can also use FSUIPC and those 'classic variables. But it can also use their own interIace
that we call IOCP or IOCP "protocol" and that it makes the same thing exactly that FSUIPC
and but quickly. Well, let us don't complicate the things that we are gone very well FSUIPC
to begin.
The programmers will notice that there is not a SIOC program for the whole cockpit but,
multiples programs one after another that thev work independentlv. That is verv practical
to test switch after switch.
While the svstem IOCard watches over, permanentlv and manv times per second, to all the
switches, encoders, potentiometers, etc.. connected to check if one of them has not
changed state from it finishes it time, SIOC, is for default, without acting. Alone it will act
if a new "event" happen. For example, a switch that we have fust closed. For this reason,
the SIOC is quicker and it consumes less resources than the IOCard.
Which programs that we should
install?
AIter having discharged Irom the OpenCockpits`s web (Download section) the last version
oI SIOC, everything is decompressed in the same Iolder that the rest oI IOCards. For
example: \Program Files/ IOCards. As all blended one is, we will create a shortcut in the
desktop Ior sioc.exe. you consents This way but easily to the useIul programs.
Let us take a quick look.
So that this is more conclusive, we pull up Iirst Flight Simulator. II other programs are
activated at the same time, as IOCards, or the card Encoder Keys, doesn't pass anything.
That they live their liIe!.
We execute %* now and it shows us the Iollowing window.


It is very clear. First we can see the version oI SIOC that we are using, here it is 3.2

IOCards Module: it indicates us that the parallel port not this connected one. This is
normal since we use the USB Expansion card. This card is correctly connected one
(running) and the device number is 7.
That strange it seems this! With the IOCard, the card takes the number 2048.... it is because
the SIOC numbers it otherwise, but it doesn't have importance. Also, iI we put in the
program 2048 instead oI 7 would also work.
The section FSUIPC Module, it conIirms us between other things that FSUIPC it is
working correctly.
At this moment we will leave the "IOCP". The IOCP can act as a "server" with "clients",
that is to say, among other things that the SIOC can work with several computers, without
using WideFS oI Peter Dowson.
The USB Devices window reminds us that I am using in my cockpit a USB Keys card and
also a USB Expansion card.
In the black square under is a very interesting thing:
C:\Program Files\IOCards\SIOC.ssi
The Iiles .ssi is the programming Iiles that the SIOC uses and that they go created by each
user Ior an airplane type.
II we take a look in C:\Program Files\Iocards, we will see that Iile indeed... that is empty.
It is only Ior iI it wanted to call their .ssi Iile as "sioc.ssi". For each change, coarse with
recording the previous one using the same name. But iI you preIer to call it .ssi
"miavion.ssi" it is very also. Also surely that they have noticed that when we have
decompressed the Iile numerous sioc.exe. ssi, as "ejemplodisplays.ssi", they have been
created. They are examples, nothing else. So that it is much easier to give with them, it can
be useIul to classiIy the numerous Iiles in C:\Program Files\IOCards Iolder by type.
Because all that incites us to take a look to the initialization Iile sioc.ini, always in the same
Iolder, C:\Program Files\IOCards.
This small text Iile should pick up which is the Iile. ssi that has to use. IT IS VERY
IMPORTANT.
Example:
|ConIiguration Iile|
CONFIGFILE \sioc.ssi
Observe the. \ beIore the name oI the Iile. ssi. II by chance, it changes the Iile name .ssi is
not to Iorget to modiIy the Iile sioc.ini to indicate him the new name .ssi that will have to
use.
By deIault, SIOC.exe opens up with the Iile .ssi recorded in the sioc.ini, and during its Iirst
use, it opens the Iile "sioc.ssi"
Also observe that that Iile .ini reIers equally to the classic IOCards, FSUIPC, etc. Gathers
several modules (but not all the possible modules)
Then, very logically, iI the SIOC uses at the same time that the IOCards, indicate, Ior
example, the number oI Master cards that go using. The other speciIications usually
correspond with what there is in the Iile iocards.ini iI we use the two systems
simultaneously.
For I Iinish, in the series oI bellboys, very practical, we have:
RELOAD: to use every time that we have recorded a modiIication in the Iile. ssi. it is so
that it is eIIective the new conIiguration in the Flight Simulator.
CONFIG calls to the Iichero.ssi pointed out in sioc.ini, to be able to work in the example.
In our case, iI we make click, we will see a warning "Blank File" since our sioc.ssi is at the
moment it emptied. Let us take advantage oI this visit to ConIig to select English or
Spanish in the Language menu.
IOCP Console opens to the operation controller that takes the same name. We will already
see it but late.
TRAY sends the window SIOC to the bar oI notiIications, to the right oI the taskbar.
EXIT indicates them the one on the way to the exit.
It notices. it is annoving to throw SIOC.exe to everv time that we pull up the Flight
Simulator. So that it rushes the coarse SIOC automaticallv with adding in
FS2004ModulesFSUIPC.ini the following section.
|Programs|
runiI1KILL,READY,C:\Program Files\IOCards\sioc.exe
First test with SIOC
For sure you are already impatient to see like it will be SIOC in your cockpit. Because we
will copy a program that it already exists and to test it. This exercise will allow us to see
like a text Iile oI programming can become a .ssi Iile that will be able to use SIOC.
Let us sav at once that this form of proceeding the thev use overalls the beginners. It is
copied and it is tested. But then when one manages it better, it is believed a file directlv .ssi,
without having to go bv the stage of the text. It will be this wav easier.
Here a tiny Iile that it calls himselI " prueba1 "

// *****************************************************************************
// * ConIigSIOC ver 3.2 - By Manolo Velez - www.opencockpits.com
// *****************************************************************************
// * FileName : essai1.txt
// * Date : 18/03/2006
Var 0400, Value 0 // Initialisation

V0401 0
}
Var 0401, Link FSUIPCINOUT, OIIset $0BDC, Length 4, Value 0 // Flaps control
Var 0402, Link IOCARDSW, Input 33 // Flaps Approach

IF V0402 0

V0401 8191
}
ELSE

V0401 0
}
}
Var 0403, Link IOCARDSW, Input 34 // Full Flaps

IF V0403 1

V0401 16383
}
ELSE

V0401 8191
}
}

Then we do in the screen a page with very strange things, it is a text Iile .ssi. It is a Ilaps
control here with three positions. Pulse the CTRLA to select it everything, and CTRLC
to copy. Make click in Start/All Programs/Accessories oI Windows and open the Notepad
and press CTRLV to copy this strange text.
Check an important thing well: when it is cared this way a .ssi Iile in text Iile, it can happen
that some lines are truncated: instead oI having a line like the one that continues.
Var 0401, Link FSUIPCINOUT, OIIset $0BDC, Longitud 4, Valor 0 // Mando de los Ilaps
We sometimes have, when there is not this way enough place, an inopportune line jump:
Var 0401, Link FSUIPCINOUT, OIIset $0BDC, Longitud 4, Valor 0 // Mando de los Ilaps,
tres grados de calaje para aviones de tipo Beech 200.
It is necessary to avoid absolutely this because iI a programming line begins with a thing
that is not a variable or the '// code, the SIOC takes it Ior a programming order to execute
and then it no longer understands anything. Then always it is necessary to check that the
lines are whole.
As our text Iile it doesn't seem bad, we will record calling him to it prueba1.txt in
C:\Program Iiles\IOCards.
In the SIOC window, we clic in the CONFIG button. The ConIigsioc opens with a blank
screen oI sioc.ssi Iile. We create other sioc.ssi Iile Irom our prueba1.txt. Iile.
Open the File menu a clic in Import TXT.



We select our 'Prueba1.txt Iile and anything but to make a click has two things: Iirst a
"compilation log":



We already see that the "compilation" that is the transIormation oI a text Iile in program, it
was made in three stages. It is always this way. And when this whole OK, one can see a
green OK that quiet us below. That means that everything has come out well. II, instead oI
the green OK, a red cross came out then it would mean, Ior example that we have Iorgotten
to copy a piece oI the prueba1 Iile and it can be that a key '} has disappeared, or that it
has happened an inopportune line jump. This usually happens oIten when we copy a
program piece oI somebody.
Note 1. We have seen that thechange of a text file in program (the "compilation") it was
made automaticallv. the COMPILE button of the ConfigSIOC menu, it has little utilitv.
Note 2. To create a program SIOC starting from a text is chancv. The computer specialist
make it blindlv, but those that are not sure messes are made among those {and those}... to
create a nuevo.ssi or to add him vou sew one existent, it is a lot but insurance to work
directlv in the page. ssi of ConfigSIOC. We will come this wav then in a svstematic wav.
Then, we close the compilation log that is no longer good us Ior anything pressing OK, and
now we see our text in the window oI SIOC, but in diIIerent Iorm: it has become a .ssi.


We have to get used to record it, as we will make it every time that we modiIy a Iichero.ssi
File to Record as, and oI name we use in the sioc.ini Iile that Irom now on will no longer
appear it emptied.
II they close and they open sioc.exe again, they will already see that the SIOC opens up
with the last Iichero.ssi that we have used. This is very comIortable.
Good, can we already test this .ssi in the FS?, No, still not because Ior sure in the
Mastercard the inputs numbers oI the switches oI the Ilaps oI their cockpits don't coincide
with those oI this Iichero.ssi.
In the line oI the variable 0402, we can see "Input 33". it is the input number in the
Mastercard. Then, it will be necessary to modiIy it and to put, Ior example, 'the 45 iI it is
that it corresponds to the number that you have chosen Ior your entrance.
We pulse then in the line oI the variable 402 to make this modiIication: then it shows us a
new very comIortable window that is the window oI the Parameters:



In the data box we have the input number that we have selected initially, the 33. We change
it and we put 45 now and we press OK. The subtree oI the variable 402 have disappeared. II
we want to see it again, coarse with making click in the ' that is beIore. In the menu to
SEE also can or to expand or to hide the screen.
Let us record this modiIication Iirst in the Iile sioc.ssi (File/Save) and let us press the button
RELOAD oI the SIOC to send the new data to the Flight Simulator.
In case the FS also works with the IOCards, we have to eliminate the command oI the Ilaps
oI the Iile. dat: we open ConIig IOCards, we call to the Iichero.dat oI the airplane and we
suppress the variable or 'oIIset, $08DC, as well as the inputs oI the switches and the
outputs oI LEDs iI there is. Because this way, there won't already be double task with the
SIOC.
In the FS, we work the lever oI the Ilaps: the Ilaps works with the three notchs grades.
Now we will use this program to examine it with all the details.
The SIOC variables, or IOCP
variables.
Linked Variables.
The Var400, Var401 etc. that we can see in our Iile. ssi are variables oI SIOC, deIined by
the user as he wants it. Those variable SIOC (or rather IOCP, used by the SIOC) they can
be linked with several things (oI there the word Link that very oIten returns):
- They can link to FSUIPC, that is to say that you can be requested so that works with the
Peter Dowson's listing. And that in several addresses: the variable SIOC will send an
inIormation to FSUIPC, (then beIore the variable there will be an icon "FS UIPC" that
set automatically) or he will receive an inIormation oI FSUIPC (icon "FS UIPC"), or it
will be clever to make the two actions that it is the most average case (icon "FS
UIPC")
Note. For not confusing the variables that it uses FSUIPC and the variables of the SIOC,
we will call to the first ones "offsets", and we will leave the word "variable" for those of the
SIOC.
- A SIOC variable can also go together to any physical element oI the IOCards: an
mastercard input or output, or a digit, or an additional card just as the Servos card, the
Stepper card, etc. In this case, is an icon green card beIore the variable.
- A SIOC variable can be together with an I modulate IOCP (icon " IOCP" (we will
already see it but it advances...)
- Finally, a SIOC variable can be linked. with anything, and then the change oI value oI
the variable in question won't aIIect to any I modulate. A variable that is not linked takes a
white square beIore: see you the variable Var 0400 oI our example.
As we can define a variable number?
The user can deIine 9999 numbers oI variables.
Since there is enough place between 0000 and 9999, we will create "categories" oI
variables, what allows to add easily new variables. For example, all that reIers to the
landing gear in the category 300, all that reIers to the Ilaps in the category 400, etc. II we
have used the numbers 400 at 405, it will be easy to choose and to add 406.

Variables: clasiIication.

Clasification example:

From
To
Category
0000
0299
Auto Pilot
0300
0399
Landing Gear
0400
0499
Flaps
0500
0599
Plane
0600
0699
Lights
0700
0799
Sound
0800
1099
COMMs, NAVs, ADFs, Transponder
1100
1199
Switches Audio
1200
1399
Visual and aural warnings
1400
1499
Engines
1500
1599
Fuel
1600
1699
Propellers
1700
1799
Overhead
1800
1899

1900
1999




2000
2099
Orders to USB Keys
3000
3200
Servos and Stepper variables

Some users as Manuel Jele:, has preferred to gather all the commands of oneself tvpe in
oneself categorv. Example.
000 to 299 .Offsets commands
300 a 399 . subrutine
400 a 499 . switches and pulses
500 a 599 . encoders
600 a 699 . 7 segments digits
700 a 799 . LEDs



Inicialization variable
The Iirst line oI our conIig example Ior the Ilaps is the Iollowing:


The white box beIore the number means that the 0400 variable is "not linked". we Already
know that we have deIined that a variable whose number is located between 400 and 499
reIers to the Ilaps. When throwing the sioc.exe, that variable 400 will have a value 0: that
calls you initialization.

All SIOC variables are defined in a fichero.ssi bv the name Jar with a figure from 0000 up
to 9999.
" it is a "attribute" of the variable. The value that continues is the initial value that
it should take the variable to the launching.
TheSIOC variable has 14 attributes, such as Link, Offset, etc.

So that the things are clear we have included a comment. This comment should go preceded
by '// so that SIOC doesn't take to the comment like a program piece. AIter the sign '//,
we can put what we want. It is not necessary to doubt to Irequently make comments
because that help a lot Ior the understanding.

As it indicates it the red arrow and the blue V, that variable has an immediate action on
another variable, the V0401. The signiIicance is the Iollowing one: "when the initialization
variable 400 have the value 0, the variable 401 will take the value 0".

In that sentence, there is a comma that indicates us that we pass from an idea to another.
Because the programming language also has its reasoning. And it is the same one. The onlv
thing that, instead of using the since comma, we change line and we displace the second
idea regarding the first one with a tabulation fump. Let us believe this wav an arborescence
with verv similar steps to that of the browser of Windows. When we have three ideas or
conditions to expose, we will have three lines and three steps... When we read a program
piece again (o"script") it is verv important to check correctlv that the conditions are
chained following a logical order, and that the third finish of the reasoning it is correctlv
related with the second, and not with the first one for example.
This initialization has been made in two stages, Iirst the variable 400 and then the variable
401. Logical since the initialization variables are not linked.
As V0401 it is the SIOC variable together to the FSUIPC variable oI the Ilaps, that means
clear that when throwing the SIOC, the Ilaps will put on to 0, or Flaps UP, although the
initial situation was recorded with the Ilaps to halI oI its journey.
Nota. SomeSIOC users put meetings, at the beginning of the program, some after the other
ones, all the initiali:ation variables. It seems more logical, and mavbe be but sure, to put
the initiali:ation of the flaps in the command group of the flaps, the initiali:ation of the
landing gear in that of the landing gear, etc.
Using in way systematic initialization variables allows that the cockpit always starts in the
same state. The things will be clearer (although it is a "cold and dark").

FSUIPC Linked Variables
The second variable oI our Iile .ssi example deIines the point on which we want to act in
the Flight Simulator.



We have denominated it Var 0401, it is logical since that it is the one that we will request
exactly aIter the initialization.
Then we see the indication Link FSUIPCINOUT, what means that it goes together to
FSUIPC, in both directions, later OIIset $0BDC, Longitude 4 mean that we will act in the
oIIset whose address is 0BDC oI Peter Dowson`s list and it has a longitude oI 4 bytes,
Value 0 it means that we don't assign him a value peculiar to the beginning (oI that it takes
charge the initialization). we Iinally have our comment '// Flaps Control. One could also
have written "Ilaps Control"...

That way has been introduced all those characteristics when creating our file. ssi?

In the SIOC.exe window, make a double click in the line oI the variable 401. That goes to
make that the window that was good to create this variable line opens up:


What we see in the Iirst place is the data oI the variable SIOC (VAR SIOC DATA)
FSUIPC In/Out had been selected in the links with the green bottom. The number oI
variable 401 or 0401 has introduced it the user that has also created the Iile, the initial
value.
Under, the remote VAR LINKED DATA that would appear oI gray iI was a not linked
variable, it indicates the FSUIPC oIIset and its longitude that we have taken out oI the Peter
Dowson`s list . And nothing else at the moment.
As example, try to introduce an additional, completely unreal variable here, the $02C8 oI
longitude 4 that it is usually used Ior the vertical speed.
For that, in the window sioc.exe, make click in the 'Edit menu and a New Var. square
has been created Ior an icon, as well as a black bar. Pulse in one or in the other one so that
the window parameters comes out. Link select To: FSUIPC IN/OUT (double click in the
box) Gives to their variable the I number 405, in the description it writes "Test", and put
$02C8 (note do not Iorgetting the $ sign), and longitude 4 in the section oI under. Very
well, their new variable has already been created.
At the moment, conserve that capricious variable.
Read: a variable linked to IOCards,
with IF and ELSE conditions.
The lines that continue next are very interesting:



Now because it has to recognize the SIOC the three positions rotary switch oI the Ilaps that
is connected in the inputs 33 and 34 oI the Mastercard.
For that anything as creating a new variable SIOC, Ior connected the switch to the input 33.
That variable that we have denominated 0402, is linked with IOCards, then we have
selected Switches in the links menu and we have put 33 in the INs/Outs/# box. Then click
in the line Var 0402 to see the window parameters.
The lines that come next should be read this way:
"If` the =0402 variable have a 0 value, (that is to sav if the switch is open), then the =0401
variable (the $0BDC) it should take the value 8191". That corresponds to the $0BDC value
when the Ilaps (in a Beech 200) they are in intermediary position "Approach."
In other words, and to be clear, the switch in the #33 input that it is three position rotary
switch, in the Ilaps up position, because when this switch is open, that is to say that the
flaps lever is or in the Approach position or in the extended Flaps position, the Ilaps puts
on in position Approach, value 8191. Then, as soon as the lever oI the Ilaps oI the position
Flaps UP is changed to the Iollowing position, Approach, the oIIset 0BDC takes the value
8191.
The next line deIines what happens then when that switch is closed (lever oI the Ilaps in the
UP position):
"ELSE the #0401 variable should take the value 0 ", that is to say Ilaps Up.
OI course when the lever oI the Ilaps is in position Full extended Flaps ", the switch that is
connected to the #34 input will be closed:



This read as: "the variable 0403, is linked to a switch that it is connected to the=34 input of
the Master card (Full Flaps position) ",
that variable 0403 have a value 1 that the switch is closed, the variable 0401 ($0BDC)
has a value of 16383 (extended flaps), otherwise (), if the switch is open, the variable
0401 will have to take the value 8191 (position Approach or Flaps UP)"
When using IF and ELSE, it is avoided him to be deIined a third variable expressly Ior the
position Approach.

Write: a landing gear command with
IF and ELSE
This example will allow us to review the important notions that we have outlined
previously, and also to add the command oI the indication LEDs.
We won't begin with the initialization variable (that will call Var 0300).
First we will create the main variable oI command oI the landing gear lever (the oIIset oI
the P. Dowson list). Like it is a variable that was in the category 0300 that it is the one that
assign to the landing gear, it is logical to put it beIore the variable oI the category 400 oI the
Ilaps. Then, we will select the Iirst line oI nuestro.ssi and we will make click in Edit/Insert
Var.

Then double click in the Edit/insert Var icon, to select in Link: Fsuipc In/Out, Var #: 0301,
Description: Landing Gear Command, Initial Value: 0, and under, VAR LINKED DATA,
$0BE8, length: 4 Ior the oIIset oI Landing gear command. OK
We insert a new initialization variable now above the variable 0301:
Edit/Insert Var, to add a new variable above the one that this selected. A double click in the
icon square, select: NOT LINKED, Variable # 300, Description "initialization oI the
Landing gear", OK
The Var 0300 line being selected, Edit, New Command, double click in the icon square,
and in the window oI the parameters, Command Type: Assign to assign an action, and in
the Assign box, Var: select in the box V0301 that we have just created it and to give him a
value 16383 that it corresponds to the value oI the oIIset $0BE8 when the landing gear is
extended. We are this way sure that when we pull up the MSFS and the SIOC, the landing
gear will be extended.
These are the lines that should be:



Now, we deIine the SIOC variables Ior the Iollowing Iunctions:
- Light on a red LED when landing gear is in transit,
- Light on a green LED when nose landing gear is down and locked,
- Light on a green LED when leIt main landing gear is down and locked,
- Light on a green LED when right main landing gear is down and locked,
and, oI course
- Ior assign a variable to the switch oI the landing gear handle
We will create Iour new variables then, and LEDs commands should like, those variables
will go together to the outputs oI the OUT oI the master card: Link to: IOCard Output.
The last variable goes together with a switch. Then we will select Link to: IOCard
Switches.
It gives us the Iollowing thing:


First, we work with the #306 variable, the landing gear handle.
What do we want? So that it is clearer anything better than the Iollowing presentation:
In simple lenguage
translate
II
IF
The landing gear switch is closed,
V03061
The $0BE8 oIIset will be 16383 (Gear extended),
V030116383
Otherwise
ELSE
The $0BE8 oIIset will be 0 (gear retracted)
V03010
Then with SIOC, (caution with the clicks!)
1 select thevariable Var 0306 line
2 press the right button and select New Command, and a new icon already appears with
line oI points inIorms us that the condition that we will be indicated reIers to the variable
V306.
3 double leIt click in the icon and the window parameters appears:


4 In this window, in the 'Type box, select CONDITION IF, and in the line CONDITION,
in the Iirst box, make click in V0306, in the second box, and Iinally, in the third box, type
1 and OK.
This is the first condition "if the landing gear switch is closed"
5 select this new line "IF V03061" and make &*4$ click: now a new icon, and the tree
appears with line oI points it indicates this time that what we will be added reIers to the line
IF V03061 (it is important to check it), and not to the line oI the variable V0306 Ior
example.
6 double click in the icon, and select in Type: ASSIGN and in the ASSIGN box, the
V0301 take and indicate later 16383
We have written then if the landing gear switch is open, the $ 0BE8 offset will be 16383
Now we have to put the second ELSE condition: This condition this related with the #0306
variable, the same as it was he the condition IF. It is logical: iI, otherwise.
7 select the line oI the #0306 variable again and make a &*4$ click: a square oI new
icon appears, and the tree with line oI points indicates us that it goes together with the
#0306 variable.
8 double click in the icon, and select in the parameters CONDITION ELSE. With the
parameter ELSE you cannot select any stall oI the window. Then we press OK.
9 &*4$ click in ELSE and a new icon square appears, related with ELSE
10 double click and select Type: ASSIGN, select the V0301 Irom the list and give him the
value 0.
We have written the second part of the sentence "otherwise the $0BE8 oIIset will be 0."
This reasoning type that voluntarily have detailed much here, we will already get used to
him and the programming will be then very quick



Nota . Thev will have reali:ed that in the parameters windows, thev are verv well thought
the things, when a condition refers to a variable the list of all the variables created in its.
ssi appears in a pop-up menu making click. The same thing for the or ~ signs.
On the other hand, in the following box, there where we should write 1, or 0 or anv
numeric value, of course we will have to tvpe it us, The SIOC cannot guess it... The
prepared values, L0, L1, C1 etc. will Alreadv use later on them

Save those changes in the .ssi and check that landing gear command in the Flight
Simulator, when they have suppressed the variable $0BE8 and the corresponding switch in
ConIig IOCards iI they use the traditional IOCards soItware jointly.


Three conditions IF and ELSE
The previous example, that oI the landing gear lever, was quite simple. The landing gear is
retracted or extended. Alone it had been attributed a condition IF and ELSE to the variable.
We have already prepared previously the #0302 up to #0305 variables regarding the LEDs
oI announcement oI the landing gear position. Now we will use them.
Flight Simulator uses several variables regarding the landing gear:

- $0BE8 that we have examined previously is the landing gear command Ior iI same, and it
corresponds to the switch that it goes included in the landing gear lever. With the SIOC
then will have a couple oI very linked variables: the variable " x " Ior 0BE8, and also the
variable 'y Ior his switch.

- but the Flight Simulator also has three variables to indicate the gear position: $0BEC Ior
the nose landing gear, $0BF0 Ior right main landing gear, and $0BF4 Ior the leIt.

The objective is to light up or to turn oII LEDs to indicate the position oI the three landing
gears, we will create again even oI variables. This time among the oIIsets they show us the
landing gear position on one hand, inIormation that provides the FS, and the LEDs
connected to the Outputs oI the Master card.
We have already created the #0303 up to #0305 variables linked to an output oI the Master.
We lack to create the variables linked to the positions OIIsets. Taking advantage oI the
occasion to add a variable that will indicate us iI the landing gear is in transit, variable that
it will go connected to a red LED but whose alone state will be determined by the state oI
the other variables.
We have:
Var 0310 position oI the nose landing gear ($0BEC) Var 0303 green LED oI the nose
landing gear , acting in the variable Var 0302 oI the transit.
Var 0320 position oI the right landing gear ($0BF0) Var 0304 green LED oI the right
landing gear , acting in the variable Var 0302 oI the transit.
Var 0330 position oI the leIt landing gear ($0BF4) Var 0305 green LED oI the leIt
landing gear , acting in the variable Var 0302 oI the transit.

DeIinition oI we like:
In simple language
translate
II IF

Gear is extended, V031016383

The master Output is ON, V03031

And the transit LED is OFF, V3020

else: ELSE

II IF



The gear position is bigger V0310~1
or equally to 1
(The gear is between 0
retracted and 16383 extended)

The master Output is OFF V03030

And the transit LED is ON V03021

Else, ELSE

II IF

The nose landing gear is retracted V03100

The master output is OFF V03030

And the transit LED is OFF V03020
Total three IF conditions. For that reason it moves the subtree every time that a new
condition is showed.
In the chart here up have materialized it with a change oI columns. First we will create the
#0310 variable Ior $0BEC, noticing that it is oI course in this case oI a variable linked to
FSUIPC, but alone with input (Link To: FSUIPC In) since the variable receives data oI
FSUIPC, but it doesn't send him.
Also notice that to add several attributions (Assign) Iollowed, coarse with making several
times right click on the condition IF, and with selecting the necessary ASSIGN. Here the
.ssi Iile:



See you especially the displacement oI the subtrees to every time that we pass to the
Iollowing condition. Also, in the event oI error, the SIOC would not keep in mind the new
parameters.
Save this new sioc.ssi and test it in the FS (pressing RELOAD) iI the FS is already being
executed. It is magic!
Jariant. we can also sav things like. "IF the batterv switch is ON, and IF the engine 1is
running, and IF the generator 1 is OFF, THEN the batterv load alarm is ON. Thev are then
three IF for alone an assignment, and to write it is necessarv to move toward the right for
each condition.
Nota. it is not strictlv obligatorv to put the condition ELSE after IF, we can sometimes pass
without it.

DELAY Function

When we have assigned a "Type" to a parameter, Ior example the IF CONDITION or the
ELSE CONDITION, because we select this conditions in the parameters menu / Type. We
can also select FUNCTION. And when selecting it the right box it was activated
'Iunction. we will be able to observe such things as DELAY, ROUND, TESTBIT, etc.
will Already examine Iurther on the most important Iunctions. Let us take a Iirst example:
DELAY

The objective oI that Iunction it is to introduce certain delay in the execution oI a variable.
Let us take the example oI the landing gear again. In normal time, and although we use
three variables to indicate the gear position, that made above, the three green leds lights
almost at the same time. Because it will be more realistic to oIIer that there is a diIIerence
among each light on.
Let us don't play the #0310 variable ($0BEC), which gives us the nose gear position. As we
saw above, that variable goes together to a output variable, the #0303 that it lights the green
led 'Nose landing gear extended, we will oIIer that the #0304 variable which lights the
green led oI the right landing gear takes a delay oI 0,4 second.
We go to our .ssi Iile and we make double click in the line V3041. The window oI
parameters oI that variable comes out:



In the Command Type box, we deploy the menu and instead oI ASSIGN, we select
FUNCTION: the Function box in the right is active one. We choose in the list the DELAY
Iuncition. Now the FUNCTION / CALL box will be active. In VAR: we indicate the
variable number that we want to temporize, in this case V304.
In the Iollowing box, be not in charge oI oI the popup menu, put the Iirst parameter oI the
Iunction that is 1, since we want that the variable V304 has the value 1 to light up the LED.
In the second box, we put the the delay time that we want, in hundredth oI seconds. II they
want a delay oI 1 second, type 100, we want a delay oI 0,4 second, we type 40 then. OK.

Now on our line V304 will be the Iollowing one:


Make the same thing Ior the #0305 variable oI the leIt landing gear, giving him a delay oI
1,2 seconds. We will already give later on with many more Iunctions, in the course oI our
tutorial Ior the SIOC.

Who does command?

OIten conditions are observed something by the style:
IF var x 1 -~ var and 1
IF var x 0 -~ var and 0
To simpliIy the things in a very simple way to assign the Iollowing condition:
var x var y
At Iirst sight, we can think that iI we write var y var x will happen the same thing.
Because it is not this way. Because it is always necessary to wonder "who commands" in
the couple oI variables.
Let us take a simple example, Flight Director command. We can write this way it:

One can also write this way:


And it works well. On the other hand iI we write V0206 V0200, didn't work because the
command Var 0200 can command it the switch V0206, but the variable V0200 is not able
to command the value oI the switch V0206. Easy truth?
For general rule, the switches command the oIIset, and later, the oIIset commands the LED
oI conIirmation

The IOCP Console
Up to now visualize the result oI our tests directly in the Flight Simulator. PerIect when it is
to check the landing gear operation. On the other hand, there are much more complex cases
and in this cases what happens don't leave.
Because we have a good tool to look what happens insite the FS: The IOCP console.
Start the Flight Simulator, and in the main window oI the SIOC, press the IOCPCONSOLE
button.
The Iollowing window opens up:



Open the Files menu, make click in Import SIOC File and select your .ssi Iile. they Make
click in the CONNECT button. Go down in the list until the Iirst variables that have
created:


We can see that the #0401 variable, that it is the Ilap position, have a decimal value oI
8191. It is Ilaps approach position. Plus below we observe that the #0404, LED to see the
position oI the Ilaps, has a value 0. oI course, iI we move the Ilap lever, those values will
change. They can also make click in LOG ON and they will see all that is passing in their
FS (it is very practical to see anomalies that are come with the eyes).
We will stop Ior see in the "Binary Value" column, that this have a lot oI 0 and 1.
We already know that the Flight Simulator oIIsets, those oI Peter's Dowson list, has a
"lenght" oI 1, 2 or 4.
This number is the bvtes oI the variable. A byte is as iI we said a word that consists oI 8
characters, the bits.
The Binary Value column takes Ior deIect 32 zeros, that is the maximum numbers oI bits
that FS variable can be have, since the biggest have 4 bytes oI 8 bits, that is to say 32 bits.
When a variable, or oIIset, has two bytes, it`s the binary value is announced with 8
characters, beginning with the right. It is necessary to read them from right to left. The bits
oI the bytes can be numbered, but the Iirst bit, the more to the right, it takes the number 0.
thereIore a variable oI two bytes will have the Iollowing Iorm:
00000000 00000000
And those 16 bits oI the two bytes took the numbers:
15, 14, 13, 12, 11, 10, 9, 8, and 7, 6, 5, 4, 3, 2, 1, 0
All this to tell them that the variables called "booleanas" that alone they have two possible
states, Open or Closed, or 0 or 1 conIorm to with alone a bit. When we light up a LED, the
binary value is changed Irom 0 to 1, nothing else.
The things are more complicated when it is to show the binary value oI 8191 as the Ilaps in
Approach position. Look the numbers 0s and 1s. As the oIIset oI the Ilaps, $0BDC has a
length oI 4 bytes, that is to say 32 bits, in Iact it is the complete line oI 0 and 1 that
indicates the binary value oI this oIIset in that moment.
Even more interesting: in the Flight Simulator you can modiIy the oIIset value changing
directly a bit.
For example, the $0D0C oIIset calls "lights". It is a generic name. II we change him the
value oI their #2 bit, so that it passes Irom 0 to 1 the landing lights light. II we change the
#0 bit, the Navegation lights will light up, etc.
A new SIOC variable can be create, using the $3300 oIIset that it is the LOC, NAV or
Glide intercept. Insert that oIIset in their .ssi Iile, put the airplane so that an ILS it
intercepts, leave it, and look as the decimal and binary values they will change when the
LOC is captured. They will already see that alone a bit changes when the LOC, the bit n8
is intercepted. When the since Glide the bit n has been intercepted 9 oI that same variable
it is the one that is changed 0 at 1.
All this incites us to discover a new Iunction: TESTBIT.
TESTBIT Function
This Iunction will checked the bit state oI a variable permanently. II it change, a command
will be executed.
For example, iI we look with TESTBIT the #9 bit oI the $3300 variable, it won't happen
anything until a Glideslope does intercept by the plane operating with the A.P.. II it
happens such a thing, the value oI the #9 bit it passes Irom 0 to 1, and then we can use this
Ior light on a LED "Intercepted Glide."
To place a Iunction TESTBIT, oI course we have that:
- to have created the variable that we want to watch over,
- to have created the variable that will be modiIied, Ior example the variable together to
FSUIPC Output, the one that will have to light a LED,
- to deIine a Iunction TESTBIT in the commands of the first variable, indicating in the Iirst
place then in the parameters the variable that it is necessary to modiIy, the variable that it is
necessary to examine, and Iinally the bit that it is necessary to watch over.
This is the window oI the parameters

And the .ssi Iile the Iollowing:


SETBIT, CLEARBIT and
CHANGEBIT Iunctions
These Iunctions allow to modiIy the bit state to get a certain command, and inversely to
cancel that modiIication to return to the previous state.
Example already mentioned:
We will put a SETBIT to the $0D0C variable, "Lights" bit #2 to light on the landing lights,
and a CLEARBIT on the same bit to turn oII them.
Here, it will be the variable oI the switch the one that will take a condition IF with SETBIT
and an ELSE with CLEARBIT:



T he CHANGEBIT function changes the value of a bit in it linked variable. CHANGEBIT N
makes the same thing, on the contrarv.
Local variables
They are temporary variables that are very comIortable to simpliIy the writing.
It oIten happens that a variable is similar to another variable a Iixed value (Iormer:
V508V509 1000) or be oI an I calculate but or less complex.
For example, the $07D4 oIIset measures to each instant the plane altitude. Its value Ior
itselI doesn't mean anything. II we want to get the altitude in Ieet, it is necessary to divide
the value oI that variable Ior 19975.433 (Peter Dowson tells it in his listing) Supposing that
we want to use $07D4 (our SIOC variable #0520) to activate an alarm with sound when it
is the altitude oI the airplane oI or - 1000 Ieet regarding the altitude requested in the
selector oI altitude.
We will have to deIine intermediary variables with a deIinition:
II the #0520 variable divided by 19975.433 1000 Ieet are similar to the value oI the
variable oI reading oI the altimeter, then a sound will be emitted.
You can simpliIy that writing thoroughly deIining a local variable. We will say once and
Ior all Ior all that the local variable L0V0520/19975.433 (L0 is L "zero", because the
Iollowing one calls you L1, etc. until L2)
The deIinitions oI intermediary variables are easy:
V0507L0
V0508L0 1000
V0509L0 - 1000 etc.
As soon as a calculation happens and it repeats, a local variable simpliIies the things.
Those alone local variables are been worth inside oneselI script (group oI commands, or
programming subgroup, among a and a} in text, executed when the variable changes
value).
The local variables can have a numeric, decimal or whole, positive or negative value. In
this case we will call them L0, L1 and L2, because alone there are three to our disposition.
They can also have or that it calls himselI a "boolean" value that is to say 1 or 0, TRUE or
FALSE. In that case we will call them C0, C1 and C2. Undoubtedly the local variables 'C
will oIten correspond to a variable oI a switch, with value 0 or 1.
They can also combine the local variables L with the C in oneselI Iormula

Subroutines
This is seemed a little to the topic that we have already exposed: that oI the temporary
variables. The subroutines allow to simpliIy the repetitive conditions. We will take the
example oI the three green LEDs that they indicate us the landing gear position. They have
a deIect that is annoying: they still light on when the switch oI the battery is oII. That
because the script that corresponds him is independent and it doesn't have to do anything
with that oI the switch oI the battery. We will have to link them, and to say that iI the
battery switch is OFF, the LEDs are OFF too. Then we will add to the program Switches
and LEDs oI the landing gear variable that will have a Iunction "SUBROUTINE". The
process is the Iollowing one:
1 Create the subroutine. It is a new variable. So we open Edit /Insert Var., In Link To: we
select SIOC SUBROUTINE, beIore the variable, in the. ssi, will have a yellow icon.



2 DeIine the commands and parameters oI this new variable: it is to say that iI the battery
switch is ON, the LEDs oI the landing gear #303, #304 and #305 are lit, and inversely:


3 Who it commands that it lights or not a diode oI the landing gear? Because the "Landing
Gear Position" variable, Ior example $0BEC Ior the nose gear. Then we will add to the
commands oI that variable a CALL instruction, saying it that it calls to the variable that has
our small subroutine program. In the box FUNCTION /CALL the list oI created
subroutines appears.


And, in the .ssi:



4 Finally, we will also add a CALL in the variable oI the battery switch, linking to the
landing gear LEDS subroutine.



From now, the LEDs oI the landing gear will depend on the battery switch position.
We add a CALL command of theLEDs of the left and right gears, but as those LEDs thev go
together in the commands of the subroutine, it is not indispensable.
A subroutine being a little independent program, it Irequently happens that it calls himselI
to the subroutine variable in several scripts.
Logic operators
In the deIinitions commands page, IF, ELSE and other, the conditions take "logical
operators ", the most average being "

The other operators can be:
5
add oI two variables or constant
6
susbtract oI two variables or constant
7
multiply oI two variables or constant
8
divide oI two variables or constant
()
Logic operation or condition AND
&
Condition OR
9
condition iI bigger
:
condition iI smaller
;
Condition iI equally
9;
condition iI bigger or equally
:;
condition iI smaller or equally
:9
condition "iI not equally"

Encoders
The command line is almost the same one that that oI the traditional IOCards:
Var 0607, Link IOCARDENCODER, Input 86, Acceleration 6 // HDG
ThereIore: the variable deIinition will act as an encoder and don't as switch, Iirst input in
the Master: 86, acceleration according to the encoder type to get that it rotates gently.
then single lack to deIine the conditions oI operation oI the encoder, for example:
L0 V0607 * 1
V0620 V0620 L0
In the Iorum oI the SIOC oI OpenCockpits there are several use examples
Analog inputs
We will deIine the positions 0, center and maximum oI the potentiometer that we will use.
Example:
Var 1100, Link IOCARDANALOGIC, Input #1, PosL 0, PosC 127, PosR 255,
That is to say that the #1100 variable go controlled by a potentiometer connected in the
analog input #1 oI the USB Expansion Card. The potentiometer travel goes divide in 255
"position". The potentiometer will take the Iollowing calibration: their value 0 Ohms will
be the leIt position, it is the maximun value in ohms (10 Kiloohms) it will be the extreme
position 255, and iI we want that its variation curve is lineal, its halI position will
correspond at 255/2, that is to say 127.
Here thev have a verv good example of Guv Boullu that shows them what one can make
with an analog input of throttle (variable $088C) to create a Reverse position but
conserving an normal throttle adfustment from idle to full.
Var 1100, Link IOCARDANALOGIC, Input #1, PosL 0, PosC 127, PosR 255 //
THROTTLE1

IF V1100 40

V1102 -4096 // Passage en Reverse
}
IF V1100 ~ 50

L0 V1100 - 50 // 50 / 255 devient 0 / 205
V1102 L0 * 79.91 // 16383 / 205 79.91
}
}
Var 1102, Link FSUIPCOUT, OIIset $088C, Length 2 // N1 du moteur 1 (varie de -4096 a
16383)
We can see that, usually the potentiometer travel oI 0 up to 10 kilohms goes oI 0 up to 255
(Iirst line).
The $088C variable has to take the value -4096 to deploy the reverse.
When the potentiometer this almost in the idle (their position is then at 40 or less in the
range 0 up to 255, the variable takes the value -4096, the reverse will be active in that
engine.
On the other hand, iI the potentiometer has a position more bigger oI 50, in this case we
subtract the value 50 to the variable position oI the potentiometer. ThereIore their value
passes Irom 50 to 0, the idle position will be displaced then oI 50 steps, the 0 jump to the
position 50.
We use a local variable L0, to simpliIy that small calculates, oI there the line L0 V1100-
50.
As we also subtract the value 50 to the high position, the Iull throttle position will be 255-
50205, that doesn't care, coarse with declaring this way it.
That it has been oI the variable 1102 whose value Irom idle to Iull throttle change Irom 0
up to 16383?
As it commands it a potentiometer with a range oI 0 up to 205, consequently each "I
happen" it will be 16383 divided by 205, that is to say 79.91, and multiplied by the value
that corresponds to the current position oI the potentiometer, oI there: V1102L0 * 79.91
Axial we have a true idle while we conserve the reverse ones.
Displays
SIOC allows us to show the variable value in the 7 segments displays. It can be a radio
Irequency, Heading, Iuel quantity, barometric pressure, etc.
Naturally, we will linked a variable to show the inIormation to the Display II multiplexada
card, and then we will select Link To: IOCARDDISPLAY.
We will indicate the necessary digits quantity to show the inIormation. II we put 3 Ior
example, that will mean that we will use a display with 3 numbers, as heading. It can
sometimes be that that number goes preceded by the sign -, in such a case, it will be
necessary oI course to Ioresee a supplementary display (Ior example in the case oI the
vertical speed).
The variables that show inIormations can take values "special" sometimes very useIul:
Value - 999999 turn oII all digits
Value - 999998 all digits show the "-" sign
Value - 999997 all digits show "6"
Value - 999996 all digits show "t"
Value - 999995 all digits show "d"
Value - 999994 all digits show ""
There are a lot oI examples oI use oI the displays in the SIOC Iorum oI OpenCockpits.
Note. we can save outputs of the Displavs card noticing that the` 1` of the radio
frequencies (former. 118.60) thev are fixed, it is well known. Thev can be connected
directlv to the feeding with a resistance (sees vou the tutorial "IOCards step to step"). The
inconvenience is that thev are too luminous and when it fades the displav, thev follow turn
on. A possible solution is to connect the segments that are LEDs, to an or several exits J2
of the Master card, being careful that 20 MA doesnt exceed for each output. The variable
that commands the sample of information can also command that thev light and the LEDs
fade.
Another possibilitv to save. in the case of the altitudes, equallv we can return fixed in a
same wav the last two :eros of the altitude. Alone thev will be enough 3outputs in the
Displav card instead of 5. Even better, for the electronic ones, thev can recover the signs
high level of the multiplex of a digit to activate a logical door that commanded in output to
all the fixed segments. With that false multiplex, all the digits will have the same brightness.
Sounds
A SIOC variable can activate a sound that a variable is linked to a switch ("Fasten Seat
Belts") or a variable activated by other variable or Ior an mathematical calculate (Ior
example a sound alarm when the altitude oI the plane reaches to or - 1000 Ieet oI the
altitude selected in the Altitude Select).
The sounds Iiles can be any .wav Iile, doesn't have anything to do with FSUIPC neither
with the sounds Iiles oI the airplane in the FS. Coarse to place the Iiles that they are in the
same Iolder that IOCSound.exe, IOCSound.ini and the SIOC Iiles. The simplest thing is to
place everything in Program Files/IOCards.
We have downloaded the IOCSound module Irom the Opencockpits web, and we have
placed it in the same Iolder that all the other oI IOCards. The IOCSound.ini Iile is the
Iollowing:
| Iichero de conIiguracion para IOCSound |
| ConIiguration Iile Ior IOCSound |
| IP del HOST del servidor |
| IOCP server host name |
IOCPhostlocalhost
| Puerto de envio del protocolo IOCP |
| IOCP port |
IOCPport8092
| Tiempo de respuesta maximo de los paquetes IOCP |
| IOCP Timeout |
IOCPtimeout4000
| Asignaciones de Variables IOCP. Primera variable usada |
| IOCP Variable. First variable used |
IOCPINIVAR
| Ficheros de sonido Maximo 200 sonidos|
| Sound Files Max. 200 sounds|
| #1 |
SoundAPDis.wav
| #2 |
Soundoutermk.wav
| End oI File |
The Iirst thing that we should make it is to deIine a Iirst variable (IOCPINIVAR ....
line) Ior the sounds variable, we will begin our sounds Ior example with the #701 variable.
It is necessary to choose a number oI variable smaller to 1000, and to be leIt margin,
because to each sound variable it will correspond him a Iile to execute. It can have 200
variables as maximum, and those variables numbers have to be continued. The "sound"
variable it can be a variable NOT LINKED, with initial value 0.
See next that simple it is:



The command oI this #701 variable, what start the sound, can go included in the script oI a
variable command oI (the one that takes $****), or in a switch variable (when we have a, it
is preIerable). Finally, caution, when we have a IF command to send a sound, it is also
necessary to put an ELSE, otherwise it will work once but not two.
At the end oI the IOCSound.ini Iile, we deIine the .Wav Iiles that it is necessary to open, in
this case the #1 sound that activated it the #701 variable it is the APDisc.wav. Then it will
be necessary to change |#1| Ior the variable number: |#701|
The #2 sound, outermk.wav activated it the variable 0702 and so Iorth. it will appear this
way:
| Iichero de conIiguracion para IOCSound |
| ConIiguration Iile Ior IOCSound |
| IP del HOST del servidor |
| IOCP server host name |
IOCPhostlocalhost
| Puerto de envio del protocolo IOCP |
| IOCP port |
IOCPport8092
| Tiempo de respuesta maximo de los paquetes IOCP |
| IOCP Timeout |
IOCPtimeout4000
| Asignaciones de Variables IOCP. Primera variable usada |
| IOCP Variable. First variable used |
IOCPINIVAR701
| Ficheros de sonido Maximo 20 sonidos|
| Sound Files Max. 20 sounds|
| #701 |
SoundAPDis.wav
| #702 |
Soundnaltcap.wav
| #703 |
Soundnchime.wav
| End oI File |
CAUTION. it is indispensable to also modifv the Sioc.ini file in the "Sound Module"
section, that should reproduce the variable selection and files that we made in Sound.ini
exactlv
When we have modified something in those two files, when being using the FS, it is
necessarv to interrupt the Sound.exe file, and to pull up him again so that this it works
correctlv.
If fust in case there is an anomalv in the .ini files, if that we will be able to hear a sound
when making the tests, but it was... of 'the error` sound of Windows.
It seems not very probable that reached up to 200 sounds Iiles, surely that a group oI 100
variables is enough, although we have a GPWS or a virtual co-pilot with the SIOC.
Since all this correct one, we open the IOCSound.exe Iile , through the shortcut in the desk,
or in an automatic way with FSUIPC (option "run" oI FSUIPC.ini).
When alone there is a computer that Ior this reason will be the IOCP server, the active port
is the 8092 (it checks that it is the same one that that oI the .ini Iile).
A glance to the cover oI the SIOC shows us that in IOCPServer there is 1 connected client,
the other modules are "disabled". IOCSound the Status indicates us: Online.
The .ssi Iile then will be able to take commands oI the style:
IF the switch V192 "ON-OFF" oI the autopilot it is to 0, then the variable sound V701 is 1,
that star the "APDisc.wav" sound, ELSE V701 0
Others Iunctions (Ior advance users)
TRUNC: When the variable value is the result oI a calculation, as
V0001V0002*(100/16384), the result doesn't come out rounded in the Flight Simulator so
that it can show it a gauge, but "truncated", that is to say shortened: 15,780 won't be treated
as 15,8 neither 16, but 15. When it is obligatory to be him in that way, the parameter
TRUNC is used. For example, V0003TRUNC L0
This Iunction is specially important when it is to show a value in a 7 segments display.
ROUND: contrary to TRUNC, this Iunction rounds the value Irom a calculation to the next
integer, without decimals.
NOT: change the value Irom 0 or 1 oI a boolean variable putting the opposite value oI the
parameter 1.
FROM BCD convert to decimal value a binary value. TO BCD make the contrary.
TIMER: it activates events depending on a deIinable time. The variable will have the
Iollowing Iorm:
VAR 0001 TIMER 3,1,10
The Iirst parameter, here 3, it means that the operation is executed 3 times. It can repeat the
number oI times that we want, iI we want that it repeats to the inIinite, we will put 9999.
The second parameter indicates the value that should take the variable, here it should pass
to the value 1.
The third parameter indicates in tenth oI seconds the lapse that lapses among each step
Irom the variable to the value 1. II this variable corresponds to turn on a LED, this it will
light a moment, three Iollowed times, every second
ROTATE: increase or decrease the variable value. It allows to simpliIy the programming
oI the encoders.
TOGGLE: change to 1 to 0, or viceversa, a bit value oI a variable.
ABS: assign to the variable a absolute value.
LIMIT: increase or decrease a variable value between two limits.
DIV: makes the whole division oI two numbers.
MOD: it calculates the module, or subtract oI the division oI two numbers, indicated in
parameters 1 and 2.
Conclusion
This brieI tutorial gives an idea oI the SIOC possibilities. With these inIormation, it will be
quite easy to create complex commands, impossible to carry out with the IOCards program.
The SIOC is an extraordinarily potent tool, with a total stability. It is not strange that it is
using more and more, and not only Ior proIessional programmers.
The IOCards and the SIOC program are without a doubt some two due very big
advances to Manuel Vlez. We thank to him very much to have put free in way these
tools to the cockpits makers, and to continue very often improving them

Вам также может понравиться