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
- 1 Description
- 2 List of Functions
- 3 Workflow Description
- 4 Function Details
- 5 Functions Table
- 6 create_config
- 7 add_board
- 8 add_transmission_channel
- 9 add_reception_channel
- 10 delete_channel
- 11 set_recording_enabled
- 12 add_transmission_message
- 13 add_reception_message
- 14 add_signal
- 15 delete_signal
- 16 modify_parameter
- 17 print_config
- 18 validate_config
- 19 save_config
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 Name | Valid Values |
|---|---|
Card | RAR_PCIE_22 |
Clock | Internal |
SdiOrSsm | _00 |
Bitrate | Low |
TxParity | None |
RxParity | On |
BitError | Disabled |
Encoding | BCD |
Functions Table
Function Name | Example Usage(s) | Input | Output | Exceptions |
|---|---|---|---|---|
create_config | config = create_config(config_name) |
| ARINC429Config instance | none |
add_board |
|
| ARINC429Board instance | OpalARINC429Exception |
add_transmission_channel |
|
| ARINC429TransmissionChannel instance | OpalARINC429Exception |
add_reception_channel |
|
| ARINC429TReceptionChannel instance | OpalARINC429Exception |
delete_channel | my_board.delete_channel(channel) |
| none | OpalARINC429Exception |
set_recording_enabled |
|
| 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) |
| 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 |