13.11.2014 Views

41-553M.pdf - Pickering Interfaces

41-553M.pdf - Pickering Interfaces

41-553M.pdf - Pickering Interfaces

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ERROR INJECTION<br />

intermittent, random errors in bus controller transmissions without stopping<br />

the BC schedule.<br />

The following examples demonstrate how to define errors, tag messages and<br />

enable error injection. Note that the examples in this chapter are similar to<br />

those in earlier chapters, except that they ignore data to focus on the process<br />

of error injection.<br />

6.2 Errors in BC Transmissions: Unscheduled Messages<br />

The following code modifies Example 1 in Section 4.1 so that the message<br />

transmitted has a parity error in its command word.<br />

XMITFIELDS Msg;<br />

Card = L13_CardOpen(CARDNUM);<br />

L13_CardReset(Card);<br />

L13_BCConfig(BCCFG_DEFAULT, Card);<br />

Msg.ctrlflags = MSGCRT_BCRT;<br />

Msg.cwd1 = 0x0843;<br />

Msg.data[0] = some_value0;<br />

Msg.data[1] = some_value1;<br />

Msg.data[2] = some_value2;<br />

L13_ErrorDefine(ERRDEF_PAR, 0, 0, ERRDEF_CWD1, 0, Card);<br />

L13_ErrorCtrl(ERRCTRL_ONCE | ERRCTRL_ANYMSG, Card);<br />

L13_BCTransmitMsg(&Msg, Card);<br />

if(Msg.errflags & (MSGERR_NORESP | MSGERR_ANYERR))<br />

{<br />

// The RT did not respond or had an error in its response.<br />

}<br />

else<br />

{<br />

// The message was completed successfully.<br />

// Check Msg.status1 for the RT’s status word response.<br />

}<br />

L13_CardClose(Card);<br />

Fig. 6-1 Example 6: Errors in unscheduled BC transmissions<br />

Only the L13_ErrorDefine and L13_ErrorCtrl functions are added<br />

to Example 1 (Fig. 4-1). L13_ErrorDefine specifies that the first command<br />

word in a message should contain a parity error. L13_ErrorCtrl<br />

arms the <strong>41</strong>-553 error-injection mechanism. This example can safely use the<br />

ERRCTRL_ANYMSG flag since only one message is to be transmitted.<br />

When L13_BCTransmitMsg is executed, the transmitted message contains<br />

incorrect parity in its command word as specified by the parameters of<br />

L13_ErrorDefine. According to MIL-STD-1553, an RT should never<br />

respond to invalid commands. Thus, in this example, no response is expected<br />

from the RT, and the first block of the if-else statement should be executed.<br />

<strong>41</strong>-553 User’s Manual 6-3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!