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.
Arinc 429 DIL Driver
This driver implements the most common features of the Arinc 429 protocol based on PCI-400 Max Technology carrier boards and Max Technology IPM-429 modules.
What is the Arinc 429 Protocol?
Arinc 429 (also referred to as Mark 33 Digital Information Transfer System) is the most commonly used databus for commercial and transport aircraft. This specification defines the medium and data protocol used for communication between avionics equipment and systems. Arinc 429 uses a twisted, shielded pair of wires as its medium. The data flow is unidirectional in a peer to peer fashion, although up to 20 receivers can be connected on the same line. The specification also defines in details the voltage levels (differential signalling), words size and transfer rate. Messages are transmitted at a bit rate of either 12.5 or 100 kilobits per second to the receiving systems.
Arinc 429 data words are typically 32 bits and use the format shown below, which includes five primary fields, namely Parity, SSM, Data, SDI, and Label. The ARINC specification numbers the bits from 1 (LSB) to 32 (MSB). Sometimes data words have 25 bits which include 8 bits label, 16 data bits, and one parity bit.
Glossary
Name | Description |
---|---|
DIL | Data Interchange Layer (It is the RT-LAB data-exchanger framework.) |
BNR | Binary Number Representation encoding mode |
BCD | Binary Coded Digits encoding mode |
DIS | Discrete encoding mode |
SDI | Source/Destination Identifier |
SSM | Sign/Status Matrix |
LSB | Least Significant Bit |
MSB | Most Significant Bit |
Supported Features
Category | Feature |
---|---|
Transmission | Scheduled Mode (scheduling the send time and update interval of each message) / Asynchronous Mode (Send messages upon request) |
Field Detailed Mode (ability to set the fields of data words independently) / Raw Data Mode (sending the Arinc 429 word as it is) | |
Arinc 429 encoders for converting engineering values to raw data fields (i.e. BNR, BCD, and DIS) | |
Up to 8 transmission channels per IPM-429 module (For each Arinc.config file one channel can be used) | |
Supports MAX_PCI_400_2 and MAX_PCI_400_4 Max Technology boards | |
12.5 Kbps (low) and 100 Kbps (high) speed | |
Even / Odd parity | |
Ability to change the inter-word gap (from 0 to 15.75 bits time) | |
Ability to change field values in real-time | |
32 words per channel per minor frame (this is the size of FIFO buffer on the carrier board) | |
Reception | Label and SDI filters on the receiving side |
Up to 8 reception channels per IPM-429 module (For each Arinc.config file one channel can be used) | |
Channel Mute option | |
Arinc 429 decoders for converting raw data fields to engineering values (i.e. BNR, BCD, and DIS) | |
Internal Loopback option |
Configuring the Driver through the .config File
In the .config file, the configuration of the Arinc 429 driver as well as the specifications of each Arinc 429 word is determined for one transmission channel and one reception channel. The model should be accompanied by this file in RT-LAB when loading it. Therefore, the correct file has to be added in the model's File list window in RT-LAB as shown below in order to load the model successfully:
A simple example of .config file is given below:
opal-1.0 object ARINC::Settings { ArincConf { channel_mute=1 label_filter=1 sdi_filter=1 tx_data_format=1 rx_data_format=1 rx_channel=1 tx_channel=1 speed=1 loopback=1 parity=0 parity_mode=1 word_size=32 send_type=1 interword_gap=0 gap_selection=1 pci_index=0 board_type=0 slot_id=1 displayOnOrder=1 encoding=0 latched=0 minorFrame=0 } ios{ inputs{ ARINC::ArincPinIn{ name=in1 offset=0 updateInterval=150 startFrame=0 label=50 sdi=0 labelFormat=1 encoder{ Arinc::arincEncoder{ lsb=11 msb=28 resolution=0.100000 min=-2000.000000 max=12000.000000 coding=0 digits=0 } } } ARINC::ArincPinIn{ name=in2 offset=1 updateInterval=300 startFrame=150 label=60 sdi=2 labelFormat=1 encoder{ Arinc::arincEncoder{ lsb=11 msb=28 resolution=0.005000 min=0.000000 max=100.000000 coding=0 digits=0 } } } outputs{ ARINC::ArincPinOut{ name=out1 label=51 sdi=0 labelFormat=1 decoder{ Arinc::arincDecoder{ lsb=11 msb=28 resolution=0.005000 min=0.000000 max=100.000000 coding=0 digits=0 } } } ARINC::ArincPinOut{ name=out2 label=61 sdi=1 labelFormat=1 decoder{ Arinc::arincDecoder{ lsb=11 msb=28 resolution=0.005000 min=0.000000 max=100.000000 coding=0 digits=0 } } } } } }
The above-mentioned .config file can be used to send two 32 bits Arinc 429 words with labels 50 and 60 and SDIs 0 and 2 in Field-Detailed, Scheduled mode on channel one. On the receiving side, the driver awaits two 32 bits Arinc 429 words with labels 51 (sdi 0) and 61 (sdi 1).
Warning: Please note that the DIL parser is currently quite sensitive and does not accept blank lines or comments. Also, it might seem like it is not that easy to correctly write the .config file since it consists mostly of digital values and not words, which would be more user-friendly. However, the .config file does not have to be written manually, as highlighted in the following section.
CreateArinc.m Script File
To ease the creation of the .config file, the driver comes with a Matlab script that takes as input a Microsoft Excel datasheet. The script can be run from the Matlab command prompt by using the following command: CreateArinc('yourdata.xlsx') where yourdata.xlsx is to be replaced by the path and name of your data file (keep the single quotes). When execution is completed, the script outputs the .config file as Arinc.config and it also outputs the connections.opal file (see the Connections section for the second file). The easiest way to write your own Excel data file is to start from one of the data files that come with the example models of this driver.
The data file, unlike the .config file, can hold text instead of digital values. This makes the configuration of the driver much easier and less error-prone. The script replaces all enable, enabled, true, yes, high, in, scheduled and even by the digital value 1. So you can either use one of these keywords or simply use number 1. Similarly, the script replaces disable, disabled, false, no, low, request, out and odd by 0. So you can either use one of these keywords or simply use number 0.
The data file can be divided into two sections: a list of global parameters for the driver and details about each data words (transmitting or receiving). The global parameters can be given in any order (one per line), but if one of them is missing, Matlab will pop an error message. The following table gives a list of all the global parameters that has to be provided to the CreateArinc script:
Parameter | Description | Accepted Values |
---|---|---|
Channel Mute | When enabled, the driver processes the "out_chMute" input signal. | disabled / enabled |
Label Filter | When enabled, the driver processes the "out_labelFilter" input signal. | disabled / enabled |
SDI Filter | When enabled, the driver processes the "out_sdiFilter" input signal. | disabled / enabled |
TX Data Format | When enabled, the driver treats the Arinc 429 words by their fields in the transmission side. This means that the driver will expect to receive the "out_ssm" input signal (if 32 bits words is selected) and also will use the SDI and Label fields given in the .config file. Otherwise, the driver treats the values of the "out_data" input signal as raw Arinc words. | disabled / enabled |
RX Data Format | When enabled, the driver treats the Arinc 429 words by their fields in the reception side. In other words, the driver decomposes the Arinc 429 words in the usual fields (Data, SSM, SDI and Label) and sends them back to the simulation model using "in_data","in_label", "in_sdi", and "in_ssm" (the last two fields are used for 32 bits words case only). Otherwise, the driver treats the received words as raw data, which is transferred to the simulation model in the "in_data" signal (without any field decomposition). | disabled / enabled |
RX Channel | This parameter indicates the channel number that will be used for Arinc words reception. | 0 - 7 |
TX Channel | This parameter indicates the channel number that will be used for Arinc words transmission. | 0 - 7 |
Speed | If set high, the driver transmits data at a 100 kbps rate. If set low, the speed is reduced to 12.5 kbps. | low / high |
Loopback | If set, the internal loopback of the board is activated. This is useful for testing a simulation model without actual hardware connected to the board. | disabled / enabled |
Parity | If set, the Parity Mode parameter is used to compute the correct value of the parity bit of each transmitting word. | no / yes |
Parity Mode | Only used when the Parity parameter is activated. This parameter defines which parity value is used for the parity bit. | odd / even |
Word Size | If 25 is selected, the Arinc 429 words are 25 bits long, otherwise they are 32 bits long. | 25 / 32 |
Send Type | When set to scheduled, the scheduled mode of the driver is activated. In scheduled mode, we schedule the transmission time of each Arinc 429 word using an update interval and an offset. On the other hand, if the Send Type is set to request, then the Arinc 429 words are sent once per simulation time step and only if the transmission is requested using the "out_sendSignal" input signal. | request / scheduled |
Interword Gap | If set, the interword gap can be changed through the value given in the Gap Selection parameter, otherwise the default gap size (4 bits time) is used. | no / yes |
Gap Selection | If the Interword Gap parameter is activated, this parameter gives the interword gap size. The interword gap size parameter must be given in bit time with the resolution of a quarter of a bit. For example, 3.25 is ok, but not 3.40. | 0 - 15.75 |
PCI Index | This parameter is used to distinguish between multiple MAX Technologies A429 Carriers. Valid values range from 0 (default) to 15, meaning that a maximum number of 16 Arinc 429 carrier boards are supported. | 0 - 15 |
Board Type | This parameter defines the carrier type used in the simulator. A value of 0 corresponds to the MAX-PCI-400-4 carrier (4 slots). A value of 1 corresponds to the MAX_PCI_400_2 (2 slots). | 0 / 1 |
Slot ID | This parameter is used to distinguish between multiple IP modules installed on the same carrier board. Possible values are from 0 to 3 for the 4 IP modules carrier and 0 or 1 for the 2 IP modules carrier. | 0 - 3 |
Display On Order | If set, the received Arinc 429 words are displayed in the output of the driver in a order determined by the Label and SDI fields of the data section (works only if 32 bits word size is selected). In other word, using this option, an Arinc 429 word with a specific Label and SDI fields would be displayed in the "in_data" array signal at an index corresponding to the position of the label in the .config file (and Excel data file). | no / yes |
Encoding | This option is meaningful only when TX Data Format and RX Data Format parameters are activated. When selected, data encoding and decoding is processed by the driver. The data file must then provide, inside the data section and for each word, the following data columns: Encoding, LSB, MSB, Min, Max and Resolution. Optionally the Digits column can be provided as well (used only for BCD encoding). | no / yes |
Latched | If this option is set, the driver uses a latch mechanism on the data. In other words, the various data fields for a given word will not change to zero in the case that word was not received by the carrier board. This option is especially helpful when the update rate is very fast and we cannot track the changes easily. | no / yes |
Automatic Start Frame | This parameter is meaningful only when the Send Type is scheduled. When activated, the CreateArinc script computes a valid Start Frame parameter for each data word. In this case, filling the Start Frame column is not required (although the column itself must be present). | no / yes |
Automatic Offset | This parameter is meaningful only when the Send Type is scheduled. Its functionality is not implemented yet, but the parameter itself must appear in the data file nonetheless. This parameter should remain deactivated at this moment. If activated, all data word will have a value of 0 in the Offset column. The offset of each label must be specified manually. | no / yes |
Minor Frame | This parameter is meaningful only when Send Type is scheduled. If its value is zero, then the minor frame is computed using the greatest common divisor of Update Intervals of all the data words. If its value is not zero, then the given value, in milliseconds, represents the duration of a minor frame and this duration must be either equal to the greatest common divisor, or be itself a divisor of the greatest common divisor. | 0 - 4294967295 |
The second section of the data file is to specify the details of each data word. The data words must be placed between the "Data{" and "Data}" lines. The line that follows "Data{" must contain the header of each data column. The columns can be in any order, but there must be no empty column between two valid columns. The headers are listed and described in the following table:
Parameter | Description | Accepted Values |
---|---|---|
Label | Contains the label field of the Arinc 429 word. | 0 - 255 (decimal format) 0 - 377 (octal format) |
Encoding | Contains the encoding scheme of the Arinc 429 word. | 0 = BNR 1 = BCD 2 = DIS |
LSB | Indicates the position of the LSB within the data field. | 9 - 29 |
MSB | Indicates the position of the MSB within the data field. | 9 - 29 |
Max | Gives the maximum value the data field can hold. Even if a greater value is passed to the driver when transmitting some data, the data gets truncated to that value. | - |
Min | Gives the minimum value the data field can hold. Even if a lower value is passed to the driver when transmitting some data, the data gets truncated to that value. | - |
SDI | Processed only if TX Data Format and RX Data Format parameters are set and the Word Size is 32 bits. It contains the SDI field of Arinc 429 words. | 0 - 3 |
Update Interval | Processed only if the Send Type is scheduled. It indicates the time interval in milliseconds between two transmissions of this data word. The value must be greater than or equal to the model time step. | - |
Start Frame | Processed only if Send Type is scheduled. It indicates at which minor frame the Arinc 429 word must be transmitted. This parameter is given in milliseconds and must be a multiple of the minor frame period. | - |
Offset | Processed only if Send Type is scheduled. It indicates the time in milliseconds within the minor frame when the driver begins transmission. It must be less than the minor frame period duration. | - |
Resolution | Indicates the resolution factor used by the BNR and BCD encoding schemes to process the data field. The resolution represents the weight of the LSB in the data field. | - |
Direction | Indicates the direction of the defined data word. It is given form the point of view of the driver, which means that in is actually an output from the simulator to the connected hardware device. Conversely, out is an input from the connected hardware device to the simulator. | in / out |
Digits | Optional and it is used to specify the number of digits to encode when BCD encoding is used. The script double-checks that the number of digits specified match with the Min, Max and Resolution parameters. In any case, the limit is 5 digits on 19 bits (the size of the data field when 32 bits words size is used). | 0 - 5 |
Label Format | Optional and it is processed only if TX Data Format and RX Data Format parameters are set. If its value is 1 (default value), then the numbers given in the Label column are in octal format. If its value is 0, then the Label format is decimal. | 0 / 1 |
Minor/Major Frames Definition
In scheduled mode, we specify for each transmitting word three parameters for scheduling the Arinc 429 messages. These parameters are Update Interval, Offset and Start Frame. All values are in milliseconds. The minor and major frames are constructed using these parameters as well as the Minor Frame global parameter if specified by the user. If the minor frame period is not given, then it is computed using the greatest common divisor of all update intervals. The major frame is a concatenation of minor frames and represents the overall cycle of transmission. Its duration is equal to the least common multiple of the update intervals.
The Start Frame parameter determines the start “time” that a message is going to be sent inside a major frame. This “time” must be a multiple of the minor frame period. In other words, it indicates the index of the minor frame containing the message within a major frame. The Offset parameter represents the corresponding sending time offset of a message within a minor frame and it must be less than the period of the minor frame. A schematic of minor/major frame example is given below:
Warning: While using Arinc 429 in Scheduled mode, make sure that in this mode:
- The number of messages being sent at each minor frame per channel is no more than 32 words. This limit corresponds to the size of the transmission and reception FIFO buffer. If more than 32 words are scheduled within a single minor frame, the driver raises an error. This limit will also be flagged by the CreateArinc script.
- The model time step should be about the same as one minor frame period. This way we avoid unnecessarily updating the model state and hence decrease the load of data acquisition system that transfer data between the host running the SC_Console subsystem and the target simulator running the real-time simulation.
- The number of words sent per channel per minor frame must fit with the speed of the data bus. For instance, with the (high) speed of 100 kbps each Arinc 429 word takes about 0.332 ms (plus the interword gap). If one wants to transmit N words per minor frame, the minor frame period should be at least (N*0.332). Using 12.5 kbps (low) speed, each word takes about 2.812 ms to be transferred.
Connections in a .opal
File
The Arinc 429 driver takes advantage of the new DIL framework. To bind Simulink signals (represented as OpInput and OpOutput blocks) to driver signals, we must define the connections in a text file named connections.opal and transfer this file with the model when loading (graphical editor will be available in a later release of RT-LAB). Below is an example of a connections.opal file:
OPAL-1.0 Object List { item { id { ARINC Arinc.config } inputs { item { dataInExchanger=in_data[0:1] dataInProcess=OpInput:in_data[0:1] modifier= } item { dataInExchanger=in_label[0:1] dataInProcess=OpInput:in_label[0:1] modifier= } item { dataInExchanger=in_sdi[0:1] dataInProcess=OpInput:in_sdi[0:1] modifier= } item { dataInExchanger=in_ssm[0:1] dataInProcess=OpInput:in_ssm[0:1] modifier= } item { dataInExchanger=in_timeStamp[0:1] dataInProcess=OpInput:in_timeStamp[0:1] modifier= } item { dataInExchanger=in_error[0] dataInProcess=OpInput:in_error[0] modifier= } } outputs { item { dataInExchanger=out_chMute[0] dataInProcess=OpOutput:out_chMute[0] modifier= } item { dataInExchanger=out_labelFilter[0:255] dataInProcess=OpOutput:out_labelFilter[0:255] modifier= } item { dataInExchanger=out_sdiFilter[0:3] dataInProcess=OpOutput:out_sdiFilter[0:3] modifier= } item { dataInExchanger=out_data[0:1] dataInProcess=OpOutput:out_data[0:1] modifier= } item { dataInExchanger=out_ssm[0:1] dataInProcess=OpOutput:out_ssm[0:1] modifier= } } } }
Warning: Note that the DIL parser is currently sensitive and does not accept blank lines or comments.
The connections.opal file presented above matches the Arinc.config file is shown before (2 data words in each direction). As for the .config file, the connections.opal file is generated from the Excel data file and CreateArinc Matlab script. It does not have to be written down manually. The same sets of global parameters and data columns are used to populate the connections.opal file as required. The description of each connection is as follows:
Connection | Description |
---|---|
inputs/in_data | The data received by the driver is sent to this connection. The signal "in_data" is an array of size equal to the number of messages. |
inputs/in_label | If RX Data Format is set, this connection contains the label field of Arinc 429 messages. The signal "in_label" is an array of size equal to the number of messages. |
inputs/in_sdi | If RX Data Format is set and Word Size is 32 bit, this connection contains the SDI field of Arinc 429 messages. The signal "in_sdi" is an array of size equal to the number of messages. |
inputs/in_ssm | If RX Data Format is set and Word Size is 32 bit, this connection contains the SSM field of Arinc 429 messages. The signal "in_ssm" is an array of size equal to the number of messages. |
inputs/in_timeStamp | This connection contains the reception time of Arinc 429 messages. The signal "in_timeStamp" is an array of size equal to the number of messages. |
inputs/in_error | This connection of size one contains an error code returned by the driver. The error code values are:
|
outputs/out_chMute | This connection of size one contains a signal that activates channel muting. If this signal is not zero, the channel is muted. |
outputs/out_labelFilter | This connection of size 256 contains the list of all accepted labels (in decimal format only). If one would like to mute a specific label, that label number should be replaced by "-1" in the "out_labelFilter" array. For example, to mute the label 10 only, the array must be [0 1 2 ... 8 9 -1 11 12 13 ... 253 254 255]. |
outputs/out_sdiFilter | If the Word Size parameter is 32, this connection of size 4 contains the list of all accepted SDIs. If one would like to mute a specific SDI, that SDI should be replaced by "-1" in the "out_sdiFilter" array. For example, to mute SDI 2, the array must be [0 1 -1 3]. |
outputs/out_data | Data is sent to the driver through this connection. The signal "out_data" is an array of size equal to the number of messages to transmit. |
outputs/out_ssm | If TX Data Format is set and Word Size is 32, this connection holds the SSM field of transmitting Arinc 429 messages. The signal "out_ssm" is an array of size equal to the number of Arinc 429 messages. |
outputs/out_sendSignal | If Send Type is set to Request, this connection passes the user transmission request to the driver. In other words, the transmission and reception of messages will start once this signal is not zero. |
The Simulink Model
For the above example of Arinc.config and connections.opal, the Simulink model master subsystem would look like the following:
Warning: Note that the default values of input connections should be determined in the mask of each OpInput block. This can be done simply by inserting the value of ones(1,n), where "n" matches the size of that connection (as indicated in the connections.opal file).
Making a Simulation Model with More than 1 TX and/or More than 1 RX Channel
In the case that one wants to use more than 1 TX or RX channel, then more than one Arinc.config file must be transferred to the target computer. The user shall define one Excel data file per TX/RX pair. Moreover, the global parameters, like the bus speed, must fit both TX and RX. If this is not the case, then the TX and RX channels must be split into two Arinc.config files. This is currently a limitation of the driver.
Once all the Excel data files are written, the CreateArinc script can be called on each of them successively. The script will automatically copy the output files and append a "_#", where # is a number, to the file names. For the .config files, those can be used as is in the simulation (remember to correctly fill the "Files" tab in RT-LAB). However, for the connections.opal files, the set of generated files must be merged manually into a single connections.opal file. This is because the DIL can only take one connections.opal file within a simulation execution.
OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter