MX Foundation 4
Retry

When a fault occurs in a transfer on a bus, four different actions may be taken:

  1. Ignore the failure and do not retry the transfer;
  2. Retry the transfer on the same bus;
  3. Retry the transfer on the alternate bus;
  4. Retry the transfer on the alternate bus, then on the active bus (2 retries).

Each message (MXF_MIL1553_TXPERIODIC_MJRFRAME_MSG structure) must specify the retry conditions and actions.

Conditions

A retry can be forced when the desired error bit mask (statusMask) of the MXF_MIL1553_TXPERIODIC_MJRFRAME_MSG structure is present (AND, NOT EQUAL or EQUAL) in the RT status word. This kind of retry may be enabled using the bit MXF_MIL1553_TXPERIODIC_MJRFRAME_MSG_RETRY_STATUSMASK_AND or MXF_MIL1553_TXPERIODIC_MJRFRAME_MSG_RETRY_STATUSMASK_NOTEQUAL or MXF_MIL1553_TXPERIODIC_MJRFRAME_MSG_RETRY_STATUSMASK_EQUAL in the retryHaltOptions field.

A retry can also be forced when the RT does not respond to the current command. This kind of retry may be enabled using the bit MXF_MIL1553_TXPERIODIC_MJRFRAME_MSG_RETRY_NORESPONSE_ENABLE in the retryHaltOptions field.

A retry can also be forced when an error on the bus occurs. This kind of retry may be enabled using the bit MXF_MIL1553_TXPERIODIC_MJRFRAME_MSG_RETRY_BUSERROR_ENABLE in the retryHaltOptions field.

Action

To set up the retry action to perform when one of these conditions occurs, each message may specify the action to perform. For each message, the retry action is specified in the field retryHaltOptions of the message structure. With the retry options, it is possible to perform the retry on the active bus (the same bus where the failure occurs), on the alternate bus or on the alternate bus and then on the active bus (2 retries) using the MXF_MIL1553_TXPERIODIC_MJRFRAME_MSG_RETRY_ACT_BUS or MXF_MIL1553_TXPERIODIC_MJRFRAME_MSG_RETRY_ALT_BUS or MXF_MIL1553_TXPERIODIC_MJRFRAME_MSG_RETRY_ACT_ALT_BUS bit mask.

It is also possible to use the dynamic bus selection option. This feature allows the data to be automatically switched to the alternate bus after a successful retry on that bus. This option can be set using the bit MXF_MIL1553_TXPERIODIC_MJRFRAME_MSG_RETRY_SWITCH_ENABLE. If this option is not used, the active bus will not be changed after the retry.

#define BUF_SA3_RX 0
#define RT_ADRS 20
#define RT_SUBADRS 3
uint32 rc;
HMXF_CHANNEL bc;
HMXF_BUFFER bcBufferTx[1];
...
// Sets the minor frame #0 using 1 Command
if(!rc)
{
memset(minorFrame, 0, sizeof(minorFrame));
// Command #0 : Address 20, Subaddress 3, RX, 3 words. Retry on alternate bus when bus error detected
rc = mxfMIL1553CommandCompose(RT_ADRS, RT_SUBADRS, MXF_MIL1553_MSGTYPE_RX, 3, &minorFrame[0].command);
if (!rc)
{
minorFrame[0].modulo = 1;
minorFrame[0].buffer = bcBufferTx[BUF_SA3_RX];
minorFrame[0].retryHaltOptions = MXF_MIL1553_TXPERIODIC_MJRFRAME_MSG_RETRY_BUSERROR_ENABLE | MXF_MIL1553_TXPERIODIC_MJRFRAME_MSG_RETRY_ALT_BUS;
rc = mxfMIL1553TxPeriodicMajorFrameSet(bc, 0, 0, 1, minorFrame, NULL);
}
}
...

mil1553_errors.c

Updated 10/23/2023