Perl - 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 Perl 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 Perl API bindings is part of their general description.

API

Generally, every subroutine of the Perl bindings can report an error as Tinkerforge::Error object via croak(). The object has a get_code() and a get_message() subroutine. There are different error code:

  • Error->ALREADY_CONNECTED = 11
  • Error->NOT_CONNECTED = 12
  • Error->CONNECT_FAILED = 13
  • Error->INVALID_FUNCTION_ID = 21
  • Error->TIMEOUT = 31
  • Error->INVALID_PARAMETER = 41
  • Error->FUNCTION_NOT_SUPPORTED = 42
  • Error->UNKNOWN_ERROR = 43
  • Error->STREAM_OUT_OF_SYNC = 51
  • Error->INVALID_UID = 61
  • Error->NON_ASCII_CHAR_IN_SECRET = 71
  • Error->WRONG_DEVICE_TYPE = 81
  • Error->DEVICE_REPLACED = 82
  • Error->WRONG_RESPONSE_LENGTH = 83

All functions listed below are thread-safe.

Basic Functions

BrickletARINC429->new($uid, $ipcon)
Parameters:
  • $uid – Type: string
  • $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->get_capabilities()
Return Array:
  • 0: $tx_total_scheduler_jobs – Type: int, Range: [0 to 216 - 1]
  • 1: $tx_used_scheduler_jobs – 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]

Gets the capabilities of the ARINC429 Bricklet as of the currently loaded firmware:

  • TX Total Scheduler Jobs: total number of job entries in the scheduling table.
  • TX Used Scheduler Jobs: number of job 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)
Parameters:
  • $channel – Type: int, Range: See constants
  • $parity – Type: int, Range: See constants
  • $speed – Type: int, Range: See constants
Returns:
  • undef

Sets 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_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

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)
Parameters:
  • $channel – Type: int, Range: See constants
Return Array:
  • 0: $parity – Type: int, Range: See constants
  • 1: $speed – Type: int, Range: See constants

Gets the data transmission properties of the selected channel. The channel parameter and the data returned use the same constants as the set_channel_configuration(), despite that the all-channels constants CHANNEL_TX and CHANNEL_RX can not be used.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

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)
Parameters:
  • $channel – Type: int, Range: See constants
  • $mode – Type: int, Range: See constants
Returns:
  • undef

Sets the operating mode of the selected channel(s):

  • 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 job table.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

For $mode:

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

Gets the operating mode of the selected channel. The channel parameter and the data returned use the same constants as the set_channel_configuration(), despite that the all-channels constants CHANNEL_TX and CHANNEL_RX can not be used.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

For $mode:

  • BrickletARINC429->CHANNEL_MODE_PASSIVE = 0
  • BrickletARINC429->CHANNEL_MODE_ACTIVE = 1
  • BrickletARINC429->CHANNEL_MODE_RUN = 2
BrickletARINC429->clear_all_rx_filters($channel)
Parameters:
  • $channel – Type: int, Range: See constants
Returns:
  • undef

Clears all receive filters on the selected RX channel(s). The RX channels will only process those Arinc429 frames that pass the input filtering stage. With this command, all filters are cleared, thus all incoming Arinc429 frames will be blocked from further processing.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34
BrickletARINC429->clear_rx_filter($channel, $label, $sdi)
Parameters:
  • $channel – Type: int, Range: See constants
  • $label – Type: int, Range: [0 to 255]
  • $sdi – Type: int, Range: See constants
Returns:
  • $success – Type: bool

Clears a specific receive filter on the selected RX channel(s). The RX channels will only process those Arinc429 frames that pass the input filtering stage. With this command, an Arinc429 frame matching the given parameters will be blocked by the filter.

  • 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).

The function either 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_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

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)
Parameters:
  • $channel – Type: int, Range: See constants
Returns:
  • undef

Sets a receive filter for each label value (0-255 / 0o000-0o377) with the 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_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34
BrickletARINC429->set_rx_filter($channel, $label, $sdi)
Parameters:
  • $channel – Type: int, Range: See constants
  • $label – Type: int, Range: [0 to 255]
  • $sdi – Type: int, Range: See constants
Returns:
  • $success – Type: bool

Sets a specific receive filter on the selected channel(s):

  • 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).

The function either returns 'True' if the filter was set or 'False' if a respective filter could not be created e.g. because the given combination of label and SDI collides with an already existing filter, or because all available filters are used up (see the get_capabilities() function).

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

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)
Parameters:
  • $channel – Type: int, Range: See constants
  • $label – Type: int, Range: [0 to 255]
  • $sdi – Type: int, Range: See constants
Returns:
  • $configured – Type: bool

Queries if a filter for the given combination of label and SDI 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).

The function will return 'True' if the queried filter filter exists, else 'False'.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

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)
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 ms, Range: [0 to 216 - 1]

Executes a 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. Beware that the label codes are usually given in octal notation, so make sure to use the correct notation (i.e. 0o377).
  • SDI: SDI code of the frame to read (SDI_SDI0 to SDI_SDI3 or SDI_DATA if SDI bits are used for data).

The function return the following data:

  • Status: returns 'True' if a respective frame was received, else 'False'.
  • Frame: returns the complete Arinc429 frame including the label and SDI bits as a 32 bit integer. If 'parity_auto' is set for the channel, the parity bit will always come as 0. Opposite to the line transmission format, in the API functions the label code is mirrored such that the label code can be directly extracted from the frame by simply grabbing the lower 8 bits.
  • Age: time in milliseconds since a frame matching the label & SDI combination was received last. If no frame was received so far or after a previous timeout, either 60000 or the timeout value set with the set_rx_callback_configuration() will be returned.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

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)
Parameters:
  • $channel – Type: int, Range: See constants
  • $frame – Type: int, Range: [0 to 232 - 1]
Returns:
  • undef

Immediately transmits an Arinc429 frame, given that the channel is in either ACTIVE or RUN mode. If the channel is in RUN mode and frames are sent as per programmed schedule, using this function will inject additional frames into the transmission, independent of the scheduler's activities.

  • Channel: selected transmit channel, either CHANNEL_TX or CHANNEL_TX1 can be used as there is only one TX channel.
  • frame: complete Arinc429 frame including the label and SDI bits.

The frame needs to be passed as a 32 bit integer. Opposite to the line transmission format, in the API functions the label code is mirrored such that the label code can be directly written 1:1 into the lower 8 bits. Beware that the label codes are usually given in octal notation, so make sure to use the correct notation (i.e. 0o377). If 'parity_auto' is set for the channel, the parity bit will be set (adjusted) automatically.

Between the API and the actual Arinc429 line output, there is a 32 entry deep FIFO. If frames are written via the API and/or in combination with a running TX scheduler, the FIFO may become overfilled and subsequently frames will get lost. Such frame losses will be indicated in the statistics data sent with the heartbeat callback.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34
BrickletARINC429->write_frame_scheduled($channel, $frame_index, $frame)
Parameters:
  • $channel – Type: int, Range: See constants
  • $frame_index – Type: int, Range: [0 to 216 - 1]
  • $frame – Type: int, Range: [0 to 232 - 1]
Returns:
  • undef

Sets or updates an Arinc429 frame that is to be transmitted via the scheduler using the scheduler job types 'Single' or 'Cyclic'.

  • Channel: selected transmit channel, either CHANNEL_TX or CHANNEL_TX1 can be used as there is only one TX channel.
  • Frame Index: index number (0-255) that will be used in the transmit scheduler job table to refer to this frame.
  • Frame: complete Arinc429 frame including the label and SDI bits.

The frame needs to be passed as a 32 bit integer. Opposite to the line transmission format, in the API functions the label code is mirrored such that the label code can be directly written 1:1 into the lower 8 bits. Beware that the label codes are usually given in octal notation, so make sure to use the correct notation (i.e. 0o377). If 'parity_auto' is set for the channel, the parity bit will be set (adjusted) automatically.

If the frame is used by a 'single transmit' scheduler job entry, setting or updating the frame with this function arms the frame for its next transmission.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34
BrickletARINC429->clear_schedule_entries($channel, $job_index_first, $job_index_last)
Parameters:
  • $channel – Type: int, Range: See constants
  • $job_index_first – Type: int, Range: [0 to 216 - 1]
  • $job_index_last – Type: int, Range: [0 to 216 - 1]
Returns:
  • undef

Clears a range of transmit scheduler job 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. Clearing scheduler entries actually means they are set to the job command 'Skip'.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34
BrickletARINC429->set_schedule_entry($channel, $job_index, $job, $frame_index, $dwell_time)
Parameters:
  • $channel – Type: int, Range: See constants
  • $job_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 ms, Range: [0 to 255]
Returns:
  • undef

Sets an entry in the transmit scheduler job table:

  • Channel: selected TX channel, either CHANNEL_TX or CHANNEL_TX1 can be used as there is only one TX channel.
  • Job Index: index number of the job, the scheduler processes the job table in ascending order of these index numbers. The index starts with 0, see the output of get_capabilities() function for the total number of job indexes available. In firmware 2.4.0 it is 1000.
  • Job: activity assigned to this entry, see below.
  • Frame Index: generally, the frame assigned to this job by the 'Frame Index' used along with the write_frame_scheduled().
    In case of a RX1 or RX2 retransmit job, the extended label (label + SDI) of the frame to be retransmitted. In case of the Jump command, the Job Index at which execution shall continue. In case of the Callback command, this number will be sent as 'Token' code (values 0-255 only). In all other cases (Skip, Stop, Dwell, Return) this parameter is not used.
  • Dwell Time: time to wait before executing the next job table entry (0-250 milliseconds).

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

  • Skip: the job is skipped, i.e. no frame is transmitted and no dwelling is done. The frame index and dwell time are not used.
  • Stop: the scheduler is stopped, i.e. the channel mode is reverted from 'run' to 'active'. The frame index and dwell time are not used.
  • Jump: the scheduler immediately continues at the Job Index position given by the Frame Index parameter. The assigned dwell time will be executed when the scheduler runs into the next Return job.
  • Return: the scheduler immediately continues at the next Job Index position following the last Jump command. Nested Jumps are not supported. The frame index and dwell time are not used.
  • Callback: the scheduler triggers a callback message and immediately continues with executing the next job (dwell time is 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 executs 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 value assigned to the 'Frame Index' parameter varies with the activity type (job):

  • Single or Cyclic: frame index as used with the write_frame_scheduled() of the frame to transmit. Valid range: 0-255
  • Retrans RX1/RX2: extended label (label + SDI) of the frame to re-transmit. Valid range: 0-1023
  • Callback: arbitrary number decided by the user, it will be reported in the callback via the 'Userdata' parameter. Valid range: 0-255
  • Jump: next job index to jump to.

The set_schedule_entry() can be called while the TX scheduler is running, i.e. the channel mode is set to 'RUN'. Any change will take immediate effect once the scheduler passes along and executes the changed job entry. Every time the scheduler is started, it will begin with the job stored at job index 0. At the end of the programmed schedule there should be a 'Jump' command back to index 0 to avoid the scheduler wasting time in processing all the remaining 'Skip' commands. Two or more TX schedules can be pre-programmed and then selected for execution by placing - and changing as desired - a 'Jump' at index 0 that then branches to the sequence of commands destined to be executed. This can be arranged in arbitrary ways, e.g. to create schedules with fixed and variable parts, just by using the 'Jump' command alike a track switch in railway.

When the dwell time of a transmit command is set to zero, the respective Arinc429 frames will be transmitted back-to-back on the physical link. Beware that there is a FIFO between the scheduler and the actual physical transmitter that is limited to 32 frames. So after latest 32 frames enqueued with zero dwell time, the scheduler needs to be commanded to do some dwelling. How much dwelling is required can be computed by the number of back-to-back frames and the speed setting: in high speed mode each frame takes 0.36 ms, in low speed mode 2.88 ms. If a certain sequence of frames is to be transmitted multiple times in a schedule, this sequence just needs to be put once into the scheduler table with a 'Return' command at its end. This way, this sequence can be called from multiple placed (job indexes) throughout the main schedule using the 'Jump' command. Please note that this kind of calling a subroutine can not be nested, i.e. there is no return index stack, the 'Return' command always branches to the job index following the index of the last 'Jump' command encountered. In case a dwell time > 0 is set with the 'Jump' command, this dwell time will actually be executed on encountering the 'Return' command, thus as a dwell time to be done after the execution of the subsequence that was jumped to before.

The 'Callback' command can be used to notify the application program via a callback when the scheduler passes at the respective job index. This can be used for pure reporting / surveillance purpose, or as a means to set up a self-clocked system in which the called application program's function in return does some modification of the programmed sequence or alike. The scheduler can also be programmed to stop itself via the 'Stop' command, e.g. to run a pre-programmed, accurately timed single-shot sequence of frame transmissions. Placing a' Callback' command right before the 'Stop' command will inform the application program via a callback when the sequence is done. When using several 'Callback' commands in a schedule, each of them can be uniquely identified in the receiving application program by assigning a different 'userdata' value to each callback command.

With the aid of the 'Retrans' commands, a frame transmission schedule can be set up whose frame timing is defined by the schedule, but whose frame's payload is taken from the frames received via the RX1 or RX2 channel. This opens possibilities to create an autonomously operating time base corrector or re-scheduling machinery, to zip the frames from two A429 buses onto one common bus, to create inline filers to remove certain frames (by their label & SDI code), to insert frames into a stream, to exchange the payload of certain frames on-the-fly, and much more.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

For $job:

  • BrickletARINC429->SCHEDULER_JOB_SKIP = 0
  • BrickletARINC429->SCHEDULER_JOB_CALLBACK = 1
  • BrickletARINC429->SCHEDULER_JOB_STOP = 2
  • BrickletARINC429->SCHEDULER_JOB_JUMP = 3
  • BrickletARINC429->SCHEDULER_JOB_RETURN = 4
  • BrickletARINC429->SCHEDULER_JOB_DWELL = 5
  • BrickletARINC429->SCHEDULER_JOB_SINGLE = 6
  • BrickletARINC429->SCHEDULER_JOB_CYCLIC = 7
  • BrickletARINC429->SCHEDULER_JOB_RETRANS_RX1 = 8
  • BrickletARINC429->SCHEDULER_JOB_RETRANS_RX2 = 9
BrickletARINC429->get_schedule_entry($channel, $job_index)
Parameters:
  • $channel – Type: int, Range: See constants
  • $job_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 ms, Range: [0 to 255]

Gets the definition of a transmit scheduler job table entry, refer to the set_schedule_entry().

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

For $job:

  • BrickletARINC429->SCHEDULER_JOB_SKIP = 0
  • BrickletARINC429->SCHEDULER_JOB_CALLBACK = 1
  • BrickletARINC429->SCHEDULER_JOB_STOP = 2
  • BrickletARINC429->SCHEDULER_JOB_JUMP = 3
  • BrickletARINC429->SCHEDULER_JOB_RETURN = 4
  • BrickletARINC429->SCHEDULER_JOB_DWELL = 5
  • BrickletARINC429->SCHEDULER_JOB_SINGLE = 6
  • BrickletARINC429->SCHEDULER_JOB_CYCLIC = 7
  • BrickletARINC429->SCHEDULER_JOB_RETRANS_RX1 = 8
  • BrickletARINC429->SCHEDULER_JOB_RETRANS_RX2 = 9
BrickletARINC429->restart()
Returns:
  • undef

Reverts the whole bricklet into its power-up default state.

BrickletARINC429->set_frame_mode($channel, $frame_index, $mode)
Parameters:
  • $channel – Type: int, Range: See constants
  • $frame_index – Type: int, Range: [0 to 216 - 1]
  • $mode – Type: int, Range: See constants
Returns:
  • undef

Stops / resumes the transmission of a specific frame or trigger another single-transmit. This function only works on frames that are sent via the TX scheduler jobs 'single' and 'cyclic'.

  • Channel: selected transmit channel, either CHANNEL_TX or CHANNEL_TX1 can be used as there is only one TX channel.
  • Frame Index: index number that will be used in the transmit scheduler job table to refer to this frame.
  • Mode: either 'Transmit' to transmit the frame / trigger a new single transmit, or 'Mute' to stop the transmission of the frame.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

For $mode:

  • BrickletARINC429->TX_MODE_TRANSMIT = 0
  • BrickletARINC429->TX_MODE_MUTE = 1

Advanced Functions

BrickletARINC429->get_spitfp_error_count()
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)
Parameters:
  • $config – Type: int, Range: See constants, Default: 3
Returns:
  • undef

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()
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()
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()
Returns:
  • undef

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()
Return Array:
  • 0: $uid – Type: string, Length: up to 8
  • 1: $connected_uid – Type: string, Length: up to 8
  • 2: $position – Type: char, 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, $function)
Parameters:
  • $callback_id – Type: int
  • $function – Type: string
Returns:
  • undef

Registers the given $function name with the given $callback_id.

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

BrickletARINC429->set_heartbeat_callback_configuration($channel, $enabled, $value_has_to_change, $period)
Parameters:
  • $channel – Type: int, Range: See constants
  • $enabled – Type: bool, Default: 0
  • $value_has_to_change – Type: bool, Default: 0
  • $period – Type: int, Unit: 1 ms, Range: [0 to 216 - 1]
Returns:
  • undef

Sets the bricklet heartbeat callback function which reports the statistics counters for processed frames and lost frames. The period is the period with which the CALLBACK_HEARTBEAT_MESSAGE 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.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34
BrickletARINC429->get_heartbeat_callback_configuration($channel)
Parameters:
  • $channel – Type: int, Range: See constants
Return Array:
  • 0: $enabled – Type: bool, Default: 0
  • 1: $value_has_to_change – Type: bool, Default: 0
  • 2: $period – Type: int, Unit: 1 ms, Range: [0 to 216 - 1]

Gets the current configuration of the bricklet heartbeat callback, see set_heartbeat_callback_configuration().

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34
BrickletARINC429->set_rx_callback_configuration($channel, $enabled, $value_has_to_change, $timeout)
Parameters:
  • $channel – Type: int, Range: See constants
  • $enabled – Type: bool, Default: 0
  • $value_has_to_change – Type: bool, Default: 0
  • $timeout – Type: int, Unit: 1 ms, Range: [0 to 216 - 1]
Returns:
  • undef

Sets 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_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34
BrickletARINC429->get_rx_callback_configuration($channel)
Parameters:
  • $channel – Type: int, Range: See constants
Return Array:
  • 0: $enabled – Type: bool, Default: 0
  • 1: $value_has_to_change – Type: bool, Default: 0
  • 2: $timeout – Type: int, Unit: 1 ms, Range: [0 to 216 - 1]

Gets the configuration of the frame reception callback, see the set_rx_callback_configuration().

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

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 the callback function name:

sub my_callback
{
    print "@_[0]";
}

$arinc429->register_callback(BrickletARINC429->CALLBACK_EXAMPLE, 'my_callback')

The callback function will be called from an internal thread of the IP Connection. In contrast to many other programming languages, variables are not automatically shared between threads in Perl. If you want to share a global variable between a callback function and the rest for your program it has to be marked as :shared. See the documentation of the threads::shared Perl module for more details.

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_MESSAGE
Callback Parameters:
  • $channel – Type: int, Range: See constants
  • $status – Type: int, Range: See constants
  • $seq_number – Type: int, Range: [0 to 255]
  • $timestamp – Type: int, Range: [0 to 216 - 1]
  • $frames_processed – Type: int, Range: [0 to 216 - 1]
  • $frames_lost – Type: int, 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.

  • Channel: channel from which this heartbeat messages originates.
  • Status: will always be 'statistics'.
  • 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.
  • 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 FIFO buffer, RX channels: number of received Arinc429 frames that could not be reported due to a full callback FIFO buffer.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

For $status:

  • BrickletARINC429->STATUS_NEW = 0
  • BrickletARINC429->STATUS_UPDATE = 1
  • BrickletARINC429->STATUS_TIMEOUT = 2
  • BrickletARINC429->STATUS_SCHEDULER = 3
  • BrickletARINC429->STATUS_STATISTICS = 4
BrickletARINC429->CALLBACK_FRAME_MESSAGE
Callback Parameters:
  • $channel – Type: int, Range: See constants
  • $status – Type: int, Range: See constants
  • $seq_number – Type: int, Range: [0 to 255]
  • $timestamp – Type: int, Range: [0 to 216 - 1]
  • $frame – Type: int, Range: [0 to 232 - 1]
  • $age – Type: int, Unit: 1 ms, Range: [0 to 216 - 1]

This callback is triggered according to the configuration set by set_rx_callback_configuration().

  • Channel: channel from which this frame messages originates.
  • Status: 'new' signals that the frame (label + SDI combination) was received for the first time ever or again after a previous timeout. 'update' signals that a new frame was received. 'timeout' signals that the frame (label and SDI combination) encountered the timeout state.
  • 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: holds the complete Arinc429 frame including the label and SDI bits as a 32 bit integer. If 'parity_auto' is set for the channel, the parity bit will always come as 0. Opposite to the line transmission format, in the API functions the label code is mirrored such that the label code can directly be extracted from the frame by simply grabbing the lower 8 bits.
  • Age: time in milliseconds since this frame (label + SDI combination) was received last. If not received before or after a previous timeout, 60000 or the timeout value set with the set_rx_callback_configuration() will be returned.

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

For $status:

  • BrickletARINC429->STATUS_NEW = 0
  • BrickletARINC429->STATUS_UPDATE = 1
  • BrickletARINC429->STATUS_TIMEOUT = 2
  • BrickletARINC429->STATUS_SCHEDULER = 3
  • BrickletARINC429->STATUS_STATISTICS = 4
BrickletARINC429->CALLBACK_SCHEDULER_MESSAGE
Callback Parameters:
  • $channel – Type: int, Range: See constants
  • $status – Type: int, Range: See constants
  • $seq_number – Type: int, Range: [0 to 255]
  • $timestamp – Type: int, Range: [0 to 216 - 1]
  • $userdata – Type: int, Range: [0 to 255]

This callback is triggered by the 'Callback' job in the transmit schedule.

  • Channel: channel from which this frame messages originates, will always be 'CHANNEL_TX1'.
  • Status: will always be 'scheduler'
  • 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.
  • Userdata: 8 bit number as set in the scheduler callback job

The following constants are available for this function:

For $channel:

  • BrickletARINC429->CHANNEL_TX = 0
  • BrickletARINC429->CHANNEL_TX1 = 1
  • BrickletARINC429->CHANNEL_RX = 32
  • BrickletARINC429->CHANNEL_RX1 = 33
  • BrickletARINC429->CHANNEL_RX2 = 34

For $status:

  • BrickletARINC429->STATUS_NEW = 0
  • BrickletARINC429->STATUS_UPDATE = 1
  • BrickletARINC429->STATUS_TIMEOUT = 2
  • BrickletARINC429->STATUS_SCHEDULER = 3
  • BrickletARINC429->STATUS_STATISTICS = 4

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()
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)
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 = 2
  • BrickletARINC429->FUNCTION_SET_CHANNEL_CONFIGURATION = 5
  • BrickletARINC429->FUNCTION_SET_CHANNEL_MODE = 7
  • BrickletARINC429->FUNCTION_CLEAR_ALL_RX_FILTERS = 9
  • BrickletARINC429->FUNCTION_SET_RX_STANDARD_FILTERS = 11
  • BrickletARINC429->FUNCTION_SET_RX_CALLBACK_CONFIGURATION = 15
  • BrickletARINC429->FUNCTION_WRITE_FRAME_DIRECT = 18
  • BrickletARINC429->FUNCTION_WRITE_FRAME_SCHEDULED = 19
  • BrickletARINC429->FUNCTION_CLEAR_SCHEDULE_ENTRIES = 20
  • BrickletARINC429->FUNCTION_SET_SCHEDULE_ENTRY = 21
  • BrickletARINC429->FUNCTION_RESTART = 23
  • BrickletARINC429->FUNCTION_SET_FRAME_MODE = 25
  • 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)
Parameters:
  • $function_id – Type: int, Range: See constants
  • $response_expected – Type: bool
Returns:
  • undef

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 = 2
  • BrickletARINC429->FUNCTION_SET_CHANNEL_CONFIGURATION = 5
  • BrickletARINC429->FUNCTION_SET_CHANNEL_MODE = 7
  • BrickletARINC429->FUNCTION_CLEAR_ALL_RX_FILTERS = 9
  • BrickletARINC429->FUNCTION_SET_RX_STANDARD_FILTERS = 11
  • BrickletARINC429->FUNCTION_SET_RX_CALLBACK_CONFIGURATION = 15
  • BrickletARINC429->FUNCTION_WRITE_FRAME_DIRECT = 18
  • BrickletARINC429->FUNCTION_WRITE_FRAME_SCHEDULED = 19
  • BrickletARINC429->FUNCTION_CLEAR_SCHEDULE_ENTRIES = 20
  • BrickletARINC429->FUNCTION_SET_SCHEDULE_ENTRY = 21
  • BrickletARINC429->FUNCTION_RESTART = 23
  • BrickletARINC429->FUNCTION_SET_FRAME_MODE = 25
  • 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)
Parameters:
  • $response_expected – Type: bool
Returns:
  • undef

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)
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()
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)
Parameters:
  • $pointer – Type: int, Unit: 1 B, Range: [0 to 232 - 1]
Returns:
  • undef

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)
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)
Parameters:
  • $uid – Type: int, Range: [0 to 232 - 1]
Returns:
  • undef

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()
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.