Main Content

ASCII Encoding/Decoding Loopback Test

This model shows how to send ASCII data over a serial link.

The ASCII Encode block generates a message with three different sub messages along with some extraneous data to show how the FIFO Read HDRS block can remain synchronized to the valid byte stream even in the presence of transmission errors.

The FIFO Read HDRS block can handle an arbitrary number of headers; just add them as strings to the cell array in the block parameters dialog box. The messages must share the same termination string. In this example, it is a carriage return followed by a line feed: "\r\n".

Open Model

model = 'slrt_ex_serialasciitest';
open_system(model);

Configure Model and Simulate

set_param(model,'StopTime','30');
sim(model)

Close Model

bdclose(model);

See Also