MX Foundation 4
Error Injection

The RT allows the user to send messages with many error types (per word basis). MIL-1553 modules contains a pool of 100 error injection structures. Each of these errors may be associated with any RT message by the periodic update message service. Each error structure may be configured with the mxfMIL1553ErrorInjectionSet() function. Any MIL-1553 channel handles of a module may be used with this function and refer to the same error pool.

In order to associate the error with a message, the mxfMIL1553TxPeriodicUpdateMsgWrite() function may be used. The MXF_MIL1553_DATAREC structure contains the errorIndex field that allows the message to be linked with a specific error index (0-99). To use this index, the MXF_MIL1553_TXPERIODIC_REC_CTRL_ERROR_INJ option bit must be set in the control word.

To inject an error to a status that has no data associated to it (for example, a RT response to a BC RX command), the dataSize field of the MXF_MIL1553_DATAREC structure can be set to 0. That way, there is no need to provide any data.

#define BUF_SA3_RX 0
uint32 rc;
HMXF_CHANNEL bc;
HMXF_BUFFER rtBuffer[1];
...
// Configures injection #1, parity error
if(!rc)
{
err.errors[0] = MXF_MIL1553_ERRORID_PAR;
rc = mxfMIL1553ErrorInjectionSet(bc, 1, &err);
}
// Sets RT data for address 5, subaddress 3, RX
if(!rc)
{
txRec1553 = (MXF_MIL1553_DATAREC *)txBuffer;
memset(txRec1553, 0, sizeof(MXF_MIL1553_DATAREC));
txRec1553->repeatCount = 1;
txRec1553->control = MXF_MIL1553_TXPERIODIC_REC_CTRL_ERROR_INJ;
txRec1553->service.txPeriodicUpdateMsg.errorIndex = 1; // parity error
rc = mxfMIL1553TxPeriodicUpdateMsgWrite(rtBuffer[BUF_SA3_RX], 1, txBuffer);
}
...

mil1553_errors.c

Updated 10/23/2023