Documentation Home Page RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

Miscellaneous X-Plane

Description

This document explains how to use the 'OpOutput' blocks with the X-Plane driver to control X-Plane aircrafts. This driver interface is only compatible with versions 9 and 10 of X-Plane. The RT-LAB communication plugin must be installed in the X-Plane installation directory. The plugin installation procedure is described in this document. To use the version 8 of X-Plane, please use the OpXPlane block located in the 'RT-LAB/Miscellaneous' library and refer to its documentation.

This driver takes advantage of the Dynamic Interchange Layer system. A connection file must be used to bind Simulink variables (represented as OpInput and OpOutput blocks) to driver signals. This file is described in a text file named 'connections.opal' (graphical editor will be available in a later release of RT-LAB). Another configuration file must be used to configure the driver itself. Both configuration files are described below.

Driver Configuration

Two configuration files must be transferred to the target in ASCII mode before the model load. They are located in the example model directory that is already configured to transfer them:


The 'connections.opal' file is required when a driver using the Dynamic Interchange Layer is used to bind Simulink variables (represented as OpInput and OpOutput blocks)to driver signals. If the project where the X-Plane driver has to be integrated already contains a 'connections.opal' file, the item {} information of the X-Plane file must be simply copied and added to the existing 'connections.opal' file. As the X-Plane driver only has to send data to the X-Plane driver, only OpOutputs blocks are required. To control all the parameters, the user simply has to add 7 OpOutputs blocks to the model and rename them to match the 'dataInProcess=OpOutput:' names of the connection file. Here is what the typical connection file taken from the example model looks like:


It is important that the second field of the 'id' item contains the name of the driver configuration file described above. As an example, the user can use this connection file as it is but gives the following names to the 7 OpOutputs blocks: 'Latitude', 'Longitude', 'Altitude', 'Heading', Pitch'' Roll' and 'Gears'. Then, the master subsystem would look like this:


The second configuration file is the 'xplane_driver_cfg.opal' file and it must be modified by the user to configure the driver. If the number of planes is modified, the width of the signals connected to the OpOutputs blocks must be updated accordingly and then the model must be recompiled. However, the model does not have to be recompiled if the other parameters are modified. Here is a screenshot of the example model configuration file:


The following table explains each driver parameter:

ParameterDescription
ip_addressIP address of the host machine where the X-Plane software with the RT-LAB communication plugin is running
portUDP port used for the communication. Must be 46005
num_planesNumber of planes to control. Must be between 1 and 20, inclusively
plane_pathComplete path to the '.acf' aircraft model to use
decimationDecimation factor for communication. If configured to 1, a packet will all the plane information will be send at each model step


The width of the vector connected to each OpOutput block must match with the 'num_planes' value.

X-Plane Configuration

The RT-LAB communication plugin for X-Plane is located in the RT-LAB installation directory under:

YOUR_RT_LAB_INSTALLATION_FOLDER/common/bin/X-Plane plugin for RT-LAB

X-Plane-9

The following file must be copied in the X-Plane 9 'Resources/plugins' installation directory:X-Plane plugin for RT-LAB\32\win.xpl
As an example, the typical plugin path for the demo version is:C:\X-Plane 9 Demo\Resources\plugins
After the copy, the following file should be present:C:\X-Plane 9 Demo\Resources\plugins\win.xpl

X-Plane-10

The X-Plane 10 configuration is different because it can run in 64-bits mode. The whole 'X-Plane plugin for RT-LAB' folder must be copied in the X-Plane 10'Resources/plugins' installation directory. As an example, the typical plugin path for the demo version is: C:\X-Plane 10 Demo\Resources\pluginsAfter the copy, the following files should be present:

C:\X-Plane 10 Demo\Resources\plugins\X-Plane plugin for RT-LAB\32\win.xpl

C:\X-Plane 10 Demo\Resources\plugins\X-Plane plugin for RT-LAB\64\win.xpl

Before running the model, launch X-Plane and make sure the RT-LAB communication plugin is correctly loaded:

  • Launch X-Plane 9 or X-Plane 10 (32-bit or 64-bit version)
  • In the top menu, select 'Plugins', 'Plugin Admin', 'Enable/Disable'
  • Make sure you see the 'RT-LAB-COM' plugin and that it is enabled
  • Run the model and enjoy your flight

Example Model

The X-Plane example model with the configuration files are located in the following RT-LAB directory:

YOUR_RT_LAB_INSTALLATION_FOLDER/Example/Features/Miscellaneous/XPlane

Limitations

Compatible only with X-Plane 9 and X-Plane 10 (32-bit or 64-bit version).

Compatible only with Redhat targets (do not work offline).

Can only control one instance of X-Plane per model.

Direct FeedthroughNo
Discrete sample timeNo
XHP supportYes
Work offlineYes

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323