|
||||||||||||||||||||||
|
|
XPLUIPC PLUGIN INSTALLATION To be able to read the simulator internal variables and write the values we want, I'm going to install the plugin XPLUIPC developed by Alberto Beaterio. This plugin can downloaded from the download section at Opencockpits. Once downloaded the ZIP file, it has to be unzipped to a temporal folder:
The files in the folder "plugins" must be moved to the folder "plugins" in the simulator folder. These files are marked on the picture.
The plugin is installed. We start the simulator to check that the plugin is running. In the menu "Plugins->Plugin Administrator->Enable/Disable" we can enable and disable the plugin. In the menu "Plugins->IOCP Server XPLANE" we can start and stop the IOCP server (this action will refresh the data) and see with which client the communication is stablished.
WORKING WITH VARIABLES Let's read and write an easy variable, for example, the parking brake. In the folder "DataRefs" we can find a spreadsheet with every internal variable in the simulator. The updated list can be found here. We look for the variable "parking brake" (row 688). The internal name, type, if we can write or not its value, the format and the description is shown sorted by columns.
Let's copy the information regarding the variable (three first columns) into the "datos" file located in the "plugins" folder in the simulator:
This file contains all the variables I'm going to work with. The lines must be numbered correlatively starting with "1". Data must be tabulated. In this case we have only one variable. We save the file, and start the simulator and the IOCP console.
The simulator and IOCP console are installed on the same PC, so I set "localhost" or "127.0.0.1" in the "IP Serv" box. In the "Línea de conexión" box I write the number of the variable (1 in this case) followed by ":". We click "Arrancar and the value is shown in the "Comunicaciones" box: 10000. Float type variables are corrected with a 10000 factor, so the real value is 1. Parking brake light is ON. Let's go to the simulator to release the parking brake. Coming back to the console I will see:
Now the variable value is 0 and the light is OFF. We have only read the value from the simulator. Now let's write the value from the console. We write the number of the variable in the "Dato" box and the desired value in the "Valor" box. Clicking "Grabar" sends the order to the simulator. If we want to apply the brakes:
Check the light has turnes ON. To release them:
and the light turns OFF. Let's add another variable to the "datos" file: the indicated airspeed.
We can only read this variable. We save the file and stop and start IOCP server from the simulator plugin menu. We start again the console to check how the speed value (*10000) is shown. In this case the plane is ready to take off (winds at 5 knots).
We know how to handle with the simulator variables and check if their values are sent properly to the different clients.
Last edition: 10.10.2005
|
|||||||||||||||||||||
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||