Ruby - ARINC429 Bricklet

Note

This Bricklet is currently in the prototype stage and the software/hardware as well as the documentation is in an incomplete state.

This is the description of the Ruby API bindings for the ARINC429 Bricklet. General information and technical specifications for the ARINC429 Bricklet are summarized in its hardware description.

An installation guide for the Ruby API bindings is part of their general description.

API

All functions listed below are thread-safe.

Basic Functions

BrickletARINC429::new(uid, ipcon) → arinc429
Parameters:
  • uid – Type: str
  • ipcon – Type: IPConnection
Returns:
  • arinc429 – Type: BrickletARINC429

Creates an object with the unique device ID uid:

arinc429 = BrickletARINC429.new 'YOUR_DEVICE_UID', ipcon

This object can then be used after the IP Connection is connected.

BrickletARINC429#debug_get_discretes → [int, int]
Return Array:
  • 0: rx_discretes – Type: int, Range: [0 to 210 - 1]
  • 1: tx_discretes – Type: int, Range: [0 to 3]

Low-level debug function to read the discrete signals from the A429 chip. RX Discretes Bit 9: MB2-1 - pending frame in RX2, PRIO 1 mailbox

8: MB2-2 - 2 mailbox 7: MB2-3 - 3 mailbox 6: R2FLAG - FIFO 5: R2INT - FIFO (pulse only) 4: MB1-1 - pending frame in RX1, PRIO 1 mailbox 3: MB1-2 - 2 mailbox 2: MB1-3 - 3 mailbox 1: R1FLAG - FIFO 0: R1INT - FIFO (pulse only)
TX Discretes Bit 2-7: unused
1: TFULL - TX buffer full 0: TEMPTY - TX buffer empty
BrickletARINC429#debug_read_register(op_code) → [[int, ...], int]
Parameters:
  • op_code – Type: int, Range: [0 to 255]
Return Array:
  • 0: value – Type: [int, ...], Length: variable, Range: [0 to 255]
  • 1: rw_error – Type: int, Range: See constants
Low-level debug function to execute a direct SPI read access on the A429 chip.
  • OP Code: code number of the SPI read command
  • Value Length: number of bytes read
  • Value Data: data bytes read
  • RW Error: 'OK' if the read access was successful, else error code

The following constants are available for this function:

For rw_error:

  • BrickletARINC429::RW_ERROR_OK = 0
  • BrickletARINC429::RW_ERROR_NO_WRITE = 1
  • BrickletARINC429::RW_ERROR_NO_READ = 2
  • BrickletARINC429::RW_ERROR_INVALID_OP_CODE = 3
  • BrickletARINC429::RW_ERROR_INVALID_LENGTH = 4
  • BrickletARINC429::RW_ERROR_SPI = 5
BrickletARINC429#debug_write_register(op_code, value) → int
Parameters:
  • op_code – Type: int, Range: [0 to 255]
  • value – Type: [int, ...], Length: variable, Range: [0 to 255]
Returns:
  • rw_error – Type: int, Range: See constants
Low-level debug function to execute a direct SPI write access on the A429 chip.
  • OP Code: code number of the SPI read command
  • Value Length: number of bytes to write
  • Value Data: data bytes to write
  • RW Error: 'OK' if the write access was successful, else error code

The following constants are available for this function:

For rw_error:

  • BrickletARINC429::RW_ERROR_OK = 0
  • BrickletARINC429::RW_ERROR_NO_WRITE = 1
  • BrickletARINC429::RW_ERROR_NO_READ = 2
  • BrickletARINC429::RW_ERROR_INVALID_OP_CODE = 3
  • BrickletARINC429::RW_ERROR_INVALID_LENGTH = 4
  • BrickletARINC429::RW_ERROR_SPI = 5
BrickletARINC429#get_capabilities → [int, int, int, [int, ...]]
Return Array:
  • 0: tx_total_scheduler_tasks – Type: int, Range: [0 to 216 - 1]
  • 1: tx_used_scheduler_tasks – Type: int, Range: [0 to 216 - 1]
  • 2: rx_total_frame_filters – Type: int, Range: [0 to 216 - 1]
  • 3: rx_used_frame_filters – Type: [int, ...], Length: 2, Range: [0 to 216 - 1]
Get the TX and RX capabilities and their current usage:
  • TX Total Scheduler Tasks: total number of task entries in the scheduling table.
  • TX Used Scheduler Tasks: number of task entries that are currently in use.
  • RX Total Frame Filters: total number of frame filters that can be defined per channel.
  • RX Used Frame Filters: number of frame filters that are currently in use per each channel.
BrickletARINC429#set_channel_configuration(channel, parity, speed) → nil
Parameters:
  • channel – Type: int, Range: See constants
  • parity – Type: int, Range: See constants
  • speed – Type: int, Range: See constants
Set the data transmission properties of the selected channel:
  • Channel: channel to configure
  • Parity: 'parity_auto' for automatic parity adjustment, 'parity_data' for parity bit supplied by the application or if used for data.
  • Speed: 'speed_hs' for high speed mode (100 kbit/s), 'speed_ls' for low speed mode (12.5 kbit/s).

When parity set to 'parity_auto', frames received with a parity error will be counted in the lost frames counter but discarded otherwise.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44

For parity:

  • BrickletARINC429::PARITY_DATA = 0
  • BrickletARINC429::PARITY_AUTO = 1

For speed:

  • BrickletARINC429::SPEED_HS = 0
  • BrickletARINC429::SPEED_LS = 1
BrickletARINC429#get_channel_configuration(channel) → [int, int]
Parameters:
  • channel – Type: int, Range: See constants
Return Array:
  • 0: parity – Type: int, Range: See constants
  • 1: speed – Type: int, Range: See constants

Get the data transmission properties of the selected channel.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44

For parity:

  • BrickletARINC429::PARITY_DATA = 0
  • BrickletARINC429::PARITY_AUTO = 1

For speed:

  • BrickletARINC429::SPEED_HS = 0
  • BrickletARINC429::SPEED_LS = 1
BrickletARINC429#set_channel_mode(channel, mode) → nil
Parameters:
  • channel – Type: int, Range: See constants
  • mode – Type: int, Range: See constants
Set the operating mode of the selected channel:
  • passive: TX channel: all transmissions are stopped and the hardware interface becomes high-Z. RX channels: all arriving frames will be discarded.
  • active: TX channel: Arinc429 frames can be sent via the 'Write Frame Direct' function. RX channels: arriving frames will be processed according to the frame filter and callback settings.
  • run: TX channels only: the scheduler will run and transmit frames according to the entries made in the scheduler task table.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44

For mode:

  • BrickletARINC429::CHANNEL_MODE_PASSIVE = 0
  • BrickletARINC429::CHANNEL_MODE_ACTIVE = 1
  • BrickletARINC429::CHANNEL_MODE_RUN = 2
BrickletARINC429#get_channel_mode(channel) → int
Parameters:
  • channel – Type: int, Range: See constants
Returns:
  • mode – Type: int, Range: See constants

Get the operating mode of the selected channel.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44

For mode:

  • BrickletARINC429::CHANNEL_MODE_PASSIVE = 0
  • BrickletARINC429::CHANNEL_MODE_ACTIVE = 1
  • BrickletARINC429::CHANNEL_MODE_RUN = 2
BrickletARINC429#clear_all_rx_filters(channel) → nil
Parameters:
  • channel – Type: int, Range: See constants

Clear all receive filters on the selected RX channel.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44
BrickletARINC429#clear_rx_filter(channel, label, sdi) → bool
Parameters:
  • channel – Type: int, Range: See constants
  • label – Type: int, Range: [0 to 255]
  • sdi – Type: int, Range: See constants
Returns:
  • success – Type: bool
Clear one receive filter on the selected RX channel.
  • Channel: selected channel.
  • Label: label code of the filter.
  • SDI: SDI code of the filter (SDI_SDI0 to SDI_SDI3 or SDI_DATA if SDI bits are used for data).
  • Success: returns 'True' if the filter was cleared or 'False' if a respective filter was not set.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44

For sdi:

  • BrickletARINC429::SDI_SDI0 = 0
  • BrickletARINC429::SDI_SDI1 = 1
  • BrickletARINC429::SDI_SDI2 = 2
  • BrickletARINC429::SDI_SDI3 = 3
  • BrickletARINC429::SDI_DATA = 4
BrickletARINC429#set_rx_standard_filters(channel) → nil
Parameters:
  • channel – Type: int, Range: See constants

Set a receive filter for each label value (0-255) with SDI bits set for data. Any previously existing filters will be overwritten.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44
BrickletARINC429#set_rx_filter(channel, label, sdi) → bool
Parameters:
  • channel – Type: int, Range: See constants
  • label – Type: int, Range: [0 to 255]
  • sdi – Type: int, Range: See constants
Returns:
  • success – Type: bool
Set a receive filter on the selected channel:
  • Channel: selected channel.
  • Label: label code for the filter.
  • SDI: SDI code for the filter (SDI_SDI0 to SDI_SDI3 or SDI_DATA if SDI bits are used for data).
  • Success: returns 'True' if the filter was set or 'False' if a respective filter could not be set up (e.g. because label + SDI collides with an already existing filter or all available filters are used up).

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44

For sdi:

  • BrickletARINC429::SDI_SDI0 = 0
  • BrickletARINC429::SDI_SDI1 = 1
  • BrickletARINC429::SDI_SDI2 = 2
  • BrickletARINC429::SDI_SDI3 = 3
  • BrickletARINC429::SDI_DATA = 4
BrickletARINC429#get_rx_filter(channel, label, sdi) → bool
Parameters:
  • channel – Type: int, Range: See constants
  • label – Type: int, Range: [0 to 255]
  • sdi – Type: int, Range: See constants
Returns:
  • configured – Type: bool
Query if a specific filter is set up or not:
  • Channel: channel to query.
  • Label: label code to query for.
  • SDI: SDI usage to query for (SDI_SDI0 to SDI_SDI3 or SDI_DATA if SDI bits shall be used for data).
  • Configured: returns 'True' if the inquired filter exists, else 'False'.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44

For sdi:

  • BrickletARINC429::SDI_SDI0 = 0
  • BrickletARINC429::SDI_SDI1 = 1
  • BrickletARINC429::SDI_SDI2 = 2
  • BrickletARINC429::SDI_SDI3 = 3
  • BrickletARINC429::SDI_DATA = 4
BrickletARINC429#read_frame(channel, label, sdi) → [bool, int, int]
Parameters:
  • channel – Type: int, Range: See constants
  • label – Type: int, Range: [0 to 255]
  • sdi – Type: int, Range: See constants
Return Array:
  • 0: status – Type: bool
  • 1: frame – Type: int, Range: [0 to 232 - 1]
  • 2: age – Type: int, Unit: 1/60 ms, Range: [0 to 216 - 1], Default: 0

Direct read of an Arinc429 frame, i.e. without using the callback mechanism. In order to be able to do a direct read of a frame with a certain label and SDI combination, a respective receive filter needs to be set up beforehand.

  • Channel: RX channel to read from.
  • Label: label code of the frame to read.
  • SDI: SDI code of the frame to read (SDI_SDI0 to SDI_SDI3 or SDI_DATA if SDI bits are used for data).
  • Status: returns 'True' if a respective frame was received, else 'False'.
  • Frame: returns the complete Arinc429 frame including the label and SDI bits. If 'parity_auto' is set for the channel, the parity bit will always come as 0.
  • Age: time in milliseconds since this frame (label + SDI combination) was received last. If not received for so far or after a previous timeout, 60000 or the timeout value set with the 'Set RX Callback Configuration' function will be returned.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44

For sdi:

  • BrickletARINC429::SDI_SDI0 = 0
  • BrickletARINC429::SDI_SDI1 = 1
  • BrickletARINC429::SDI_SDI2 = 2
  • BrickletARINC429::SDI_SDI3 = 3
  • BrickletARINC429::SDI_DATA = 4
BrickletARINC429#write_frame_direct(channel, frame) → nil
Parameters:
  • channel – Type: int, Range: See constants
  • frame – Type: int, Range: [0 to 232 - 1]
Immediately transmit an Arinc429 frame:
  • Channel: selected transmit channel.
  • frame: complete Arinc429 frame including the label and SDI bits. If 'parity_auto' is set for the channel, the parity bit will be set (adjusted) automatically.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44
BrickletARINC429#write_frame_scheduled(channel, frame_index, frame) → nil
Parameters:
  • channel – Type: int, Range: See constants
  • frame_index – Type: int, Range: [0 to 216 - 1]
  • frame – Type: int, Range: [0 to 232 - 1]
Set or update an Arinc429 frame that is transmitted by the scheduler using the task types 'Single' and 'Cyclic'.
  • Channel: selected transmit channel.
  • Frame Index: index number that will be used in the transmit scheduler task table to refer to this frame.
  • frame: complete Arinc429 frame including the label and SDI bits. If 'parity_auto' is set for the channel, the parity bit will be set (adjusted) automatically.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44
BrickletARINC429#clear_schedule_entries(channel, task_index_first, task_index_last) → nil
Parameters:
  • channel – Type: int, Range: See constants
  • task_index_first – Type: int, Range: [0 to 216 - 1]
  • task_index_last – Type: int, Range: [0 to 216 - 1]
Clear a range of transmit scheduler task table entries:
  • Channel: selected TX channel.
  • First: index of the first table entry to be cleared.
  • Last: index of the last table entry to be cleared.

To clear a single entry, set 'First' and 'Last' to the one index of the one entry to be cleared.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44
BrickletARINC429#set_schedule_entry(channel, task_index, job, frame_index, dwell_time) → nil
Parameters:
  • channel – Type: int, Range: See constants
  • task_index – Type: int, Range: [0 to 216 - 1]
  • job – Type: int, Range: See constants
  • frame_index – Type: int, Range: [0 to 216 - 1]
  • dwell_time – Type: int, Unit: 1/250 s, Range: [0 to 255], Default: 10
Set an entry in the transmit scheduler task table:
  • Channel: selected TX channel
  • Task Index: index number of the task, the scheduler processes the task table in ascending order of these index numbers.
  • Job: activity assigned to this entry, see below.
  • Frame Index: frame assigned to this task, either the 'Frame Index' used along with the :func: Write Frame Scheduled or the extended label (label + SDI) in case of RX1/RX2 retransmits.
  • Dwell Time: time to wait before executing the next task table entry (0-250 milliseconds).

When the scheduler is set to 'run' mode via the #set_channel_mode, it continuously loops through the task table and executes the assigned tasks. It starts with the task stored at task index 0. The scheduler can execute the following activity types (jobs):

  • Skip: the task is skipped, i.e. no frame is transmitted and no dwelling is done. The frame index and dwell time are not used.
  • Dwell the scheduler executes the dwelling but does not transmit any frame. The frame index is not used.
  • Single: the scheduler transmits the referenced frame, but only once. On subsequent executions the frame is not sent until it is renewed via the #write_frame_scheduled, then the process repeats.
  • Cyclic: the scheduler transmits the referenced frame and executed the dwelling on each round.
  • Retrans RX1: the scheduler retransmits a frame that was previously received on the RX1 channel. The frame to send is referenced by setting the 'Frame Index' to its extended label code, which is a 10 bit number made of the label code in the lower bits and the two SDI bits in the upper bits. If the SDI bits are used for data, set the SDI bits to zero. As long as the referenced frame was not received yet, or if it is in timeout, no frame will be sent.
  • Retrans RX2: same as before, but for frames received on the RX2 channel.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44

For job:

  • BrickletARINC429::SCHEDULER_JOB_SKIP = 0
  • BrickletARINC429::SCHEDULER_JOB_DWELL = 1
  • BrickletARINC429::SCHEDULER_JOB_SINGLE = 2
  • BrickletARINC429::SCHEDULER_JOB_CYCLIC = 3
  • BrickletARINC429::SCHEDULER_JOB_RETRANS_RX1 = 4
  • BrickletARINC429::SCHEDULER_JOB_RETRANS_RX2 = 5
BrickletARINC429#get_schedule_entry(channel, task_index) → [int, int, int, int]
Parameters:
  • channel – Type: int, Range: See constants
  • task_index – Type: int, Range: [0 to 216 - 1]
Return Array:
  • 0: job – Type: int, Range: See constants
  • 1: frame_index – Type: int, Range: [0 to 216 - 1]
  • 2: frame – Type: int, Range: [0 to 232 - 1]
  • 3: dwell_time – Type: int, Unit: 1/250 s, Range: [0 to 255], Default: 10

Get a transmit scheduler task table entry.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44

For job:

  • BrickletARINC429::SCHEDULER_JOB_SKIP = 0
  • BrickletARINC429::SCHEDULER_JOB_DWELL = 1
  • BrickletARINC429::SCHEDULER_JOB_SINGLE = 2
  • BrickletARINC429::SCHEDULER_JOB_CYCLIC = 3
  • BrickletARINC429::SCHEDULER_JOB_RETRANS_RX1 = 4
  • BrickletARINC429::SCHEDULER_JOB_RETRANS_RX2 = 5
BrickletARINC429#reset_a429(mode) → nil
Parameters:
  • mode – Type: int, Range: See constants, Default: 0
Reset the A429 bricklet. The bricklet will restart in the selected mode:
  • 'Normal': normal operating mode with all high-level Arinc429 frame processing being executed.
  • 'Debug': debug mode with all high-level processing suspended, for use in conjunction with the low-level debug functions.

The following constants are available for this function:

For mode:

  • BrickletARINC429::A429_MODE_NORMAL = 0
  • BrickletARINC429::A429_MODE_DEBUG = 1

Advanced Functions

BrickletARINC429#get_spitfp_error_count → [int, int, int, int]
Return Array:
  • 0: error_count_ack_checksum – Type: int, Range: [0 to 232 - 1]
  • 1: error_count_message_checksum – Type: int, Range: [0 to 232 - 1]
  • 2: error_count_frame – Type: int, Range: [0 to 232 - 1]
  • 3: error_count_overflow – Type: int, Range: [0 to 232 - 1]

Returns the error count for the communication between Brick and Bricklet.

The errors are divided into

  • ACK checksum errors,
  • message checksum errors,
  • framing errors and
  • overflow errors.

The errors counts are for errors that occur on the Bricklet side. All Bricks have a similar function that returns the errors on the Brick side.

BrickletARINC429#set_status_led_config(config) → nil
Parameters:
  • config – Type: int, Range: See constants, Default: 3

Sets the status LED configuration. By default the LED shows communication traffic between Brick and Bricklet, it flickers once for every 10 received data packets.

You can also turn the LED permanently on/off or show a heartbeat.

If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.

The following constants are available for this function:

For config:

  • BrickletARINC429::STATUS_LED_CONFIG_OFF = 0
  • BrickletARINC429::STATUS_LED_CONFIG_ON = 1
  • BrickletARINC429::STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2
  • BrickletARINC429::STATUS_LED_CONFIG_SHOW_STATUS = 3
BrickletARINC429#get_status_led_config → int
Returns:
  • config – Type: int, Range: See constants, Default: 3

Returns the configuration as set by #set_status_led_config

The following constants are available for this function:

For config:

  • BrickletARINC429::STATUS_LED_CONFIG_OFF = 0
  • BrickletARINC429::STATUS_LED_CONFIG_ON = 1
  • BrickletARINC429::STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2
  • BrickletARINC429::STATUS_LED_CONFIG_SHOW_STATUS = 3
BrickletARINC429#get_chip_temperature → int
Returns:
  • temperature – Type: int, Unit: 1 °C, Range: [-215 to 215 - 1]

Returns the temperature as measured inside the microcontroller. The value returned is not the ambient temperature!

The temperature is only proportional to the real temperature and it has bad accuracy. Practically it is only useful as an indicator for temperature changes.

BrickletARINC429#reset → nil

Calling this function will reset the Bricklet. All configurations will be lost.

After a reset you have to create new device objects, calling functions on the existing ones will result in undefined behavior!

BrickletARINC429#get_identity → [str, str, chr, [int, ...], [int, ...], int]
Return Array:
  • 0: uid – Type: str, Length: up to 8
  • 1: connected_uid – Type: str, Length: up to 8
  • 2: position – Type: chr, Range: ['a' to 'h', 'z']
  • 3: hardware_version – Type: [int, ...], Length: 3
    • 0: major – Type: int, Range: [0 to 255]
    • 1: minor – Type: int, Range: [0 to 255]
    • 2: revision – Type: int, Range: [0 to 255]
  • 4: firmware_version – Type: [int, ...], Length: 3
    • 0: major – Type: int, Range: [0 to 255]
    • 1: minor – Type: int, Range: [0 to 255]
    • 2: revision – Type: int, Range: [0 to 255]
  • 5: device_identifier – Type: int, Range: [0 to 216 - 1]

Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.

The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an Isolator Bricklet is always at position 'z'.

The device identifier numbers can be found here. There is also a constant for the device identifier of this Bricklet.

Callback Configuration Functions

BrickletARINC429#register_callback(callback_id) { |param [, ...]| block } → nil
Parameters:
  • callback_id – Type: int

Registers the given block with the given callback_id.

The available callback IDs with corresponding function signatures are listed below.

BrickletARINC429#set_heartbeat_callback_configuration(period, value_has_to_change) → nil
Parameters:
  • period – Type: int, Unit: 1/60 s, Range: [0 to 255], Default: 0
  • value_has_to_change – Type: bool, Default: false

Set the bricklet heartbeat which reports the statistics counters for processed frames and lost frames. The period is the period with which the ::CALLBACK_HEARTBEAT callback is triggered periodically. A value of 0 turns the callback off. When 'Value Has To Change' is enabled, the heartbeat will only be sent if there is a change in the statistics numbers.

BrickletARINC429#get_heartbeat_callback_configuration → [int, bool]
Return Array:
  • 0: period – Type: int, Unit: 1/60 s, Range: [0 to 255], Default: 0
  • 1: value_has_to_change – Type: bool, Default: false

Get the configuration of the bricklet heartbeat reporting the statistics counters.

BrickletARINC429#set_rx_callback_configuration(channel, enabled, value_has_to_change, timeout) → nil
Parameters:
  • channel – Type: int, Range: See constants
  • enabled – Type: bool, Default: false
  • value_has_to_change – Type: bool, Default: false
  • timeout – Type: int, Unit: 1/60 ms, Range: [0 to 216 - 1], Default: 1000
Set the configuration of the Arinc429 frame reception callback:
  • Channel: selected RX channel.
  • Enabled: select 'True' for activating the frame callbacks and 'False' for deactivating them.
  • Value Has To Change: select 'True' if callbacks shall only be sent for frames whose data have changed. With 'False' a callback will be sent on every frame reception.
  • Timeout: time period for all frames (label and SDI combinations) on this channel.

Despite on frame reception, a callback is also generated if a frame encounters a timeout, i.e. if it is not periodically received again before the set timeout period has expired. In order to have callbacks being generated at all, respective receive filters need to be set up.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44
BrickletARINC429#get_rx_callback_configuration(channel) → [bool, bool, int]
Parameters:
  • channel – Type: int, Range: See constants
Return Array:
  • 0: enabled – Type: bool, Default: false
  • 1: value_has_to_change – Type: bool, Default: false
  • 2: timeout – Type: int, Unit: 1/60 ms, Range: [0 to 216 - 1], Default: 1000

Get the configuration of the frame reception callback.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44

Callbacks

Callbacks can be registered to receive time critical or recurring data from the device. The registration is done with the #register_callback function of the device object. The first parameter is the callback ID and the second parameter is a block:

arinc429.register_callback BrickletARINC429::CALLBACK_EXAMPLE, do |param|
  puts "#{param}"
end

The available constants with inherent number and type of parameters are described below.

Note

Using callbacks for recurring events is always preferred compared to using getters. It will use less USB bandwidth and the latency will be a lot better, since there is no round trip time.

BrickletARINC429::CALLBACK_HEARTBEAT
Callback Parameters:
  • seq_number – Type: int, Range: [0 to 255]
  • timestamp – Type: int, Range: [0 to 216 - 1]
  • frames_processed – Type: [int, ...], Length: 3, Range: [0 to 216 - 1]
  • frames_lost – Type: [int, ...], Length: 3, Range: [0 to 216 - 1]

This callback is triggered periodically according to the configuration set by #set_heartbeat_callback_configuration. It reports the statistics counters for processed frames and lost frames for all TX and RX channels.

  • Seq Number: running counter that is incremented with each callback, starting with 0 and rolling over after 255 to 1. It will restart from 0 whenever the heartbeat is turned off and on again. This counter can be used to detect lost callbacks.
  • Timestamp: running counter that is incremented on every millisecond, starting when the bricklet is powered up and rolling over after 65535 to 0. This counter can be used to measure the relative timing between events.
  • Frames Processed: number of Arinc429 frames that are transmitted or received on the respective channels TX, RX1 and RX2.
  • Frames Lost: TX channel: number of Arinc429 frames that could not be transmitted due to a full transmit buffer, RX channels: number of received Arinc429 frames that could not be reported due to a full callback buffer.
BrickletARINC429::CALLBACK_FRAME_MESSAGE
Callback Parameters:
  • channel – Type: int, Range: See constants
  • seq_number – Type: int, Range: [0 to 255]
  • timestamp – Type: int, Range: [0 to 216 - 1]
  • frame_status – Type: int, Range: See constants
  • frame – Type: int, Range: [0 to 232 - 1]
  • age – Type: int, Unit: 1/60 ms, Range: [0 to 216 - 1]
This callback is triggered according to the configuration set by #set_rx_callback_configuration.
  • Channel: RX channel on which the frame was received.
  • Seq Number: running counter that is incremented with each callback, starting with 0 and rolling over after 255 to 1. It will restart from 0 whenever the callback is turned off and on again. This counter can be used to detect lost callbacks.
  • Timestamp: running counter that is incremented on every millisecond, starting when the bricklet is powered up and rolling over after 65535 to 0. This counter can be used to measure the relative timing between frame receptions.
  • Frame Status: 'update' signals that a new frame (new data) was received, whereas 'timeout' signals that the frame (label and SDI combination) encountered the timeout state.
  • Frame: the complete Arinc429 frame including the label and SDI bits. If 'parity_auto' is set for the channel, the parity bit will always come as 0.
  • Age: time in milliseconds since this frame (label + SDI combination) was received last. If not received for so far or after a previous timeout, 60000 or the timeout value set with the 'Set RX Callback Configuration' function will be returned.

The following constants are available for this function:

For channel:

  • BrickletARINC429::CHANNEL_TX = 0
  • BrickletARINC429::CHANNEL_TX1 = 1
  • BrickletARINC429::CHANNEL_TX2 = 2
  • BrickletARINC429::CHANNEL_TX3 = 3
  • BrickletARINC429::CHANNEL_TX4 = 4
  • BrickletARINC429::CHANNEL_TX5 = 5
  • BrickletARINC429::CHANNEL_TX6 = 6
  • BrickletARINC429::CHANNEL_TX7 = 7
  • BrickletARINC429::CHANNEL_TX8 = 8
  • BrickletARINC429::CHANNEL_TX9 = 9
  • BrickletARINC429::CHANNEL_TX10 = 10
  • BrickletARINC429::CHANNEL_TX11 = 11
  • BrickletARINC429::CHANNEL_TX12 = 12
  • BrickletARINC429::CHANNEL_RX = 32
  • BrickletARINC429::CHANNEL_RX1 = 33
  • BrickletARINC429::CHANNEL_RX2 = 34
  • BrickletARINC429::CHANNEL_RX3 = 35
  • BrickletARINC429::CHANNEL_RX4 = 36
  • BrickletARINC429::CHANNEL_RX5 = 37
  • BrickletARINC429::CHANNEL_RX6 = 38
  • BrickletARINC429::CHANNEL_RX7 = 39
  • BrickletARINC429::CHANNEL_RX8 = 40
  • BrickletARINC429::CHANNEL_RX9 = 41
  • BrickletARINC429::CHANNEL_RX10 = 42
  • BrickletARINC429::CHANNEL_RX11 = 43
  • BrickletARINC429::CHANNEL_RX12 = 44

For frame_status:

  • BrickletARINC429::FRAME_STATUS_UPDATE = 0
  • BrickletARINC429::FRAME_STATUS_TIMEOUT = 1

Virtual Functions

Virtual functions don't communicate with the device itself, but operate only on the API bindings device object. They can be called without the corresponding IP Connection object being connected.

BrickletARINC429#get_api_version → [int, ...]
Return Array:
  • 0: api_version – Type: [int, ...], Length: 3
    • 0: major – Type: int, Range: [0 to 255]
    • 1: minor – Type: int, Range: [0 to 255]
    • 2: revision – Type: int, Range: [0 to 255]

Returns the version of the API definition implemented by this API bindings. This is neither the release version of this API bindings nor does it tell you anything about the represented Brick or Bricklet.

BrickletARINC429#get_response_expected(function_id) → bool
Parameters:
  • function_id – Type: int, Range: See constants
Returns:
  • response_expected – Type: bool

Returns the response expected flag for the function specified by the function ID parameter. It is true if the function is expected to send a response, false otherwise.

For getter functions this is enabled by default and cannot be disabled, because those functions will always send a response. For callback configuration functions it is enabled by default too, but can be disabled by #set_response_expected. For setter functions it is disabled by default and can be enabled.

Enabling the response expected flag for a setter function allows to detect timeouts and other error conditions calls of this setter as well. The device will then send a response for this purpose. If this flag is disabled for a setter function then no response is sent and errors are silently ignored, because they cannot be detected.

The following constants are available for this function:

For function_id:

  • BrickletARINC429::FUNCTION_SET_HEARTBEAT_CALLBACK_CONFIGURATION = 5
  • BrickletARINC429::FUNCTION_SET_CHANNEL_CONFIGURATION = 8
  • BrickletARINC429::FUNCTION_SET_CHANNEL_MODE = 10
  • BrickletARINC429::FUNCTION_CLEAR_ALL_RX_FILTERS = 12
  • BrickletARINC429::FUNCTION_SET_RX_STANDARD_FILTERS = 14
  • BrickletARINC429::FUNCTION_SET_RX_CALLBACK_CONFIGURATION = 18
  • BrickletARINC429::FUNCTION_WRITE_FRAME_DIRECT = 21
  • BrickletARINC429::FUNCTION_WRITE_FRAME_SCHEDULED = 22
  • BrickletARINC429::FUNCTION_CLEAR_SCHEDULE_ENTRIES = 23
  • BrickletARINC429::FUNCTION_SET_SCHEDULE_ENTRY = 24
  • BrickletARINC429::FUNCTION_RESET_A429 = 26
  • BrickletARINC429::FUNCTION_SET_WRITE_FIRMWARE_POINTER = 237
  • BrickletARINC429::FUNCTION_SET_STATUS_LED_CONFIG = 239
  • BrickletARINC429::FUNCTION_RESET = 243
  • BrickletARINC429::FUNCTION_WRITE_UID = 248
BrickletARINC429#set_response_expected(function_id, response_expected) → nil
Parameters:
  • function_id – Type: int, Range: See constants
  • response_expected – Type: bool

Changes the response expected flag of the function specified by the function ID parameter. This flag can only be changed for setter (default value: false) and callback configuration functions (default value: true). For getter functions it is always enabled.

Enabling the response expected flag for a setter function allows to detect timeouts and other error conditions calls of this setter as well. The device will then send a response for this purpose. If this flag is disabled for a setter function then no response is sent and errors are silently ignored, because they cannot be detected.

The following constants are available for this function:

For function_id:

  • BrickletARINC429::FUNCTION_SET_HEARTBEAT_CALLBACK_CONFIGURATION = 5
  • BrickletARINC429::FUNCTION_SET_CHANNEL_CONFIGURATION = 8
  • BrickletARINC429::FUNCTION_SET_CHANNEL_MODE = 10
  • BrickletARINC429::FUNCTION_CLEAR_ALL_RX_FILTERS = 12
  • BrickletARINC429::FUNCTION_SET_RX_STANDARD_FILTERS = 14
  • BrickletARINC429::FUNCTION_SET_RX_CALLBACK_CONFIGURATION = 18
  • BrickletARINC429::FUNCTION_WRITE_FRAME_DIRECT = 21
  • BrickletARINC429::FUNCTION_WRITE_FRAME_SCHEDULED = 22
  • BrickletARINC429::FUNCTION_CLEAR_SCHEDULE_ENTRIES = 23
  • BrickletARINC429::FUNCTION_SET_SCHEDULE_ENTRY = 24
  • BrickletARINC429::FUNCTION_RESET_A429 = 26
  • BrickletARINC429::FUNCTION_SET_WRITE_FIRMWARE_POINTER = 237
  • BrickletARINC429::FUNCTION_SET_STATUS_LED_CONFIG = 239
  • BrickletARINC429::FUNCTION_RESET = 243
  • BrickletARINC429::FUNCTION_WRITE_UID = 248
BrickletARINC429#set_response_expected_all(response_expected) → nil
Parameters:
  • response_expected – Type: bool

Changes the response expected flag for all setter and callback configuration functions of this device at once.

Internal Functions

Internal functions are used for maintenance tasks such as flashing a new firmware of changing the UID of a Bricklet. These task should be performed using Brick Viewer instead of using the internal functions directly.

BrickletARINC429#set_bootloader_mode(mode) → int
Parameters:
  • mode – Type: int, Range: See constants
Returns:
  • status – Type: int, Range: See constants

Sets the bootloader mode and returns the status after the requested mode change was instigated.

You can change from bootloader mode to firmware mode and vice versa. A change from bootloader mode to firmware mode will only take place if the entry function, device identifier and CRC are present and correct.

This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.

The following constants are available for this function:

For mode:

  • BrickletARINC429::BOOTLOADER_MODE_BOOTLOADER = 0
  • BrickletARINC429::BOOTLOADER_MODE_FIRMWARE = 1
  • BrickletARINC429::BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT = 2
  • BrickletARINC429::BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT = 3
  • BrickletARINC429::BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT = 4

For status:

  • BrickletARINC429::BOOTLOADER_STATUS_OK = 0
  • BrickletARINC429::BOOTLOADER_STATUS_INVALID_MODE = 1
  • BrickletARINC429::BOOTLOADER_STATUS_NO_CHANGE = 2
  • BrickletARINC429::BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT = 3
  • BrickletARINC429::BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT = 4
  • BrickletARINC429::BOOTLOADER_STATUS_CRC_MISMATCH = 5
BrickletARINC429#get_bootloader_mode → int
Returns:
  • mode – Type: int, Range: See constants

Returns the current bootloader mode, see #set_bootloader_mode.

The following constants are available for this function:

For mode:

  • BrickletARINC429::BOOTLOADER_MODE_BOOTLOADER = 0
  • BrickletARINC429::BOOTLOADER_MODE_FIRMWARE = 1
  • BrickletARINC429::BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT = 2
  • BrickletARINC429::BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT = 3
  • BrickletARINC429::BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT = 4
BrickletARINC429#set_write_firmware_pointer(pointer) → nil
Parameters:
  • pointer – Type: int, Unit: 1 B, Range: [0 to 232 - 1]

Sets the firmware pointer for #write_firmware. The pointer has to be increased by chunks of size 64. The data is written to flash every 4 chunks (which equals to one page of size 256).

This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.

BrickletARINC429#write_firmware(data) → int
Parameters:
  • data – Type: [int, ...], Length: 64, Range: [0 to 255]
Returns:
  • status – Type: int, Range: [0 to 255]

Writes 64 Bytes of firmware at the position as written by #set_write_firmware_pointer before. The firmware is written to flash every 4 chunks.

You can only write firmware in bootloader mode.

This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.

BrickletARINC429#write_uid(uid) → nil
Parameters:
  • uid – Type: int, Range: [0 to 232 - 1]

Writes a new UID into flash. If you want to set a new UID you have to decode the Base58 encoded UID string into an integer first.

We recommend that you use Brick Viewer to change the UID.

BrickletARINC429#read_uid → int
Returns:
  • uid – Type: int, Range: [0 to 232 - 1]

Returns the current UID as an integer. Encode as Base58 to get the usual string version.

Constants

BrickletARINC429::DEVICE_IDENTIFIER

This constant is used to identify a ARINC429 Bricklet.

The #get_identity() function and the IPConnection::CALLBACK_ENUMERATE callback of the IP Connection have a device_identifier parameter to specify the Brick's or Bricklet's type.

BrickletARINC429::DEVICE_DISPLAY_NAME

This constant represents the human readable name of a ARINC429 Bricklet.