SIOC LANGUAGE EXAMPLE

In this example we will link with X-Plane, reading its IAS and showing it on three displays. In addition, we're going to work using different computers on a network: one PC (IP 192.168.2.3) with X-Plane and XPLUIPC, and the other (IP 192.168.2.5) with "sioc" and IOCards.

We start with the first PC, writing the file "datos.dat" with the variable "IAS" and saving it in the "plugins" folder.

We start X-Plane checking that XPLUIPC is active. We set the autopilot to fly at 200 knots.

Now we'll work with the second PC. We can check if the data from X-Plane is being sent through the net (setting the correct IP values) by starting the console (you can see how to do this here) :

As we can see, the data is sent correctly. We can start writing the SIOC configuration file. The variable coming from X-Plane is defined this way:

Var 0001, name IAS_SIM, Link IOCP, Offset 1

Is the one with index 1 in the "datos.dat" file, so we write "Offset 1".

Now, the variable we are going to send to the displays is:

Var 0002, name IAS, Link IOCARD_DISPLAY, Digit 0, Numbers 3

(on display 0, the less significative figure of IAS, units, will be shown).

The required rules are:

L0 = &IAS_SIM / 10000
&IAS = TRUNC L0

In the local variable L0 we'll store the data coming from X-Plane (divided by 10000). Then, once the decimal part is truncated, we store the value in the output variable.

The file "prueba2.txt" is ready:

From "Config_SIOC" software, we import this text file:

We save it as "sioc.ssi" and as "prueba2.ssi" too. "sioc" reads "sioc.ssi" actually . We can close "Config_SIOC".

Now we set the correct parameters in the "sioc.ini" configuration file:

[ fichero de configuracion para el SIOC ver. 2.0 ]
[ Configuration file for SIOC ]

[************** SIOC ***************]

[ Puerto del servidor IOCP ]
[ IOCP port ]
IOCP_port=8092

[ Tiempo de respuesta máximo de los paquetes IOCP ]
[ IOCP Timeout ]
IOCP_timeout=4000

[ Arranque minimizado en la barra ]
[ Start minimized in tray ]
Minimized=No

[ Retraso necesario para las variables toggles (Project Magenta)]
[ Deley needed for var. toggles (Project Magenta) ]
toggle_delay=20

[ Fichero de configuracion ]
[ Configuration File ]
CONFIG_FILE=.\sioc.ssi

[************** IOCARDS MODULE ***************]

[ Desactivar el módulo de las IOCards ]
[ Disable IOCards module ]
IOCard_disable=No

[ Uso de Expansión USB ]
[ Iocard Master expansion USB ]
USB=yes

[ Múltiples USBs ]
[ Non unique USB ]
MUSB=No

[ Número de periférico para el USB ]
[ USB Device number ]
deviceUSB=2048

[ Número de A/D a usar de la placa de Expansión USB ]
[ A/D used by Iocard Master expansion USB ]
USB_AD=0

[ Puerto donde se encuentra conectada la IOCard Master ]
[ Iocard Master, parallel port address ]
Port=$0378

[ Modo compatible yes/no , necesita cable especial ]
[ Compatibility Mode yes/no, needed special cable ]
FullCompatible=No

[ Numero de tarjetas Master inter-conectadas ]
[ Number of connected master cards ]
NCards=1

[ Utiliza placa de expansión yes/no]
[ Use Expansion card yes/no]
Expansion=No

[ Activar en modo SIMULADOR yes/no]
[ Use simulated card yes/no]
simulator=yes <- we're using the simulator

[ Refresco de poll tarjetas Master ]
[ Master cards refresh ]
MasterRefresh=10

[************** FSUIPC MODULE ***************]

[ Desabilitar lectura de las FSUIPC ]
[ FSUIPC disable mode yes/no ]
FSUipcdisable=yes <- we're not using FS, nor FSUIPC

[ Refresco recepción FSUIPC ]
[ FSUIPC refresh ]
FSUipcRefresh=50

[************** IOCP CLIENT MODULE ***************]

[ Desactivar el módulo cliente IOCP ]
[ Disable IOCP client module ]
IOCPclient_disable=no

[ IP del servidor donde debe de conectar el cliente ]
[ IOCP client host name ]
IOCPclient_host=192.168.2.3 <- IP (X-plane PC)

[ Puerto de envio del protocolo IOCP cliente ]
[ IOCP client port ]
IOCPclient_port=8090

[ Retraso para inicializacion una vez conectado el cliente en milisegundos ]
[ Delay for initialization when client has been connected in mseconds ]
IOCPini_delay=3000

[ End of File ]

When we start "sioc", the simulator starts automatically:

We can minimize "sioc". By clicking on "Displays" we define the outputs. I want the units (display 0) shown on the simulated display 2, and the cents (display 2) on the simulated display 0:

The IAS is shown on the simulated displays correctly:

It works as expected, so we can save the simulator file as "prueba2.ioc" just in case we want to work with it in the future.

By changing:

[ Activar en modo SIMULADOR yes/no]
[ Use simulated card yes/no]
simulator=no

we could work with the IOCards directly.

 

Last edition: 19.10.2005

 

 

Versión española

English version

 

Optimized for 1024x768

Web map

Comments, suggestions, doubts, questions, broken links...

       Cockpit builders mailing list (spanish)