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.

Abaco ARINC429 Configuration Python API Tool

Description

A Python API has been created to provide an interactive/scriptable way of generating an ARINC-429 configuration from a (Python) command-line.

The API allows the user to create and validate a loadable ARINC-429 configuration file (in JSON format) that can be then loaded directly in RT-LAB using the ARINC-429 Importer tool addressed in the driver documentation.

List of Functions

The following is a list of the Functions available in this API:

These functions are detailed in the functions details section.

Workflow Description

This section explains the steps needed to generate a valid ARINC-429 configuration file that can be loaded by the ARINC-429 Importing tool using RT-LAB.

To interactively create the ARINC-429 configuration in RT-LAB we can make use of the included Python tools already available:

  • From the Tools menu select Python >Open console and select Python console in the pop-up window.


  • Using the newly-opened console, import the required arinc.py module by typing:
from opal.drivers.arinc import *

  • To start creating a new configuration type:
my429Config = create_config("ARINC429_config")

  • Now we will add a board, channels and messages to the configuration:
     board = my429Config.add_board(name='RAR PCIE Board', device_id=0,clock=Clock.Internal)
     tx_channel_1 = board.add_transmission_channel(name='tx_channel_1')
     tx_message_1 = my429Config.add_transmission_message(name='tx_message_1')
     tx_message_1.add_signal(name='signal_1')

  • We will need to assign a channel and board for the message we just created:
    tx_message_1.set_board_and_channel(board, tx_channel_1)

  • To have a look at our current configuration we can use:
my429Config.print_config()

and save it with:

my429Config.save_config()

Your JSON format ARINC429 file is now available in your RT-LAB project directory. You can import it using the ARINC-429 Configuration Importer.

Note: If you need to re-generate a JSON file from a pre-existing Python script, you can also do it as shown in the image below:

Function Details

To avoid potential errors in the creation of configuration files, a list of enums has been created. The valid values for each enum appear in the following table:

Enums Table

Enum NameValid Values
CardRAR_PCIE_22
RAR_PCIE_44
RAR_PCIE_88
RAR_PCIE_1616
ClockInternal
External_IRIGB
SdiOrSsm_00
_01
_10
_11
BitrateLow
High
Custom
TxParityNone
Even
Odd
RxParityOn
Off
BitErrorDisabled
Low_Bits
High_Bits
EncodingBCD
BNR
DIS

Functions Table

Function NameExample Usage(s)Input
[default value]
OutputExceptions

create_config

config = create_config(config_name)

config_name (str)
["default"]

ARINC429Config instance

none

add_board


    1. board_params = {'name': 'Board_X', 'card' : Card.RAR_PCIE_88, 'device_id' : 1, 'clock' : Clock.External_IRIGB} board = config.add_board(**board_params )

  • board = config.add_board(name='Board_X', card=Card.RAR_PCIE_88, device_id=2, clock=Clock.External_IRIGB)



name (str)
[""]

device_id (int)
[0]

clock (enum)
[Clock.Internal]

Card (enum)
[Card.RAR_PCIE_44]

ARINC429Board instance

OpalARINC429Exception

add_transmission_channel


    1. transmit_ch_params= {'name': 'Tx_Channel_X', 'channel_number' : 1, 'bitrate' : Bitrate.High, 'tx_parity' : TxParity.Odd, 'gap_error' : True, 'inject_bit_error' : BitError.Low_Bits, 'external_tx' : True}
      tx_channel_1 = board.add_transmission_channel(**transmit_ch_params)

  • tx_channel_1 = board.add_transmission_channel(name='Tx_Channel_X', channel_number=1, bitrate=Bitrate.High, tx_parity=TxParity.Odd, gap_error=True,inject_bit_error=BitError.Low_Bits, external_tx=True)



name (str)
[""]

channel_number (int)
[0]

bitrate (enum)
[Bitrate.High]

custom_bitrate (float)
[50]

tx_parity (enum)

[TxParity.Off]

gap_error (bool)

[False]

inject_bit_error (bool)

[BitError.Disabled]

external_tx (bool)

[True]

ARINC429TransmissionChannel instance

OpalARINC429Exception

add_reception_channel


    1. receive_ch_params = {'name': 'Rx_Channel_X', 'channel_number' : 1, 'bitrate' : Bitrate.Low, 'rx_parity' : RxParity.On, 'internal_loopback' : True, 'merged_buffer' : True}
      rx_channel = board.add_reception_channel(**receive_ch_params )

  • rx_channel = board.add_reception_channel(name='Rx_Channel_X', channel_number=1, bitrate=Bitrate.Low, rx_parity=RxParity.On, internal_loopback=True, merged_buffer=True)


name (str)

[""]

channel_number(int)

[0]

bitrate (enum)

[Bitrate.High]

custom_bitrate (float)

[50]

rx_parity (enum)

[RxParity.Off]

internal_loopback (bool)

[False]

merged_buffer (bool)

[False]

ARINC429TReceptionChannel instance

OpalARINC429Exception

delete_channel

my_board.delete_channel(channel)

channel(int)
[""]

none

OpalARINC429Exception

set_recording_enabled



  • my_channel.set_recording_enabled(True)

  • my_channel.set_recording_enabled(False)


enable(boolean)
[False]

none

OpalARINC429Exception

add_transmission_message


    1. transmission_msg_params = {'name' : 'Tx_Message_1', 'label' : 92, 'sdi': SdiOrSsm._01, 'ssm' : SdiOrSsm._10, 'cyclic' : True, 'transmission_rate_ms' : 25, 'offset_ms' : 2}
      tx_message_1 = config.add_transmission_message(**transmit_msg_params )

  • tx_message_1 = config.add_transmission_message(name='Tx_Message_1', label=92, sdi=SdiOrSsm._01, ssm=SdiOrSsm._10, cyclic=True, transmission_rate_ms=25, offset_ms=2)



name (str)
[""]

label (int)
[0]

sdi (enum)
[SdiOrSsm._00]

ssm (enum)
[SdiOrSsm._00]

cyclic (bool)
[False]

transmission_rate_ms (int)
[0]

offset_ms (int)
[0]

enable_dynamic_ssm (bool)
[False]

enable_dynamic_sdi (bool)
[False]

raw_data (bool)
[False]

ARINC429TransmissionMessage instance

OpalARINC429Exception

add_reception_message


    1. receive_msg_params= {'name' : 'Rx_Message_1', 'label' : 0x65, 'sdi': SdiOrSsm._01, 'ssm' : SdiOrSsm._10, 'enable_label_filter' : True, 'monitored' : True, 'timeout_ms' : 20}
      rx_message_1 = config.add_reception_message(**receive_msg_params)

  • rx_message_1 = config.add_reception_message(name='Rx_Message_1', label=0x65, sdi=SdiOrSsm._01, ssm=SdiOrSsm._10, enable_filter=True, monitored=True, timeout_ms=20)



name (str)
[""]

label (int)
[0]

sdi (enum)[SdiOrSsm._00]

ssm (enum)[SdiOrSsm._00]

monitored (bool)
[False]

timeout_ms (int)
[0]

buffer_count (int)
[1]

enable_label_filter (bool)
[False]

raw_data (bool)
[False]

ARINC429ReceptionMessage instance

OpalARINC429Exception

add_signal


    1. signal_params = {'name' : 'Tx_Data_1', 'encoding' : Encoding.BNR, 'start_bit': 29, 'gain' : 10, 'number_of_bits' : 12, 'max' : 512.5, 'min' : -510.275}
      tx_signal = tx_msg.add_signal(**signal_params )

  • tx_signal = tx_msg.add_signal(name='Tx_Data_1', encoding=Encoding.BNR, start_bit=29, gain=10, number_of_bits=12, max=512.5, min=-510.275)



name (str)
[""]

encoding (enum)
[Encoding.DIS]

startBit (int)
[29]

number_of_bits (int)
[1]

data (float)
[0]

min (float)
[1]

max (float)
[0]

gain (float)
[1]

offset (float)
[0]

ARINC429Signal instance

OpalARINC429Exception

delete_signal

message.delete_signal (signal_name)

signal_name (str)
[""]

none

OpalARINC429Exception

modify_parameter


  1. modify_board_params = {'card' : Card.RAR_PCIE_44, 'deviceID' : 2}
  2. board.modify_parameter(**modify_board_params)


Depends on the element to be modified

none

OpalARINC429Exception

print_config

config.print_config()

none

The contents of the config printed to screen.

none

validate_config

config.validate_config()

none

If errors are found, they will be printed to screen.

none

save_config

config.save_config()

none

Config serialized into a JSON file if no errors are found.

none



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