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 Imporeter tool addressed in the driver documentation.
List of Functions
The following is a list of the Functions available in this API:
- create_config
- add_board
- add_transmission_channel
- add_reception_channel
- delete_channel
- set_recording_enabled
- add_transmission_message
- add_reception_message
- add_signal
- delete_signal
- modify_parameter
- print_config
- validate_config
- save_config
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 Name | Valid Values |
---|---|
Card | RAR_PCIE_22 RAR_PCIE_44 RAR_PCIE_88 RAR_PCIE_1616 |
Clock | Internal External_IRIGB |
SdiOrSsm | _00 _01 _10 _11 |
Bitrate | Low High Custom |
TxParity | None Even Odd |
RxParity | On Off |
BitError | Disabled Low_Bits High_Bits |
Encoding | BCD BNR DIS |
Functions Table
Function Name | Example Usage(s) | Input [default value] | Output | Exceptions |
---|---|---|---|---|
create_config | config = create_config(config_name) | config_name (str) | ARINC429Config instance | none |
add_board |
|
| ARINC429Board instance | OpalARINC429Exception |
add_transmission_channel |
| name (str) | ARINC429TransmissionChannel instance | OpalARINC429Exception |
add_reception_channel |
| name (str) | ARINC429TReceptionChannel instance | OpalARINC429Exception |
delete_channel | my_board.delete_channel(channel) | channel(int) | none | OpalARINC429Exception |
set_recording_enabled |
| enable(boolean) | none | OpalARINC429Exception |
add_transmission_message |
|
| ARINC429TransmissionMessage instance | OpalARINC429Exception |
add_reception_message |
|
| ARINC429ReceptionMessage instance | OpalARINC429Exception |
add_signal |
|
| ARINC429Signal instance | OpalARINC429Exception |
delete_signal | message.delete_signal (signal_name) | signal_name (str) | none | OpalARINC429Exception |
modify_parameter |
| 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 |