|
||||||||||||||||||||||
|
|
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 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 ] [************** SIOC ***************] [ Puerto del servidor IOCP ] [ Tiempo de respuesta máximo de los paquetes IOCP ] [ Arranque minimizado en la barra ] [ Retraso necesario para las variables toggles (Project Magenta)] [ Fichero de configuracion ] [************** IOCARDS MODULE ***************] [ Desactivar el módulo de las IOCards ] [ Uso de Expansión USB ] [ Múltiples USBs ] [ Número de periférico para el USB ] [ Número de A/D a usar de la placa de Expansión USB ] [ Puerto donde se encuentra conectada la IOCard Master ] [ Modo compatible yes/no , necesita cable especial ] [ Numero de tarjetas Master inter-conectadas ] [ Utiliza placa de expansión yes/no] [ Activar en modo SIMULADOR yes/no] [ Refresco de poll tarjetas Master ] [************** FSUIPC MODULE ***************] [ Desabilitar lectura de las FSUIPC ] [ Refresco recepción FSUIPC ] [************** IOCP CLIENT MODULE ***************] [ Desactivar el módulo cliente IOCP ] [ IP del servidor donde debe de conectar el cliente ] [ Puerto de envio del protocolo IOCP cliente ] [ Retraso para inicializacion una vez conectado el cliente en milisegundos ] [ 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] we could work with the IOCards directly.
Last edition: 19.10.2005
|
|||||||||||||||||||||
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||